Commit Graph

2454 Commits

Author SHA1 Message Date
Thomas Redston
9f3b51a80c Reuse parsed results rather than redoing work
The input labels/data is converted into moments in `determineDataLimits`, reuse them instead of duplicating the work.
2017-02-10 18:49:35 -05:00
Jerry Chang
074ab2aa87 Fixed HorizontalBar: stacked axis, displays NaN when all legends
unselected (#3770)

added ability to take snapshot of chart limits in order to be used
when max and min value is not finite

added ignore files
2017-02-10 18:40:37 -05:00
Simon Brunel
ba6e041713 Unit tests for Chart constructor and deprecations 2017-02-10 18:37:56 -05:00
Simon Brunel
28ea6c4967 Rename chartInstance to chart 2017-02-10 18:37:56 -05:00
Simon Brunel
13c6121876 Remove deprecated nested chart accesses 2017-02-10 18:37:56 -05:00
Simon Brunel
a0077d4117 Deprecate Chart.Controller (and nested chart) 2017-02-10 18:37:56 -05:00
etimberg
8c90b9f2de Fix issue with how Chart.PluginBase is defined 2017-02-09 17:36:32 -05:00
Matthisk Heimensen
6ff34a5d4a Added Django-Jchart link to docs/notes.md (#3865) 2017-02-03 18:17:33 -05:00
etimberg
9a3af51618 bump version number 2017-01-28 11:33:14 -05:00
Simon Brunel
7205ff5e2a Replace onEvent by before/afterEvent 2017-01-27 19:32:35 -05:00
Simon Brunel
1e9224d49c Make beforeDraw cancellable and fix easing value 2017-01-27 19:32:35 -05:00
Simon Brunel
979341ecb0 Plugin hooks and jsdoc enhancements
Make all `before` hooks cancellable (except `beforeInit`), meaning that if any plugin return explicitly `false`, the current action is not performed. Ensure that `init` hooks are called before `update` hooks and add associated calling order unit tests. Deprecate `Chart.PluginBase` in favor of `IPlugin` (no more an inheritable class) and document plugin hooks (also rename `extension` by `hook`).
2017-01-27 19:32:35 -05:00
Jakub Juszczak
c6fa4e5582 📝 Add vue-chartjs to docs
vue-chartjs is a wrapper written in vue for chartjs.
2017-01-27 08:05:08 -05:00
Evert Timberg
1ef9fbf7a6 inner radius could be slightly negative due to numerical errors 2017-01-25 08:59:31 -05:00
Evert Timberg
1934358663 remove unnecessary extra init steps 2017-01-22 15:16:35 -05:00
Jerry Chang
696f8d3a39 Documentation update on requiring Chart.js using CommonJS and es6 (#3788) 2017-01-22 10:31:22 -05:00
Simon Brunel
ceec907bee Ignore .gitignore (and more) from Bower packages 2017-01-22 10:31:02 -05:00
Thomas Redston
c20e57bc8a Only generate ticks we care about
Instead of cloning `me.scaleSizeInUnits` moments and probably throwing the vast majority away, only clone what we need.
2017-01-17 21:13:09 -05:00
Simon Brunel
312773ba7b Platform event API abstraction
Move base platform definition and logic in src/platform/platform.js and simplify the browser -> Chart.js event mapping by listing only different naming then fallback to the native type.

Replace `createEvent` by `add/removeEventListener` methods which dispatch Chart.js IEvent objects instead of native events. Move `add/removeResizeListener` implementation into the DOM platform which is now accessible via `platform.add/removeEventListener(chart, 'resize', listener)`.

Finally, remove `bindEvent` and `unbindEvent` from the helpers since the implementation is specific to the chart controller (and should be private).
2017-01-15 14:25:38 -05:00
Evert Timberg
9e9b9cf46d when the cutoutPercentage is 0, the inner radius should be 0 2017-01-15 12:46:01 -05:00
mdewilde
27b2e332c6 Correct anchor link (#3772) 2017-01-08 08:54:03 -05:00
SAiTO TOSHiKi
83c54194ae Fix : Scale label display at top and right. (#3741)
Fix Scale position at rotation when scale is top.
2017-01-05 09:00:05 -05:00
Jake
7c3e71d58b update copyright date 2017-01-02 13:26:51 -05:00
potatopeelings
eebaa84e72 Group stacked bar charts (#2643) (#3563)
Group stacked bar charts (#2643)
2017-01-01 09:36:01 -05:00
Zach Panzarino
bf61b2c297 Happy new year!
Updated copyright date to 2017
2016-12-31 22:25:55 +00:00
Timofey Rechkalov
6255131156 Update 07-Pie-Doughnut-Chart.md
Fixed example in pie chart docs.
2016-12-23 19:33:59 -05:00
Evert Timberg
ecc35c527b Refactoring to put browser specific code in a new class (#3718)
Refactoring to put browser specific code in a new class, BrowserPlatform.
BrowserPlatform implements IPlatform. Chart.Platform is the constructor for the platform object that is attached to the chart instance.

Plugins are notified about the event using the `onEvent` call. The legend plugin was converted to use onEvent instead of the older private `handleEvent` method.
Wrote test to check that plugins are notified about events
2016-12-21 10:22:05 -05:00
SAiTO TOSHiKi
5387c48bd8 Fix bar draw issue with borderWidth. (#3680)
Fix bar draw issue.
1. `Chart.elements.Rectangle.draw` function supports both horizontal and vertical bar.
2. Corrected bar position at minus.
3. Adjust bar size when `borderWidth` is set.
4. Adjust bar size when `borderSkipped` is set.
5. Adjust `borderWidth` with value near 0(base).
6. Update test.
2016-12-20 09:01:07 -05:00
SAiTO TOSHiKi
64b5def774 Fix : samples (line-stacked-area.html & step-size.html) (#3717)
Fix : samples
line-stacked-area.html:Changed j-query code to javascript
step-size.html:Fixed buttons not working
2016-12-18 12:49:43 -05:00
etimberg
7756bedec6 fix stacked bars on logarithmic axes 2016-12-18 09:11:58 -05:00
Simon Brunel
3187a788e1 Add support for local plugins and plugin options
Plugins can now be declared in the chart `config.plugins` array and will only be applied to the associated chart(s), after the globally registered plugins. Plugin specific options are now scoped under the `config.options.plugins` options. Hooks now receive the chart instance as first argument and the plugin options as last argument.
2016-12-18 08:46:15 -05:00
etimberg
e249de7162 fix options in getDatasetAtEvent 2016-12-17 19:00:03 -05:00
Evert Timberg
18f77db362 fix linting again 2016-12-16 22:24:12 -05:00
Evert Timberg
00d3c5a282 fix linting 2016-12-16 22:20:18 -05:00
SAiTO TOSHiKi
a5d9a02d5b Update core.scale.js
Change sie to size.
2016-12-16 19:59:32 -05:00
Tarqwyn
34d26ea497 Fix bug when calculating if steps fit into scale as a whole number then smal floating point errors make the consition pass false 2016-12-13 21:22:02 -05:00
etimberg
6f40d04964 Fix infinite loop in logarithmic tick generation 2016-12-07 18:47:30 -05:00
etimberg
75d15ff98b Fix newly introduced drawing bug when tick marks are not drawn 2016-12-07 18:47:30 -05:00
Wang Shenwei
6aec98bf8b Correct document for Interaction Modes #3676 (#3684)
'x-axis' Behaves like 'index' mode with intersect = false
2016-12-06 08:05:04 -05:00
Jonathon Hill
152ce9c9f8 Pass the hover event to the onHover event handler (#3669)
Pass the hover event to the onHover event handler

This makes the behavior of the `onHover` handler consistent with the `onClick` handler:

```
function(event, activeElements) {
    var chartInstance = this;
}
```
2016-12-03 17:42:33 -05:00
SAiTO TOSHiKi
5a24bfa500 Implement clipping (#3658)
Implements clipping of items outside the chart area. Resolves #3506 #3491 #2873
2016-12-03 16:09:45 -05:00
Toshiki Saito
bdcdbc2abf Fixed miscalculation of Bar width.
for Bar and horizontalBar type,
include stacked scale.
issue #3589
2016-12-02 07:57:59 -05:00
Evert Timberg
b39c0e1f93 Fix rotated label meaasurements (#2879, #3354). When measuring the first width and last width, the fact that arrays of text are
present must be considered. In addition to fixing this, I did some general code cleanup in the fit and calculateLabelRotation methods.
2016-12-02 07:56:54 -05:00
Evert Timberg
3ff58e5065 Revert "Fixed tooltip labelling on Bar Chart when min is defined (#3618)" 2016-12-01 07:58:39 -05:00
Evert Timberg
5bf203037c Do not notify plugins when a silent resize occurs (#3650)
Prevent the resize method from notifying plugins if it is a silent resize. A silent resize occurs during startup and we do not want plugins to do anything here because the chart is not set up.
2016-11-29 10:43:52 +01:00
Jerry Chang
b6807b2dd9 fixed tooltip labelling on Bar Chart when min is defined
added helper method to adjust the index

pass in chartConfig rather than access within method, make it easier to
test

added semi-colon at the end of helper method

added test for adjustIndex helper method

fixed lint issues

added integration test for the interaction of trigger an event over the
bar

.

.

moved adjustIndex into element helper

removed method from helper and adjusted method in core.interaction

added test for the element adjustIndex helper

added a skipIndexAdjustment method to handle when to skip the adjustment
along with test cases

fixed lint issues

removed the test for the helper method
2016-11-28 18:29:56 -05:00
SAiTO TOSHiKi
d39ac38ce1 Fix : Tooltip label for category scale. (#3649) 2016-11-28 18:28:39 -05:00
etimberg
7a8f20e88f Fix monotone cubic interpolation when two adjacent points are at the exact same x pixel value 2016-11-28 18:28:06 -05:00
Christopher Moeller
09f30be9eb Add rectRounded to point style sample 2016-11-26 12:58:49 -05:00
Christopher Moeller
97f6c8f12d Add rectRounded point style 2016-11-26 12:58:49 -05:00