Commit Graph

303 Commits

Author SHA1 Message Date
Jukka Kurkela
ce74eb76a1 Convert axis options from arrays to objects (#6773)
* Convert axis options from arrays to objects

* Updated all chart type defaults
* Throw errors when axis type or position are not specified
* Avoid raising unnecessary errors when merging options into the default configs

* Fix additional tests

* Ensure scale defaults are set if type is not explicitly defined

* Another step

* Include `scale` as `firstIDs.r`

* update docs

* Update for buildOrUpdateScales

* Update migration guide

* Add test back
2019-11-21 18:46:49 -05:00
Jukka Kurkela
7f97adf5a0 Move scale defining options up from ticks (#6738)
* Move scale defining options up from `ticks`
* Include `ticks.reverse` in v3-migration
2019-11-15 12:11:13 -05:00
Jukka Kurkela
931d686adb Float bars: data as objects (#6739)
Float bars can be specified in object data points
2019-11-15 08:40:45 -05:00
Jukka Kurkela
4feaea925f Small chores (#6740)
* Remove duplicate code
* Migrate `xLabel` and `yLabel` from docs & samples
2019-11-13 19:04:56 -05:00
Jukka Kurkela
fef2a13ef6 Update time combo sample (#6736) 2019-11-12 19:20:52 -05:00
Evert Timberg
2354e2ff6b
Allow functions to be specified for scale grid line options (#6700)
Add scriptable options for scale styling
2019-11-12 07:03:00 -05:00
Jukka Kurkela
91466ae358 Remove remaingin zeroLine* references (#6728) 2019-11-11 12:12:11 -05:00
Jukka Kurkela
fcf76c5edd Fix sample paths and include all options (#6712) 2019-11-08 19:59:26 -05:00
Evert Timberg
95ba11a427
Add radial and linear gradient sample files (#6666)
* Add radial gradient sample file
* Add linear gradient sample file
2019-11-01 07:20:37 -04:00
Evert Timberg
0a873c0786
Fix polar area sample (#6665) 2019-11-01 07:19:36 -04:00
Ben McCann
99811328dc Make all ticks objects (#6645)
Make all ticks object
2019-10-31 18:45:13 -04:00
jatiny17
ae7a3c27a3 Adding title for the axes (#6571)
Create sample to show how to add an axis title
2019-10-31 18:14:37 -04:00
Ben McCann
eef153de40 Upgrade dependencies (#6662) 2019-10-31 18:03:00 -04:00
Jukka Kurkela
63b7bd7a5b Update deprecated constructors (#6647) 2019-10-30 18:41:40 -04:00
Jukka Kurkela
39d83eeae0 Fix scatter sample (#6627) 2019-10-28 18:08:52 -04:00
Ben McCann
9ff1c845f2 Bar options should not be defined on scale (#6249)
* Bar options should not be defined on scale

* Improve minimization

* Add tests

* Multiple datasets in test
2019-10-25 12:17:41 -04:00
Ben McCann
69a5082bd6 Make autoskip aware of major ticks (#6509)
* Make autoskip aware of major ticks
* Address review comments
* Fix codeclimate warning
* Add test for major and minor tick autoskipping
* Revert change for determining _majorUnit and fix sample
2019-10-19 16:13:04 -04:00
Akihiko Kusanagi
bd3ab17ef7 Add tests and a sample for radar scriptable line options (#6263)
* Add tests and a sample for radar scriptable line options

* Improve image tests
2019-05-21 18:06:12 -04:00
Ben McCann
e5c68e2c82 Fix data in financial sample (#6244) 2019-05-15 14:23:09 +02:00
Ben McCann
6a2d87f7bb Remove datapoint with duplicate timestamp in order to fix sample (#6169) 2019-04-01 17:30:58 +02:00
Ben McCann
30cb91d2eb Demonstrate multiple units on financial timeseries sample (#6119) 2019-03-28 07:56:37 +01:00
Janelle deMent
b9290a20de Make line options scriptable (#6128) 2019-03-21 09:06:39 +01:00
Ben McCann
0ac215b56a Improve financial sample tooltips and interactions (#6089) 2019-03-03 15:00:24 +01:00
Jon Rimmer
f3b18373e6 Add onLeave callback to legend (#6059) 2019-02-24 10:58:22 +01:00
Janelle deMent
58d7891ba2 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
2019-02-13 21:12:52 -05:00
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
Jukka Kurkela
e6a0c86909 Fix pointBackgroundColor in radar sample (#6013) 2019-01-25 11:48:01 +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
Angus Comrie
7e429a8fc6 Add 'middle' interpolation to stepped plots (#5908) 2018-12-18 14:47:24 +01:00
Simon Brunel
52b9793ba0 Use HTTPS instead of HTTP for URLs supporting it 2018-12-17 07:50:02 +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
ae80e14c51
Make bar styling options scriptable (#5780)
The bar `backgroundColor`, `borderColor`, `borderWidth` and `borderSkipped` options are now scriptable (unit tests, docs and a basic sample). Also fix the gulp task that generates the documentation on Windows.
2018-11-12 21:15:37 +01:00
Niladri Dutta
dfbb57468f Add 'parser' instead of deprecated 'format' in samples (#5769) 2018-10-16 23:12:51 +02:00
Tom Pullen
ab41173d9b Fix adding and removing datasets in bar samples (#5663)
Account for zero indexing of arrays when creating a name for an added dataset and remove the last dataset in the array when removing a dataset rather than removing the first.
2018-08-08 18:52:56 +02:00
Tom Pullen
a9c4e377a7 Add color to financial time series sample (#5661) 2018-08-08 18:44:53 +02: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
Evert Timberg
25f26346d5
Time Point Data sample works correctly (#5328) 2018-03-13 18:52:19 -04:00
Pierre GIRAUD
d0b26dbddd Show how to use circumference and rotation options (#5326) 2018-03-10 16:56:27 +01:00
Loïc Bourgois
182270ef9b Setup HTML and JS linters for samples (#5195) 2018-02-03 13:28:54 +01:00
Evert Timberg
274fca68c9
Update custom tooltip documentation and samples (#5166) 2018-01-21 16:47:50 -05:00
Xingan Wang
333f2eba99 Fix scale options update (#4198)
- allow options to be updated in-place or as a new object
- re-merge new options and rebuild scales & tooltips
- preserve reference to old scale if id/type not changed
- related tests and new sample also added.
- update document about options update
- update doc and example
2017-11-29 22:52:23 +01:00
Aspaldiko
34709826cd Fix incorrect samples titles (#4914) 2017-11-02 13:51:36 +01:00
Simon Brunel
543c31d549 Add Google Analytics to samples and update badges (#4734)
Inject the GA tracking snippet for all samples, including the index page. Also update README.md badges using the shields.io service for consistency with flat-square style and cache, and add release badges to the installation documentation page.
2017-09-10 08:31:59 -04:00
Ben McCann
fb4357ea91 Add a financial time series sample (#4554) 2017-09-10 10:54:12 +02:00
Simon Brunel
872dfec0f3 Introduce scriptable options (bubble chart) (#4671)
New `options.resolve` helper that determines the final value to use from an array of input values (fallback) and a given context and/or index. For now, only the bubble chart support scriptable options, see documentation for details.

Add scriptable options documentation and update the bubble chart dataset properties table with their scriptable and indexable capabilities and default values. Also move point style description under the element configuration section.
2017-08-24 09:34:38 +02:00
Simon Brunel
4c763bff44 Enforce spaces around infix/unary words operators (#4547)
Enable ESLint `space-infix-ops` and `space-unary-ops` (for words only) rules. Also added `samples` to the linting task to match Code Climate expectations.

http://eslint.org/docs/rules/space-infix-ops
http://eslint.org/docs/rules/space-unary-ops
2017-07-22 14:13:09 +02:00
Andrew
2d7c1f0d2c Time axis tick formatting with major and minor units (#4268)
Working towards creating the TimeSeries scale, this PR adds formatting for major and minor ticks on axes.
2017-06-15 07:20:16 -04:00
Andrew
f7f177f5ad Implemented aligment by senior unit in time axis. (#4267)
Implemented alignment by major unit in the time scale. This allows showing the first tick of a larger unit like days in a special way and is part of the basis of the time series scale.
2017-05-29 18:40:10 -04:00
Ben McCann
50e2ba953d Use https to load scripts from CDN in samples (#4255) 2017-05-13 17:24:00 +02:00
Eric Nikolay Katz
205cedc0ef Enhancement: adds step-after functionality, true defaults to step-before (#4065)
* Adds step-after functionality, true defaults to step-before

* Update stepped line sample to include all variations of steppedLine configurations

* Update documentation on steppedLine values

* Add tests for new steppedLine values 'before' and 'after'
2017-04-16 16:13:13 -04:00