Commit Graph

296 Commits

Author SHA1 Message Date
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
Joe B. Lewis
ecac839f68 Fix broken link to point to correct sample file. 2017-04-15 09:27:27 -04:00
Thomas Redston
35dcfe00b1 Time scale improvements to improve performance and reliability
* Make parseTime private
* start on fixing time scale
* Reimplement existing functionality
* Tidy tests
* Fix labels for non-linearly sized units

Months, quarters and years have non-constant numbers of seconds. A scale that's linear WRT milliseconds produces incorrect tick labels due to the label formatting losing precision (eg year labels lose month and day so a label of 2016-12-32 displays as 2016 instead of 2017).

* Re-implement tick generation

As in v2.5
2017-04-02 08:49:00 -04:00
ellie
c96ad66945 Update line-customTooltips.html (Re issue #4038 )
Add window scroll position to tooltip position calculation so they show up in the intended place instead of potentially off-screen! Moved tooltips inside the canvas parent container since they are being positioned in terms of its location
2017-03-22 06:35:50 -04:00
Simon Brunel
6e57405a0a Reorganize samples and list them in index.html (#4043) 2017-03-20 20:40:44 -04:00
Simon Brunel
4b421a50bf Add support to fill between datasets (#4008)
The `fill` option now accepts the index of the target dataset (number) or a string starting by "+" or "-" followed by a number representing the dataset index relative to the current one (e.g. `fill: "-2"` on dataset at index 3 will fill to dataset at index 1). It's also possible to "propagate" the filling to the target of an hidden dataset (`options.plugins.filler.propagate`). Fill boundaries `zero`, `top` and `bottom` have been deprecated and replaced by `origin`, `start` and `end`.

Implementation has been moved out of the line element into a new plugin (`src/plugins/plugin.filler.js`) and does not rely anymore on the deprecated model `scaleTop`, `scaleBottom` and `scaleZero` values. Drawing Bézier splines has been refactored in the canvas helpers (note that `Chart.helpers.canvas` is now an alias of `Chart.canvasHelpers`).

Add 3 new examples and extend utils with a pseudo-random number generator that can be initialized with `srand`. That makes possible to design examples starting always with the same initial data.
2017-03-18 11:08:57 +01:00
Simon Brunel
b92b256872 Flatten animation object and fix callbacks
Animation callbacks now receives `animationObject` directly with a reference on the associated chart (`animation.chart`), which deprecates `animation.animationObject` and `animation.chartInstance`. Also fix missing `onComplete` animation argument and make sure that an animation object is passed even when animations are disabled.
2017-03-03 06:49:47 -05:00
Marcelo Tedeschi
f97cab12b1 Refactored drawCaret and drawBackground functions to draw the background together with the caret in the same path 2017-02-24 19:27:05 -05:00