Commit Graph

37 Commits

Author SHA1 Message Date
Evert Timberg
bc11f10216
Rename elements to mark as elements, i.e. Arc -> ArcElement (#7924)
* Rename elements to mark as elements, i.e. Arc -> ArcElement
* Rename RectangleElement to BarElement
* Also updates options.elements.rectangle to options.elements.bar
2020-10-20 08:18:56 -04:00
Evert Timberg
3f89c25895
Ability to toggle individual bar visibility (#7870) 2020-10-12 10:22:55 -04:00
Jukka Kurkela
59a1af91ac
Replace horizontalBar with indexAxis: 'y' (#7514)
* Replace horizontalBar with indexAxis: 'y'
* Fix drawing of line for last x-position
* Consistently determine axis of scale
* Add test
2020-06-18 17:35:52 -04:00
Jukka Kurkela
026482a0cf
Correctly determine min/max for Float Bar (#7398) 2020-06-09 17:15:05 -04:00
Ben McCann
2f17dbcd70
Prefix private controller methods with underscore (#7081)
Prefix private controller methods with underscore
2020-02-10 17:57:22 -05:00
Jukka Kurkela
fa79eb8797
Switch from chartjs-color to @kurkle/color (#7059) 2020-02-07 19:24:29 -05:00
Ben McCann
9bd2af9e9b Move location of dataset options (#6955)
* Move location of dataset options
* Fix misplaced period
2020-01-13 19:39:30 -05:00
Jukka Kurkela
16bb94ebc1 Bar chores (#6889)
* Limit invisible bar section size

* Improve readability

* Fix for issue 6368

* Raview update

* Review update, add test

* Typos

* Try to make sense :)
2020-01-08 17:27:17 -05:00
Evert Timberg
b464999851
Bar chart defaults to begin at zero (#6917)
* Bar chart defaults to begin at zero

* Add bar beginAtZero test
2020-01-05 15:50:24 -05:00
Jukka Kurkela
f4792306e0 Remove global from defaults (#6893) 2020-01-03 14:07:38 -05:00
Jukka Kurkela
b83f64b16e Rewrite animation logic (#6845)
* Rewrite animation logic

* Review update 1

* Review update 2

* Review update 3

* Add 'none' to api.md
2019-12-27 17:13:24 -05:00
Jukka Kurkela
d60f634ff0 Fix automatic min value of stacked scale. (#6851) 2019-12-19 14:58:23 -05:00
Ben McCann
6f6005d7b8 Shrink _parsed to match if dataset shrinks (#6826) 2019-12-10 18:57:21 -05:00
Jukka Kurkela
ce74eb76a1 Convert axis options from arrays to objects (#6773)
* Convert axis options from arrays to objects

* Updated all chart type defaults
* Throw errors when axis type or position are not specified
* Avoid raising unnecessary errors when merging options into the default configs

* Fix additional tests

* Ensure scale defaults are set if type is not explicitly defined

* Another step

* Include `scale` as `firstIDs.r`

* update docs

* Update for buildOrUpdateScales

* Update migration guide

* Add test back
2019-11-21 18:46:49 -05:00
Jukka Kurkela
7f97adf5a0 Move scale defining options up from ticks (#6738)
* Move scale defining options up from `ticks`
* Include `ticks.reverse` in v3-migration
2019-11-15 12:11:13 -05:00
Jukka Kurkela
76a89f0922 determineDataLimits optimizations (#6695) 2019-11-12 19:24:07 -05:00
Ben McCann
09ef08acfe Remove Element _index and _datasetIndex for real this time (#6726)
* Remove Element _index and _datasetIndex for real this time

* Remove unused _datasetIndex
2019-11-12 19:18:29 -05:00
Ben McCann
a3392e0e59 Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements.
2019-11-10 07:52:12 -05:00
Ben McCann
e42413f3e8 Remove unused model properties (#6691)
* Remove unused model properties
* Add to migration guide
2019-11-05 18:10:44 -05:00
Ben McCann
26dc04d25f Remove deprecated code from time scale and bar chart (#6622)
* Remove deprecated code from bar chart
* Remove deprecated code from time scale
2019-10-27 18:46:28 -04:00
Ben McCann
08d133817b Remove xLabel and yLabel from tooltip and chart and scales from element (#6606)
* Element should not have reference to chart
* Remove scales from element
* Remove deprecated xLabel and yLabel
2019-10-27 16:35:15 -04:00
Ben McCann
0da237a315 Remove undocumented "custom" feature (#6605)
Remove undocumented "custom" feature
2019-10-27 16:33:21 -04:00
Jukka Kurkela
29de4aff21 Don't use deprecated options in tests (#6609) 2019-10-27 09:15:53 -04:00
Ben McCann
21da5be3c6 Fix horizontalBar deprecation warnings (#6603)
Fix horizontalBar deprecation warnings
2019-10-26 12:48:48 -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
918e2c027f Cast getRightValue to number in the bar controller (#5947) 2019-01-02 15:55:27 +01:00
Simon Brunel
be8d78a900
Make Chart.controllers.* importable (#5871)
`controllers.*.js` and `core.datasetController.js` are now importable (no more function export), that's why there is so many changes mainly due to one indentation level removed. Split code for `bar/horizontalBar` and `doughnut/pie` in separate files, added a global controllers import (`src/controllers/index.js`) and add tests to check that all dataset controllers are correctly registered under `chart.controllers.{type}`.
2018-11-29 21:06:34 +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
Ben McCann
da3aa68f38 Restore original styles when removing hover (#5570)
Refactor `updateElement` and `removeHoverStyle` and fix tests.
2018-06-26 08:56:53 +02: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
2f950e2ab3 Improve controller tests stability (#4698) 2017-08-27 22:43:16 +02:00
andig
530c613e5c Improve bar test stability (#4694) 2017-08-24 18:16:08 -04:00
andig
46c3b2406e Make bar tests independent from scales (#4686) 2017-08-23 17:07:14 -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
Simon Brunel
50a80da1e9 Fix and refactor bar controllers
Merge most of the horizontalBar controller into the bar one but also fix stack groups and bar positioning when scales are stacked or when a min and/or max tick values are explicitly defined. Note that this is a breaking change for derived controllers that rely on the following removed methods: `calculateBarBase`, `calculateBarX`, `calculateBarY`, `calculateBarWidth` and `calculateBarHeight`.
2017-04-08 13:40:21 -04:00
Evert Timberg
36ccf40946 Fix for stacked bar charts with log axes (#4010)
* Undo fix for #3585 since it has broken the stacked bar charts when the axis has a user defined minimum value.

* When a value of 0 is requested for a vertical logarithmic axis, return the bottom point
2017-03-20 20:38:15 -04:00
Simon Brunel
c216c0af76 Cleanup and upgrade unit tests environment
`karma.conf.ci.js` has been merged into `karma.conf.js` for local testing consistency: `gulp unittestWatch` has been replaced by `gulp unittest --watch` and thus use exactly the same config file. Upgrade to latest jasmine and karma packages and remove deprecated `gulp-karma` dependency (directly use `karma.Server` in gulp).

Split `test/mockContext.js` into smaller `test/jasmine.*` modules to make easier unit tests maintenance and finally, move all `*.test.js` files under the `test/specs` folder.
2017-03-04 11:39:48 -05:00