Commit Graph

258 Commits

Author SHA1 Message Date
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
Marcelo Tedeschi
af11be3ce4 Added possibility to draw tooltip borders 2017-02-24 19:27:05 -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
potatopeelings
eebaa84e72 Group stacked bar charts (#2643) (#3563)
Group stacked bar charts (#2643)
2017-01-01 09:36:01 -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
Christopher Moeller
09f30be9eb Add rectRounded to point style sample 2016-11-26 12:58:49 -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
etimberg
74d4dbc608 X and Y interaction modes now use the intersect option 2016-11-05 08:19:07 -04:00
Josh Soref
67934920be Spelling fixes (#3522)
Including: actually, aspect, bottom, changes, characters, datasets, divisible, downward, guidelines, instance, instances, interrupted, item, javascript, label, lifecycle, lines, plugins, manually, milliseconds, nearest, occurring, position, predefined, recalculate, tooltip, those
2016-10-27 21:18:31 +02:00
Evert Timberg
80bd08bef9 Update chartColors.js to utils.js and move randomScalingFactor function there 2016-10-23 16:33:25 -05:00
etimberg
9ad9cd2154 Reorganized sample files into sub directories. Added a helper containing colours that should be used by all samples.
I added new samples to explain behaviour and modified all samples to have consistent styling. In updating the samples,
I removed the use of jQuery and instead use standard methods.

For the custom tooltip samples, I updated the styling to show color boxes like the regular tooltips.
2016-10-23 16:33:25 -05:00
bydooweedoo
3bd4d283f7 Custom tooltip: add data points infos (#3201)
Expose tooltip items from tooltip model and added `x` and `y` properties to `TooltipItemInterface`
2016-10-19 08:48:17 -05:00
etimberg
a0388eff4c Add new properties for the caretX,caretY point of a tooltip. Useful for custom tooltips.
The custom tooltip sample was updated as well to use the new properties.
2016-10-19 06:30:41 -05:00
Evert Timberg
03735563f4 Improve Tooltip and Hover Interaction (#3400)
Refactored interaction modes to use lookup functions in Chart.Interaction.modes and added new modes for 'point', 'index', 'nearest', 'x', and 'y'
2016-10-03 16:05:21 -04:00
Simon Brunel
d610987cfb Fix radar default aspect ratio and samples
Now that the aspect ratio is correctly handled, fix samples for charts with aspect ratio of 1 which was vertically too large. Also fix the default aspect ratio for radar charts which wasn't applied when creating a chart directly using new Chart(ctx, { type: 'radar' }).
2016-09-23 17:47:36 +02:00
Evert Timberg
89531c6b93 Merge pull request #3112 from MatthieuRivaud/MonotoneCubicInterpolation
Monotone cubic interpolation
2016-08-22 17:53:31 -04:00
Zach Panzarino
6e9ee1f137 Merge 'Documentation updates' #3110 2016-08-10 00:12:56 +00:00
MatthieuRivaud
d06fbc772f - Added dataset option |cubicInterpolationMode| to allow for curves with different interpolation modes on the same graph (updated doc accordingly)
- Added new sample file to demonstrate the monotone cubic interpolation mode
- Fixed a typo in a comment in updateBezierControlPoints
2016-08-08 15:35:46 +02:00
Zach Panzarino
660c3850d7 Documentation updates
Adds a lot of new information to the docs that will help developers better utilize the entire Chart.js library

List of implemented changes:
 - Reverse option for legends (resolves #3102)
 - Information about chart resizing (resolves #3023)
 - Mixed chart types (resolves #2825) (resolves #2431)
 - Chart library comparison table (resolves #2605)
 - getDetasetMeta function information (resolves #2521)
 - Popular Extensions (resolves #2365)
2016-08-08 03:08:13 +00:00
Michael Oberwasserlechner
27010c4619 Remove non existing property from radar samples #3026 2016-07-24 10:49:03 +02:00
Evert Timberg
b6686f00f4 Non numeric y (#2849)
* Category scale can now read from the xLabels and yLabels properties.

* Update docs with section regarding the data object.

* Add sample file with non numeric Y and fix animations
2016-07-09 09:22:25 -06:00
Evert Timberg
a1f94b1a57 update sample to have negative numbers 2016-07-09 10:01:15 -04:00
amlethojalen
988423b05e Fixed up formatting suggestions/issues as per comments from zachpanz88 2016-07-07 08:35:21 +10:00
amlethojalen
68728fc9a7 Added ability to render a line chart as a stepped line chart.
Added option.elements.line.stepped
Added dataset.steppedLine
Added Sample, and updated documentation.
2016-07-06 11:13:12 +10:00
Evert Timberg
9082507c1c Merge pull request #2555 from simonbrunel/travis-dist
Travis GitHub Releases
2016-06-28 08:39:57 -04:00
ronaldgrn
886803aa84 Fix line example not showing Scale Titles
scaleLabel should have display: true instead of show: true
2016-06-26 14:07:51 -03:00
Simon Brunel
53a0c5442e New Chart.js.zip package
Samples need to be packaged with built libraries (which one have been removed from the repository), so create a new `gulp package` task to generate a ZIP archive with dist files, samples and the license file. This archive is generated in the ./dist/ folder and will be deployed by Travis along the GH release. Note that the ./dist/ folder is not preserved but merged in the archive root. Also change samples requiring moment.js to load this lib from the CDN instead of the ./node_module folder.
2016-06-18 12:14:31 +02:00
Evert Timberg
b1c50ed0c2 Merge pull request #2732 from chartjs/scale-colors-per-line
Scale colors per line
2016-06-09 18:35:48 -04:00
Evert Timberg
6b2cfd5e11 Support arrays of colors and line widths in cartesian axes 2016-06-07 20:22:06 -04:00
Evert Timberg
a687749ed4 Radial linear scale array properties for line width and color 2016-06-07 20:09:33 -04:00
Evert Timberg
80bd7d3f60 Initial vertical legend mode 2016-06-06 21:41:40 -04:00
Tarqwyn
2bc8e3c7f6 This PR allows for multi-line labels, as per Slack discussion..
Usage: If a label is an `array` as opposed to a `string` i.e. `[["June","2015"], "July"]` then each element is treated as a seperate line. The appropriate calculations are made to determine the correct height and width, and rotation is still supported.

view samples/line-multiline-labels.html to see it working.

On branch multiline_labels
Changes to be committed:
	modified:   docs/03-Line-Chart.md
	new file:   samples/line-multiline-labels.html
	modified:   src/core/core.helpers.js
	modified:   src/core/core.scale.js
2016-06-03 17:12:19 +01:00
Evert Timberg
11345b6c89 Polar area controller improvements 2016-05-30 21:42:15 -04:00
Evert Timberg
8d20379e29 Initial tooltip tests + fix a bug when the tooltip beforeLabel and afterLabel callbacks returned strings 2016-05-28 15:26:46 -04:00
Evert Timberg
1b277a71e4 Fix pie custom tooltip sample 2016-05-28 10:48:33 -04:00
Blake Niemyjski
3db9962c9b Fixed a syntax error in the sample 2016-05-16 18:14:14 -05:00
Blake Niemyjski
73fa358eb4 removed extra momentjs script tag 2016-05-13 21:04:40 -05:00
Tanner Linsley
2ee37e12e3 2.1.0 build 2016-05-03 16:53:09 -05:00