Commit Graph

2491 Commits

Author SHA1 Message Date
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
etimberg
2e5df0ff42 Allow updating the config of a chart at runtime 2016-11-25 07:19:59 -05:00
Evert Timberg
7e5e29e3ee Improve radial scale (#3625)
Clean up radial linear scale. It now supports multiple lines for point labels. Fixes #3225
2016-11-25 07:19:43 -05:00
Jeff Carey
fe68b77606 Upgraded dependency gulp-uglify to 2.0.0 (#3635) 2016-11-22 23:51:22 +01:00
etimberg
68b00b2dc5 Labels can get bigger when the 2nd fit happens. Don't arbitrarily force the size to change 2016-11-20 13:49:44 -05:00
etimberg
58afbe428c Properly use the ticks.padding option. To correctly fix the issue, the default padding was changed from 0 to 10. This change caused all of the test changes since the width of a vertical scale was lowered by 10px 2016-11-20 11:52:08 -05:00
Jerry Chang
4fbb1bdbbc Fixed Issue with tooltip label display when given null data value (#3528)
When datasets.data contains a null value, the label displays incorrect
value.

code additions:
- unit tests for truthy label values (when data is null)
- checks to ensure handling of null value in getLabelByIndex method

added mock data sets from issue #3528 example

expect the return value from getLabelForIndex method to be valid (truthy)

added check for null of first data value in getLabelForIndex

fixed indentation and null comparison operator in code

fixed mistake in definition of firstData variable

changed testing for data on index 0 to using index variable

changed firstData to use value instead

condense the statments to use value variable
2016-11-19 09:29:15 -05:00
etimberg
48cb8b78e7 Remove unnecessary padding usages and update category scale tests 2016-11-18 17:58:07 -05:00
Evert Timberg
5dd1c77cf5 Take vertical padding into account 2016-11-18 17:58:07 -05:00
Evert Timberg
eaf109c2b1 When an axis needs padding due to a long, rotated, label it should be added inside the layout system rather than in each axis. 2016-11-18 17:58:07 -05:00
Jeff Carey
fd2e40ce11 Fixed vertical alignment in legend text (#3387) 2016-11-18 07:35:31 -05:00
etimberg
f7d60c2606 Allow line chart to use pointBorderWidth of 0 correctly 2016-11-17 21:05:47 -05:00
Jonathon Hill
0b4123b92c Update the documentation plugin list (#3610)
Add chartjs-plugin-draggable to the list of plugins, update existing ones recently renamed and re-order the list by names.
2016-11-17 10:29:36 +01:00
38elements
afab387cc1 Fix link in 01-Chart-Configuration.md (#3607) 2016-11-16 07:21:44 -05:00