Commit Graph

25 Commits

Author SHA1 Message Date
Ben McCann
1ae11c4d40 Format numbers in tooltip (#7004)
* Format numbers in tooltip
* Add check for typeof number
* Implement only for linear and log scales
2020-01-27 17:58:58 -05:00
Evert Timberg
b097fe43c9
Linear scale with min/max/stepSize set should use all 3 if the range fits (#6966)
When (max - min) / stepSize is an integer, we can do a very simple
tick generation method.
2020-01-18 08:35:30 -05:00
Jose Raul Pérez
b1421c6ea1 Add stroke lines option around ticks to improve readability (#6787)
Enable stroking of text on of axis labels
2020-01-12 14:22:51 -05:00
Ben McCann
d4109ca14e Polar area: startAngle in degrees, 0 at top. (#6936)
* Polar area: startAngle in degrees, 0 at top.
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2020-01-10 18:30:29 -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
Evert Timberg
94afa63450
Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality

* Remove docs

* Code review updates
2019-11-07 06:27:49 -05:00
Jukka Kurkela
72df272234 Early data parsing, stacking by value and support object data (#6576)
* Early data parsing + stacking by value
* Review comments
* review comments
* Remove reduntant parsing
* Couple CC warnings
* Optimize filterBetween
* More migration info
2019-11-04 18:07:01 -05:00
Ben McCann
99811328dc Make all ticks objects (#6645)
Make all ticks object
2019-10-31 18:45:13 -04:00
Akihiko Kusanagi
626d8cc714 Draw the rightmost grid line when offsetGridLines is true (#6326)
* Draw the rightmost grid line when offsetGridLines is true

* Refactor based on feedback

* Replace helpers.each with for loop

* Minor refactoring

* Refactor _computeItemsToDraw
2019-07-18 18:25:33 -04:00
Akihiko Kusanagi
e35b8891ce Treat 0 as a valid point label for radial scale (#6279) 2019-05-16 20:17:46 +02:00
Akihiko Kusanagi
c457b506b8 Normalize angle for index in radialLinear scale (#6177) 2019-04-02 10:25:37 +02:00
Akihiko Kusanagi
aae05a08da Improve tick generation for linear scales (#5938)
* Improve tick generation for linear scales
* Simplify the tick generation code
* Refactor getTickLimit
2019-01-01 08:38:09 -05:00
Akihiko Kusanagi
d29ec5a485 Add scale.pointLabels.lineHeight and scale.ticks.lineHeight options (#5914) 2018-12-20 09:56:06 +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
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
0351a88a63 Add support for gridLines/angleLines borderDash for polarArea/radar charts (#5850) 2018-11-26 08:57:31 +01:00
andig
ea703a54bf Implement scale label padding (#4646) 2017-09-10 13:15:47 -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
090196c07c Add support for line height CSS values (#4531)
The title plugin and scale title now accept lineHeight specified using unitless value (1.4), length ('1.4em' or '12px'), percentage ('200%') or keyword ('normal' === 1.2). The line height parsing has been refactored under the 'Chart.helpers.options' namespace. Also fix incorrect text positioning in the title plugin.

https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
2017-07-20 19:20:54 +02:00
etimberg
7d60857819 Use proper reverse option in radial linear scale 2017-07-04 07:25:58 -04: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
Lee N Dobryden
20a832809e Zero line dash options (#4019)
* Add of zero line border dash options
* Update Readme with zero line border dash config options
2017-03-21 06:38:09 -04:00
Hiroshi Shirosaki
cffa9447a1 Fix radar chart horizontal position (#4032)
Radar chart position is not center horizontally with v2.5.0.

Right and left of `furthestLimits` would be switched wrongly on
this refactoring commit.
e1606f88ed
2017-03-20 20:39:18 -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