Simon Brunel [Tue, 12 Mar 2019 07:35:39 +0000 (08:35 +0100)]
Keep the previous extensions page link alive (#6127)
Instead of a direct link, restore the extensions.md file which now redirects /notes/extensions.html to https://github.com/chartjs/awesome in case anyone bookmarked it / there were links to it.
Simon Brunel [Sun, 3 Mar 2019 14:19:11 +0000 (15:19 +0100)]
Optimize the npm package by removing useless files (#6105)
Explicitly target files that should be included in the npm package, making it 10x smaller by removing the docs, samples, scripts, sources, tests and other useless files.
Simon Brunel [Fri, 1 Mar 2019 08:13:21 +0000 (09:13 +0100)]
Revamp the README.md and add link to the awesome list (#6096)
Integrate the upcoming awesome list and make our README.md welcome page more user friendly by displaying the Chart.js logo, adding the docs TOC and removing instructions that was already in the docs.
Vincent-Ip [Wed, 27 Feb 2019 22:06:54 +0000 (17:06 -0500)]
New weight option for pie and doughnut charts (#5951)
Add functionality to give pie & doughnut datasets a weight attribute, which affects the relative thickness of the dataset when there are multiple datasets in pie & doughnut charts. The default weight of each dataset is 1, providing any other numerical value will allow the pie or doughnut dataset to be drawn with a thickness relative to its default size.
For example a weight of 2 will allow the dataset to be drawn double its typical dataset thickness. Note that the weight attribute will only affect a pie or doughnut chart if there is more than one visible dataset. Using weight on a pie or doughnut dataset when there is only one dataset on the chart will have no affect.
Ben McCann [Mon, 18 Feb 2019 18:45:38 +0000 (10:45 -0800)]
Use `datetime` as default time scale tooltip format (#6019)
Remove the logic that computed an "optimal" tooltip format. Instead, always fallback to the `datetime` adapter format which is more efficient and stable. Additionally, remove the adapter `presets` API, which is not needed anymore.
Janelle deMent [Thu, 14 Feb 2019 02:12:52 +0000 (22:12 -0400)]
Add examples of scriptable charts (#6042)
* Add example of scriptable pie chart
* Add example of scriptable line chart
* Add example of scriptable polar area chart
* Add example of scriptable radar chart
Simon Brunel [Fri, 8 Feb 2019 17:17:04 +0000 (18:17 +0100)]
Move CSS in a separate file to be CSP-compliant (#6048)
In order to be compatible with any CSP, we need to prevent the automatic creation of the DOM 'style' element and offer our CSS as a separate file that can be manually loaded (`Chart.js` or `Chart.min.js`). Users can now opt-out the style injection using `Chart.platform.disableCSSInjection = true` (note that the style sheet is now injected on the first chart creation).
To prevent duplicating and maintaining the same CSS code at different places, move all these rules in `platform.dom.css` and write a minimal rollup plugin to inject that style as string in `platform.dom.js`. Additionally, this plugin extract the imported style in `./dist/Chart.js` and `./dist/Chart.min.js`.
Jukka Kurkela [Wed, 30 Jan 2019 10:43:42 +0000 (12:43 +0200)]
Prevent infinite resize when vertical scrollbar appears (#6011)
If the container size shrank during chart resize, let's assume scrollbar appeared. So we resize again with the scrollbar visible effectively making chart smaller and the scrollbar hidden again. Because we are inside `throttled`, and currently `ticking`, scroll events are ignored during this whole 2 resize process. If we assumed wrong and something else happened, we are resizing twice in a frame (potential performance issue)
Simon Brunel [Tue, 29 Jan 2019 16:52:21 +0000 (17:52 +0100)]
Deprecate configMerge and scaleMerge helpers (#6022)
These methods shouldn't have been public since they are specific to the chart controller internal logic. Note that this scale custom merging will be removed in v3.
Simon Brunel [Wed, 9 Jan 2019 13:40:11 +0000 (14:40 +0100)]
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).