Commit Graph

46 Commits

Author SHA1 Message Date
Jukka Kurkela
0de668b46f Fix line / non-numeric-y (#6617) 2019-10-27 15:05:23 -04:00
Jukka Kurkela
29de4aff21 Don't use deprecated options in tests (#6609) 2019-10-27 09:15:53 -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
Jukka Kurkela
6b6f1a4c51 Implement dataset.order (#6268)
Allow sorting datasets based on the `order` property
2019-10-22 19:14:54 -04:00
Akihiko Kusanagi
e3e80c9ac6 Support spanGaps in radar charts (#6289)
* Support spanGaps in radar charts

* Minor fixes based on feedback
2019-06-19 07:12:53 -04:00
Akihiko Kusanagi
70b32ff20e Support rotation for pointStyle image (#6287) 2019-05-24 09:35:47 +02: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
Akihiko Kusanagi
03a3199306 Treat null as NaN in radialLinear scale (#6282) 2019-05-21 11:50:38 +02:00
Akihiko Kusanagi
cfcdcccc32 Support boundary filling modes in radialLinear scale (#6281) 2019-05-21 11:15:33 +02:00
gwyneblaidd
7d8526f691 Add support for floating bar chart ([start, end]) (#6056) 2019-05-21 10:54:13 +02:00
Akihiko Kusanagi
4f04ee5d77 Keep lines on the left and right edges from being cut (#6285) 2019-05-20 17:23:54 +02:00
Akihiko Kusanagi
9482ee55eb Fix point label counting in radialLinear scale (#6280) 2019-05-16 20:34:43 +02:00
Jukka Kurkela
2a96d83c2c Implement layers (z-index) for layout items (#6241) 2019-05-09 15:54:05 +02:00
Jukka Kurkela
58e154c7da Avoid time related deprecation warnings in tests (#6246) 2019-05-06 22:46:22 +02:00
Akihiko Kusanagi
4f722ab619 Fix arc size calculation when circumference is under 2PI (#6224) 2019-05-01 18:05:34 +02:00
Jukka Kurkela
1a2a87be3b Fix arc border with circumference over 2*PI (#6215) 2019-04-30 11:34:10 +02:00
Jukka Kurkela
4e349a0149 Fill before drawing lines (#6208) 2019-04-18 22:52:25 +02:00
Dave Kichler
07fae6159e Implement legend.align: 'start', 'center', 'end' (#6141)
New `options.legend.align`config option for controlling alignment of legend blocks in horizontal/vertical legends.
2019-03-23 10:25:17 +01:00
Janelle deMent
b9290a20de Make line options scriptable (#6128) 2019-03-21 09:06:39 +01:00
Vincent-Ip
93f4e6e4e8 New weight option for pie and doughnut charts (#5951)
Add functionality to give pie & doughnut datasets a weight attribute, which affects the relative thickness of the dataset when there are multiple datasets in pie & doughnut charts. The default weight of each dataset is 1, providing any other numerical value will allow the pie or doughnut dataset to be drawn with a thickness relative to its default size. 

For example a weight of 2 will allow the dataset to be drawn double its typical dataset thickness. Note that the weight attribute will only affect a pie or doughnut chart if there is more than one visible dataset. Using weight on a pie or doughnut dataset when there is only one dataset on the chart will have no affect.
2019-02-27 23:06:54 +01:00
Jukka Kurkela
0ec3f5569e Add support for per side border width for rectangle (#6077) 2019-02-25 09:03:12 +01:00
Akihiko Kusanagi
8b07cc2f28 Implement scriptable options for points in radar charts (#6041) 2019-02-09 23:07:54 +01:00
Jukka Kurkela
7c0ad5a05b Stop drawing radialLinear scale twice (#6007) 2019-01-23 15:45:01 +01:00
Evert Timberg
a655da076e Implement scriptable options for points in line charts (#5973) 2019-01-15 09:24:12 +01:00
Evert Timberg
f3dd96779a Implement scriptable options for polar area charts (#5976) 2019-01-13 21:17:27 +01:00
Evert Timberg
e1ed26f315 Implement scriptable options for doughnut charts (#5966) 2019-01-10 16:00:36 +01:00
Akihiko Kusanagi
39b4d61ac2 Fix time scale ticks.reverse issue (#5933) 2019-01-02 16:00:55 +01:00
Akihiko Kusanagi
d29ec5a485 Add scale.pointLabels.lineHeight and scale.ticks.lineHeight options (#5914) 2018-12-20 09:56:06 +01:00
Akihiko Kusanagi
db8f6c38dc Add support for 'inner' border for arc elements (#5841) 2018-12-18 13:58:02 +01:00
Akihiko Kusanagi
40495ec9d0 Fix the rounding issue of floating point numbers in category scale (#5880)
- Remove `Math.round` in the category scale code
- Add `helpers._alignPixel` to align grid/tick/axis border lines
- Fix grid/tick/axis border line calculation
- Add a check of the width of the axis border
- Refactor core.scale code
2018-12-09 11:34:34 +01:00
Akihiko Kusanagi
ecfa7b24c6 Add support for CanvasPattern and CanvasGradient in tooltip (#5869) 2018-11-29 13:52:56 +01:00
Akihiko Kusanagi
d6ac7d8a80 Fix cut off tick labels in radial scale (#5848)
Fix the issue that the topmost tick label and the bottom of the chart area are cut off with a radial scale.
2018-11-28 08:35:15 +01:00
Akihiko Kusanagi
1f2fa5c90c Adjust the size of rectRounded/rectRot point to fit pointRadius (#5858)
- Calculate the vertices of the shapes so that they are inscribed in the circle that has the radius of `pointRadius`
- Remove `translate()` and `rotate()` to fix the regression introduced by #5319
- Refactor `rectRounded` for better performance
2018-11-28 07:53:41 +01:00
Akihiko Kusanagi
0351a88a63 Add support for gridLines/angleLines borderDash for polarArea/radar charts (#5850) 2018-11-26 08:57:31 +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
Simon Brunel
2dbf1cd1af
Add support for *.js test fixture config (#5777)
JSON doesn't support functions which are needed to create scriptable options, so implement a very basic method to load a JavaScript file exporting the config in `module.exports`. Also rename test sources (remove the `jasmine.` prefix), cleanup `karma.conf.js` and add an example .js fixture config (bubble radius option).
2018-10-20 11:38:48 +02:00
Simon Brunel
91608398b6 Add "point style" image tests
Replace the old style canvas "mock" context checks by image based unit tests which are easier to maintain and allow more flexibility in the drawing logic since we are not testing the context calls but the final painted result.
2018-07-29 22:43:23 +02:00
Shayne Linhart
a0a195f353 Added 'angle' option to Polar Charts (#5279)
* added 'angle' option to polar charts. image comparison test is work in progress; not currently passing

* removed unnecessary variable assignment

* code cleanup based on PR; for 'angle' option on polarCharts

* Made polar chart image comparison test pass by removing debug flag. Also explicitly marked _computeAngle as private.

* Removed visibleCount computation in polar chart

* split out code related to updating the radius in polar chart's update function, into it's own 'updateRadius' function

* made updateRadius method private

* fix linting error

* updated polar charts to read custom angles from "chart.options.elements.arc.angle" instead of "chart.options.angle"
2018-06-17 11:56:57 -04:00
Evert Timberg
85169c5603
Proper tick position for right positioned axis (#5401)
* Proper tick position for right positioned axis
* Test for tick mark drawing
2018-04-11 18:16:32 -04:00
Simon Brunel
15d1056b53
Implement equally sized bars (#4994)
When `barThickness: undefined|null` (default), we compute an optimal sample size based on the smallest tick interval reduced to prevent any bar to overlap (bar equally sized). Also added support for a special `barThickness: 'flex'` value (previous default) that globally arranges bars side by side to prevent any gap when percentage options are 1 (variable bar sizes).
2017-12-02 12:38:36 +01:00
andig
ea703a54bf Implement scale label padding (#4646) 2017-09-10 13:15:47 -04: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
Suhaib Khan
b03ab1ca45 Fix labelOffset not working for vertical axes (#4249) 2017-07-15 10:19:16 +02:00
Simon Brunel
5e58114848 Fix filling between datasets of different lengths 2017-06-10 09:44:15 -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
1ca0ffb5d5 Introduce unit test based on image comparison (#3988)
Attempt to make easier the creation of unit tests that check the drawing output. Until now, this was done by checking calls on a 'fake' context, which is hard to maintain (need to update pixel values by hands) and also not reliable when optimizing code (i.e. different calls sequence but same result).

As of now, it's possible to define 'auto' tests based on JSON/PNG fixtures: chart is generated from the JSON file and compared to the associated PNG image. The image diff is done using `pixelmatch`. As an example (and in preparation of the `filler` plugin), add auto tests for the line element `fill` options.
2017-03-05 09:49:12 -07:00