Commit Graph

2836 Commits

Author SHA1 Message Date
Janelle deMent
352e53a0b6 Update the responsive docs about resizing the parent node (#5974)
Add a note about resizing the chart height with maintainAspectRatio
2019-01-13 21:20:25 +01:00
Evert Timberg
f3dd96779a Implement scriptable options for polar area charts (#5976) 2019-01-13 21:17:27 +01:00
Akihiko Kusanagi
9d1d2023d4 Fix labelOffset description (#5979) 2019-01-11 19:29:39 -05:00
Simon Brunel
8a3eb85928
Implement adapter to abstract date/time features (#5960) 2019-01-11 08:03:28 +01:00
Ben McCann
b50a1c21f2 Fix typo / grammar in the responsive docs (#5975) 2019-01-11 07:31:36 +01:00
Jukka Kurkela
20c748f90b Fix modifying ticks in afterBuildTicks (#5913) 2019-01-11 07:29:38 +01:00
Evert Timberg
e1ed26f315 Implement scriptable options for doughnut charts (#5966) 2019-01-10 16:00:36 +01:00
Simon Brunel
e03d8d8d7b
Make the main controller importable (#5969)
Merge `core/core.js` in `core/core.controller.js`, split default options next to their associated code and deprecate `Chart.types` (not sure what it was for).
2019-01-09 14:40:11 +01:00
Daniel Ruf
6c49140587 Remove unused parameter in removeResizeListener invocation (#5970) 2019-01-09 14:39:20 +01:00
Nodar Nutsubidze
9ecae7c5fb Test default tooltip callbacks for scatter charts (#5967)
This moves the mouse over the drawn point and verifies that there is no title in the tooltip and that the body contains expected content.
2019-01-09 14:37:25 +01:00
Alexander Wunschik
f342299845 Fix contribution docs about gulp-cli (#5968)
Update the docs so that only gulp-cli is installed globally
2019-01-09 08:10:58 +01:00
Jukka Kurkela
9d7eacd251 Fix generateTicks when working with tiny numbers (#5948) 2019-01-09 07:58:13 +01:00
Akihiko Kusanagi
820debf452 Refactoring using helpers.options.resolve (#5965) 2019-01-08 16:50:33 +01:00
Jukka Kurkela
dd3564aee5 Fix title, body and footer alignment inside tooltip (#5925) 2019-01-08 13:37:36 +01:00
Akihiko Kusanagi
934ce241ae Fix fitWithPointLabels calculation in radialLinear scale (#5963) 2019-01-07 12:48:57 +01:00
Simon Brunel
b7139dbbef Use Chart.min.js in samples (#5958)
Samples are supposed to show good practices and in most cases we don't use the time scale but require `Chart.bundle.js`, which is not correct. Instead, we should require the non-bundled version in its minified version (`Chart.min.js`). Paradoxically, time based examples don't use `Chart.bundle.js` but require moment manually side to `Chart.min.js`, which IMO is also the correct way since it allows users to configure and use moment globally (TZ, locales, etc.) and doesn't enforce a specific moment version.

Also remove the `data-labelling.html` example because we now have an [official plugin](https://github.com/chartjs/chartjs-plugin-datalabels) that implements this feature and don't want to deal with user custom code anymore.
2019-01-06 09:56:58 -05:00
Simon Brunel
87e44fa360
Cleanup scales export for better import strategy (#5953)
Scales now export their class and associated defaults (`_defaults`), the registration being done globally in `src/chart.js`.
2019-01-05 14:37:54 +01:00
Akihiko Kusanagi
26b7375329 Prevent bezier points from being capped when a data point is off the chart (#5937) 2019-01-05 12:28:15 +01:00
serhii-yakymuk
c51ac8a64a Make animation duration consistent across browsers (#5331) 2019-01-02 16:13:56 +01:00
Akihiko Kusanagi
39b4d61ac2 Fix time scale ticks.reverse issue (#5933) 2019-01-02 16:00:55 +01:00
Jukka Kurkela
918e2c027f Cast getRightValue to number in the bar controller (#5947) 2019-01-02 15:55:27 +01:00
Akihiko Kusanagi
aae05a08da Improve tick generation for linear scales (#5938)
* Improve tick generation for linear scales
* Simplify the tick generation code
* Refactor getTickLimit
2019-01-01 08:38:09 -05:00
CK
a8920f6b62 Fix RangeError exception when merging too many labels (#5936)
Fix "RangeError: Maximum call stack size exceeded" exception when calling `Array.push.apply` with too many items (>125000).
2018-12-31 13:35:51 +01:00
Jukka Kurkela
4b6e53a617 Properly calculate space needed by tick label on autoSkip (#5922) 2018-12-21 07:56:53 +01:00
Jukka Kurkela
d7e8b733e3 Add reverse support to time scale (#5927) 2018-12-20 16:08:13 +01:00
Akihiko Kusanagi
d29ec5a485 Add scale.pointLabels.lineHeight and scale.ticks.lineHeight options (#5914) 2018-12-20 09:56:06 +01:00
Jukka Kurkela
c8ce3d2018 Add support for typed arrays (#5905) 2018-12-18 14:49:39 +01:00
Angus Comrie
7e429a8fc6 Add 'middle' interpolation to stepped plots (#5908) 2018-12-18 14:47:24 +01:00
Akihiko Kusanagi
db8f6c38dc Add support for 'inner' border for arc elements (#5841) 2018-12-18 13:58:02 +01:00
Dave Salomon
4fb259e3ac Add support for hiding axis when all linked datasets are hidden (#5885)
When `display: 'auto'`, the axis is visible only if at least one associated dataset is visible.
2018-12-18 09:33:03 +01:00
Simon Brunel
52b9793ba0 Use HTTPS instead of HTTP for URLs supporting it 2018-12-17 07:50:02 +01:00
当耐特
2388eeaf38 Add omi-chart to extensions.md (#5912) 2018-12-15 12:27:08 +01:00
Ben McCann
3a29b99e3b Use HTTPS in documentation links where possible (#5915) 2018-12-15 11:28:17 +01:00
Simon Brunel
2a97ec21c5
Migrate from Browserify to rollup (#5904)
Browserify isn't optimal bundling Chart.js because it adds too many internal wrappers, doesn't handle external/global dependencies and doesn't provide a way to generate ESM builds. Therefore, it seems the right choice to switch to rollup, so move all the build process in `rollup.config.js` and make Gulp to execute `rollup -c`.

We also had to switch to Terser instead of UglifyJS because this last one contains a breaking bug. Note that tests now use the exact same rollup config as our builds (the minified one) to ensure that the bundling and minification steps don't break anything. Finally, replace the `gulp watch` task by `gulp build --watch` to be consistent with the other `unittest` and `docs` watching syntax.
2018-12-14 20:20:43 +01:00
Simon Brunel
f2a9e66b73 Remove innerHTML usage from our DOM platform (#5909)
Prevent "Unsafe assignment to innerHTML" reported by Firefox when submitting addon to their store.
2018-12-13 21:19:42 -05:00
Steve Gray
69fcba029b Remove autoSkip logic to always display last tick (#5891)
This changes the behavior of `autoSkip` so that it does not force the
display of the last tick. If the last tick can be displayed with equal
spacing to the rest of the ticks, it will be. Otherwise, it is not.
2018-12-09 12:56:51 -05:00
Akihiko Kusanagi
40495ec9d0 Fix the rounding issue of floating point numbers in category scale (#5880)
- Remove `Math.round` in the category scale code
- Add `helpers._alignPixel` to align grid/tick/axis border lines
- Fix grid/tick/axis border line calculation
- Add a check of the width of the axis border
- Refactor core.scale code
2018-12-09 11:34:34 +01:00
Akihiko Kusanagi
7c45fdac0d Remove gaps on the left and right when the axis offset is true (#5884) 2018-12-05 17:59:07 +01:00
Akihiko Kusanagi
bfa635e55d Fix docs about bar chart indexable options (#5876) 2018-12-04 09:10:15 +01:00
generic-github-user
5797e03421 Refactor data generation in scatter basic example (#5877)
Replace repeated function call with compact function, generateData
2018-12-04 09:07:35 +01:00
Simon Brunel
3cb2d7050e
Remove gulp-connect and add jsdelivr/unpkg paths (#5875) 2018-12-01 08:35:43 +01:00
Simon Brunel
be8d78a900
Make Chart.controllers.* importable (#5871)
`controllers.*.js` and `core.datasetController.js` are now importable (no more function export), that's why there is so many changes mainly due to one indentation level removed. Split code for `bar/horizontalBar` and `doughnut/pie` in separate files, added a global controllers import (`src/controllers/index.js`) and add tests to check that all dataset controllers are correctly registered under `chart.controllers.{type}`.
2018-11-29 21:06:34 +01:00
Akihiko Kusanagi
c84d249035 Fix test failures on Windows (#5872) 2018-11-29 21:05:36 +01:00
Akihiko Kusanagi
ecfa7b24c6 Add support for CanvasPattern and CanvasGradient in tooltip (#5869) 2018-11-29 13:52:56 +01:00
Simon Brunel
aa652df240
Deprecate Chart.{Type} classes (#5868)
It looks like these classes are a legacy from version 1 but we actually never promoted their usage. Instead, the regular way to create a chart is to set the type in the config, for example: `new Chart(ctx, {type: 'bar'})`. Some types are actually missing (no `Chart.HorizontalBar` or `Chart.Pie`) but it's also not scalable because it can easily conflict with other classes scoped under the `Chart` namespace.
2018-11-29 07:56:20 +01:00
Akihiko Kusanagi
d6ac7d8a80 Fix cut off tick labels in radial scale (#5848)
Fix the issue that the topmost tick label and the bottom of the chart area are cut off with a radial scale.
2018-11-28 08:35:15 +01:00
jedrekdomanski
bbca2fc789 Enhance documentation for bar specific scale options (#5854) 2018-11-28 07:56:41 +01:00
Akihiko Kusanagi
1f2fa5c90c Adjust the size of rectRounded/rectRot point to fit pointRadius (#5858)
- Calculate the vertices of the shapes so that they are inscribed in the circle that has the radius of `pointRadius`
- Remove `translate()` and `rotate()` to fix the regression introduced by #5319
- Refactor `rectRounded` for better performance
2018-11-28 07:53:41 +01:00
Akihiko Kusanagi
241499d27f Make getHoverColor() return the original value if it is CanvasGradient (#5865) 2018-11-27 19:54:03 -05:00
Jukka Kurkela
f5437fe548 Fix nearest interaction mode to return all items (#5857)
Return all items that are at the nearest distance to the point and add unit tests for nearest + axis: 'x' and nearest + axis: 'y'
2018-11-27 16:26:41 +01:00