Commit Graph

5 Commits

Author SHA1 Message Date
Simon Brunel
55128f74c1 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`.
2019-02-08 19:06:04 +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
Bart Deslagmulder
858d86eebb Add label for first dataset in progress-bar example (#5625)
While the second dataset already has a label ("My Second dataset") the first dataset showed "undefined" as a label. Added a label to the first dataset object.
2018-07-09 20:27:43 +02:00
Loïc Bourgois
182270ef9b Setup HTML and JS linters for samples (#5195) 2018-02-03 13:28:54 +01:00
Simon Brunel
6e57405a0a Reorganize samples and list them in index.html (#4043) 2017-03-20 20:40:44 -04:00