Commit Graph

2594 Commits

Author SHA1 Message Date
Ben McCann
fa2ca2c1e2 Clarify that x/y coordinates only work with the time scale (#4826) 2017-10-07 22:18:50 -04:00
Simon Brunel
3fe198c860 Fix responsive issue when the chart is recreated (#4774)
Chrome specific issue that happens when destroying a chart and re-creating it immediately (same animation frame?). The CSS animation used to detect when the canvas become visible is not re-evaluated, breaking responsiveness. Accessing the `offsetParent` property will force a reflow and re-evaluate the CSS animation.
2017-10-07 17:43:09 +02:00
Fabio Poloni
73a3c3b821 fixed typo (#4819) 2017-10-06 07:36:39 -04:00
Rittyan
0bd0654efb fix colour settings of BeforeLabel and BeforeBody (#4783)
* fix colour settings of BeforeLabel and BeforeBody

* delete redundant variable declaration

* collect label colour setting.
2017-10-03 00:33:03 +02:00
Ben McCann
b4d69247b0 Fix handling of null labels (#4795) 2017-09-29 13:52:33 +02:00
Rydori
b94532c29f Error if style is null (#4781)
I tested in Chrome and when style(line 50) is null, style.toString is undefined
Reason: typeof null equals "object" (at least in Chrome)
2017-09-29 13:30:41 +02:00
Ben McCann
8a4ac1e12e Rename INTERVALS.major to INTERVALS.common (#4777) 2017-09-29 13:06:09 +02:00
Evert Timberg
52145de5db Fix regression in x-axis interaction mode (#4762) 2017-09-16 08:01:26 -04:00
Ben McCann
2b89f7a989 Consistent formatting for cartesian option docs (#4765) 2017-09-15 19:53:51 -04:00
Ben McCann
4396a53041 Expand scale jsdocs (#4736) 2017-09-11 16:33:20 -04:00
andig
ea703a54bf Implement scale label padding (#4646) 2017-09-10 13:15:47 -04: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
b2beb6f451 Update chartjs-color dependency (#4733)
Enforce dependencies minor versions (tilde symbol: include everything greater than a particular version in the same minor range).
2017-09-09 18:27:39 -04:00
Ben McCann
427aa99cb1 Make major ticks optional and off by default (#4723) 2017-09-08 18:25:51 -04:00
Simon Brunel
c7464ebf91 Add platform basic implementation (fallback) (#4708)
If `window` or `document` are `undefined`, a minimal platform implementation is used instead, which one only returns a context2d read from the given canvas/context.
2017-09-02 11:04:10 +02:00
Simon Brunel
e3b70e0420 Bump version to 2.7.0 2017-08-28 10:34:06 +02:00
andig
2f950e2ab3 Improve controller tests stability (#4698) 2017-08-27 22:43:16 +02:00
Simon Brunel
459c81d931 Remove trailing .js in plugin names (docs) 2017-08-26 08:09:22 +02:00
Akihiko Kusanagi
5d57de4e4d Fix bar chart with {x, y} data points (#4673) 2017-08-26 07:50:39 +02:00
Simon Brunel
5a014dc361 Fix wild special zero grid line when undefined (#4700)
Remove the special drawing for an undefined zero grid line since it causes issue when the first tick is not aligned on the scale extremity (ie only linear scales now display a special grid line for the origin). Hide scales in the filler plugin unit test fixtures to avoid future failures due to changes unrelated to the tested features.
2017-08-26 07:48:57 +02:00
Akihiko Kusanagi
488cbbcbf6 Fix flipped stepped line in filler plugin (#4697) 2017-08-26 07:42:46 +02:00
Simon Brunel
31049ebcba Add chartjs-plugin-datalabels plugin link (#4701) 2017-08-25 18:34:37 -04:00
andig
530c613e5c Improve bar test stability (#4694) 2017-08-24 18:16:08 -04:00
Simon Brunel
e758798798 Fix scriptable options documentation snippet 2017-08-24 10:31:17 +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
andig
46c3b2406e Make bar tests independent from scales (#4686) 2017-08-23 17:07:14 -04:00
Evert Timberg
5a3de5163a When a radial scale is rotated using the startAngle option, the tick labels did not appear in the correct places. (#4682) 2017-08-21 18:17:49 -04:00
andig
0e5ce3f4e7 Fix autoskipped ticks messing up category axis (#4649) 2017-08-19 09:03:11 -04:00
Xingan Wang
b9afeaf973 remove redundant tooltip initialize (#4655) 2017-08-14 07:37:17 -04:00
Akihiko Kusanagi
7dc71d009b Make offsetGridLines consistent and add new offset scale option (#4545)
Add a new `offset` option to scales to add extra space at edges and remove the `includeOffset` argument from `getPixelForValue()` and `getPixelForTick()`. The bar controller now automatically calculates the bar width to avoid overlaps. When `offsetGridLines` is true, grid lines move to the left by one half of the tick interval, and labels don't move.
2017-08-14 10:09:33 +02:00
Zach Panzarino
7e6b46253d Update codeclimate.yml (#4654)
* Update codeclimate.yml

* Update .codeclimate.yml
2017-08-13 22:42:34 -04:00
andig
3e2b405b97 Ticks callback is now called with this as scope (#4632) 2017-08-13 11:44:06 +02:00
Ben McCann
4697226c8c Document new time options (#4592) 2017-08-08 17:39:19 -04:00
Ben McCann
1eeffa3d58 Refactor autoskip functionality into a separate method (#4614) 2017-08-07 20:24:59 +02:00
andig
8dca88c7d5 Fix tests on OSX with retina screen
* Fix retina unit test failures
* Honor config file formatting
* Prevent gulp error on non-zero karma result
2017-08-05 10:48:12 -04:00
Simon Brunel
9ef5cc72f6 Enforce variable declaration coding style (#4610)
For consistency, enable ESLint `one-var` rule to require multiple variable declarations for initialized variables per scope. Uninitialized variables can still be declared together (preferred) or separately.

http://eslint.org/docs/rules/one-var
2017-08-03 18:33:18 +02:00
Ben McCann
51603cce2e Make Chart.Ticks private and remove Chart.Ticks.generators.time (#4602) 2017-08-02 14:30:38 +02:00
Ben McCann
2922dc96cf Allow updating dataset types (#4586) 2017-08-02 07:29:34 +02:00
Simon Brunel
15934e49c5 Change scale.ticks.bounds to scale.bounds (#4595)
The `bounds` option makes more sense directly under `scale` since it defines the scale limits strategy when no explicit min/max are specified. Also change the `bounds: 'labels'` option value for `bounds: 'ticks'` because it really means: "ensure ticks to be fully visible in the scale, whatever the ticks `source`.
2017-08-02 07:28:27 +02:00
Simon Brunel
2c52209ba7 Replace the IFRAME resizer by DIVs (#4596)
Resize detection is now based on scroll events from two divs nested under a main one. Implementation inspired from https://github.com/marcj/css-element-queries.
2017-08-02 07:25:55 +02:00
Simon Brunel
f90ee8c786 Add support for detached canvas element (#4591)
Allow to create a chart on a canvas not yet attached to the DOM (detection based on CSS animations described in https://davidwalsh.name/detect-node-insertion). The resize element (IFRAME) is added only when the canvas receives a parent or when `style.display` changes from `none`. This change also allows to re-parent the canvas under a different node (the resizer element following). This is a preliminary work for the DIV based resizer.
2017-08-01 14:28:45 +02:00
Simon Brunel
97e2373721 Change ticks.mode to scale.distribution (#4582)
Fix `ticks.mode` behavior when `ticks.source` is `auto`: the lookup table is now built from the data and not from the ticks, so data (and ticks) are correctly distributed along the scale. Rename the option to `distribution` (more explicit than `mode`) and since this option applies from now on the data, it seems better to have it under `scale` instead `scale.ticks`.
2017-07-30 21:24:29 +02:00
Simon Brunel
53b7a6392f Change scale.ticks back to an array of strings (#4573)
Internal ticks are now stored as objects in the PRIVATE this._ticks member and must not be accessed directly from outside this class. this.ticks is around for a long time and hasn't been marked as private, so we can't change its structure without unexpected breaking changes. If you need to access the scale ticks, use scale.getTicks() instead.
2017-07-29 21:26:36 +02:00
Ben McCann
56fdd7ebc1 Allow specifying bar chart via {x, y} data points (#4565) 2017-07-29 21:22:52 +02:00
Evert Timberg
326991ce50 index-y interaction mode + convert horizontal bar defaults to new mode (#4458)
index-y interaction mode + convert horizontal bar defaults to new mode
2017-07-28 18:07:28 -04:00
Simon Brunel
2cc242d5a3 New time scale ticks.source: 'data' option (#4568)
This new option value generates ticks from data (including labels from {t|x|y} data objects).
2017-07-27 06:41:09 +02:00
andig
43baf2fbe0 Instructions to access resources built from master 2017-07-26 15:40:00 +02:00
Simon Brunel
c6bda02468 Rewrite unit test waitForResize helper (#4566)
The original implementation tries to intercept events from the chart internal iframe, which ones failing on Chrome 60. Checking internals doesn't seem the best approach, instead we could consider that a chart has been resized after the resize method has been called and processed. So let's hook `Chart.resize` and callback once it's done.
2017-07-26 13:33:45 +02:00
Simon Brunel
3aa7a20923 New time scale ticks.bounds option (#4556)
`ticks.bounds` (`'data'`(default)|`'label'`): `data` preserves the data range while `labels` ensures that all labels are visible. This option is bypassed by the min/max time options.

Remove the useless time scale `_model` object containing private members: instead, make these members private (prefixed by `_`) part of the scale.
2017-07-25 10:12:53 +02:00