Commit Graph

2360 Commits

Author SHA1 Message Date
Jacco van den Berg
8e19199f58 Update font spec type (#11605) 2023-12-04 19:56:38 +01:00
Josh Kelley
429d99dbc2 Tooltip fixes (getLabelAndValue on null controller, null getParsed) (#11596)
* Fix for getLabelAndValue on null controller

I encountered #11315 under the following circumstances:

1. Position the cursor over the chart area, such that it causes a
   tooltip to be shown.
2. Move the cursor out of the chart area, such that the tooltip remains
   visible.
3. Cause the chart contents to be changed, such that the dataset
   referenced by the active tooltip element is no longer valid.
4. Move the mouse again.  This triggers an `inChartArea = false` event,
   so it reuses the previous, now invalid, active elements.

This fixes #11315 under the circumstances for which I've reproduced it,
but there may be others.

* Further fixes for elements added / changed

This possibly fixes #11365.
2023-11-29 14:51:56 -05:00
Kevin Read
e92d10445b fix: Guard access to window in helpers.dom.ts for browserless rendering (#11588) 2023-11-17 16:34:20 +01:00
Jacco van den Berg
2a03e138e9 Fix backdrop padding (#11577)
* fix for alignment inner

* Add test

* Remove eslint ignores

* remove unecesarry config

* Remove text from test
2023-11-10 00:25:36 +01:00
Dimitris-Rafail Katsampas
6722512744 fix: Property platform missing from chart configuration typings (#11572) 2023-11-09 23:35:01 +01:00
Vsevolod Fedorov
06f9ffb275 fix: pass Plugin TType down to hooks chart arg (#11569) 2023-11-06 18:34:29 +01:00
Mikhail
ca77bed318 fix: simplify check hasFunction (#11490) 2023-09-11 08:31:29 +02:00
Cazka
e74ee7b75b allow mode to be a callback function (#11488) 2023-09-06 17:13:33 +02:00
Chocomint
44b97b8698 docs: Fix typo for documentation of plugins.tooltip.textDirection (#11483) 2023-09-04 10:13:29 +02:00
Mercy Bickell
a3fc84113e fix: Add backgroundColor type on CoreScaleOptions (#11348)
* Fix: add backgroundColor type on CartesianScaleOptions

* Add instead on CoreScaleOptions

* Remove redundant backgroundColor from RadialLinearScaleOptions
2023-08-08 00:18:54 +02:00
Bogdan Korshunov
132324f5b8 BorderRadius of Bar Chart issue on Firefox 116 (#11435)
Co-authored-by: bogdankorshunov <korshunov.oren@gmail.com>
2023-08-07 20:16:32 +02:00
stockiNail
79f1a0a9e8 Add clip option to scale configuration to allow unclipped scales (#11404)
* Add clip option to scale configuration to allow unclipped scales

* add images

* fix cc

* change name of function
2023-08-07 20:16:20 +02:00
stockiNail
a102ca515b Revert fix for monotone cubic interpolation (#11432) 2023-08-02 10:42:29 -04:00
stockiNail
bda2ae7c4f Revert feature to disable plugins by TS (#11422) 2023-07-26 08:59:42 -04:00
Josh Kelley
dd03016ba1 Updates to scale type definitions (#11419)
While adding some type definitions to chartjs-plugin-zoom
(see https://github.com/chartjs/chartjs-plugin-zoom/pull/774), I noticed
a few limitations in Chart.js's scale types:

* The zoom plugin calls `Scale.parse` with no index parameter.  Scale's
  JSDoc allows this, but its TypeScript definitions did not.
* The zoom plugin alters scale options' min and max.  The specific types
  of these depend on which scale is in use, but every scale has them, so
  `unknown` seems appropriate
2023-07-25 18:39:25 -04:00
stockiNail
f287be491c Add missing feature for disabling plugins in TyeScript (#11403)
* Add  missing feature for disabling plugins in TyeScript

* apply review

* remove empty line
2023-07-24 15:39:38 -04:00
stockiNail
cc7ee8ade1 Fix curve path if scale limits are set for line chart (#11377)
* Fix curve path if scale limits are set for line chart

* add scale limits test case
2023-07-24 19:58:23 +02:00
stockiNail
05608b0ceb Fix time series scale to have each data point is spread equidistant (#11388)
* Fix time series scale to have each data point is spread equidistant

* remove tabs

* remove casting and add/update test cases
2023-07-13 16:36:08 -04:00
skopz356
c392a7cc8c Fix type of tickBorderDash in GridLineOptions (#11396) 2023-07-11 14:32:10 -04:00
Evert Timberg
a173943e55 Split the TimeScaleOptions type into composable sub types (#11187) 2023-07-05 08:54:28 -04:00
Evert Timberg
f2cfb933b9 fix: add pointStyleWidth to type definitions (#11383) 2023-07-01 08:51:53 -04:00
stockiNail
57bbd8229d Fix mismatch between hit boxes and drawn items in legend plugin (#11352)
* Fix mismatch between hit boxes and drawn items in legend plugin

* fixes padding calculation
2023-06-20 18:20:12 +02:00
Jacco van den Berg
1c2dd6898e Add beforeDraw to drawtime type (#11358) 2023-06-20 18:16:50 +02:00
stockiNail
b42f9d127d Add events property to Plugin defined type (#11350) 2023-06-20 18:16:37 +02:00
Jacco van den Berg
201ddffa1d Add text stoke radial linear scale (#11346) 2023-06-13 23:31:17 +02:00
stockiNail
ec7be48470 Fix toggling showLine option on scatter controller (#11334) 2023-06-08 08:53:50 -04:00
Muhammad Khalikov
0cbc292dc7 Refined grammar and updated overall .md documentation files (#11324) 2023-06-05 09:56:56 +02:00
stockiNail
abbd5a7a70 Export explicitly the plugin options definition which is augmented (#11309) 2023-05-25 09:12:28 -04:00
Jacco van den Berg
62c7de1799 Expend note that chart must be in its own dedicated container (#11300) 2023-05-20 00:42:04 +02:00
stockiNail
eff39c0769 Enable point labels hiding when overlapped (#11055)
* Enable point labels hiding when overlapped

* fix cc

* fallback CC updates

* fixes CC
2023-04-27 18:28:55 -04:00
stockiNail
ee7e928cfe Enable applying of gradients and pattern on line segments (#11217)
* Enable applying of gradients and pattern on line segments

* add test case

* improve replacer
2023-04-27 18:25:13 -04:00
stockiNail
5ee0ff1b97 Border is counted as part of ArcElement (#11180)
* Border is counted as part of ArcElement

* improve calculation
2023-04-19 18:22:40 -04:00
Roman Shtylman
b16f32afca Check for isNaN before building number formatter options (#11238)
* Check for isNaN before building number formatter options

When datasets have values approaching Number.MAX_VALUE, the tick calculations might result in infinity and eventually NaN. Passing NaN for minimumFractionDigits or maximumFractionDigits will make the number formatter throw. Instead we check for isNaN and use a fallback value so the formatter does not throw.

* Update src/core/core.ticks.js

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>

---------

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
2023-04-19 18:22:25 -04:00
Tim Gates
b34e273880 docs: Fix a few typos (#11220)
There are small typos in:
- docs/general/colors.md
- src/controllers/controller.doughnut.js
- src/controllers/controller.pie.js
- src/scales/scale.time.js

Fixes:
- Should read `outer` rather than `outr`.
- Should read `indistinguishable` rather than `indistiguishable`.
- Should read `guesstimation` rather than `guestimation`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
2023-04-02 07:58:40 -04:00
Dan Onoshko
c0bf05f87d refactor: rewrite config helpers to ts (#11121)
* refactor: rewrite config helpers to ts

* refactor: review fixes
2023-03-21 16:03:15 -04:00
stockiNail
82aca7852f Use custom scale defaults and dataset axis ID options to determine the axis (#11134)
Use custom scale defaults to determine the axis
2023-02-15 09:27:13 -05:00
Dan Onoshko
1324672637 refactor: rewrite canvas helpers to ts (#11100)
* refactor: rewrite canvas helpers to ts

* refactor: review fixes

* refactor: rm src/helpers/types.ts temporary entry point
2023-02-15 09:26:49 -05:00
Mikhail
22c6906bbe Simplify _arrayUnique (#11145) 2023-02-15 09:20:29 -05:00
stockiNail
7f9bca6844 Add borderDash options to arc element (#11127) 2023-02-12 17:46:05 -05:00
leo2436
6cf9de9681 Change labelColors to labelColor in tooltip drawColorBox method. (#11135)
Co-authored-by: Leo Chen <liang.chen@thoughtworks.com>
2023-02-12 14:15:07 -05:00
CodingMarco
e417c60c22 Fix: don't generate ticks > max if max is specified (#11116)
* Fix: don't generate ticks > max if max is specified (#11083)

* Add test "Should not generate any ticks > max if max is specified" (#11083)
2023-02-10 07:57:58 -05:00
Shahab HM
2481547ef8 fix RTL tooltip colorBox placement (#11061)
* fix RTL tooltip colorBox placement #10771

* fix lint problem
2023-02-10 07:57:24 -05:00
Johannes Kronmüller
207fe8f66e fix: decimation plugin data not writeable after clean (#11045) 2023-02-10 07:45:43 +02:00
stockiNail
8dfcf1c443 Use maxTicksLimit option to calculate the labels size on ticks (#11069)
* Use maxTicksLimit option to calculate the labels size on ticks

* apply review
2023-02-09 09:26:11 -05:00
stockiNail
1db46efa5f Remove unused property from arc element for center calculation (#11124) 2023-02-08 18:01:11 -05:00
Dan Onoshko
6cb10dc895 chore: #10963 revert (#11102) 2023-02-07 11:51:48 -05:00
Jacco van den Berg
d20b59fb03 Add colors plugin TS options to be configured (#11115) 2023-02-07 08:19:00 -05:00
Yujin Choi
1684cf7dbf fix: add bgColor type in RadialLinearScaleOptions (#11081)
* fix: add bgColor type in RadialLinearScaleOptions

* Update src/types/index.d.ts

remove trailing space

---------

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
2023-01-30 18:23:08 -05:00
Jean-Louis Jouannic
b967d71c87 🐛 fixes compilation error when option --isolatedModules is set (#11095)
* 🐛 fixes compilation error when option --isolatedModules is set

* ♻️ preserve UpdateModeEnum to prevent breaking change
2023-01-28 09:19:02 -05:00
stockiNail
e8d9fb579e Add format method to time scale to format timestamp using scale options (#11063) 2023-01-18 08:27:52 -05:00