Commit Graph

10 Commits

Author SHA1 Message Date
anders
6b824d9334 add check on overwriting canvas height/width (#4874)
* add check on overwriting canvas height/width

* unit test for this
2017-11-21 19:04:26 -05:00
Simon Brunel
26c1936dee Move extend and inherits helpers in helpers.core.js (#4878)
Fix Rollup issue caused by early access of the `extend` and `inherits` helpers not yet part of the `helpers/index` import. Also added (basic) unit tests for whose methods.
2017-10-24 19:11:40 +02: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
Simon Brunel
225bfd36f3 Rewrite the clone and merge helpers (#4422)
The `clone` method now accepts any type of input but also recursively perform a deep copy of the array items. Rewrite the `configMerge` and `scaleMerge` helpers which now rely on a new generic and customizable `merge` method, that one accepts a target object in which multiple sources are deep copied. Note that the target (first argument) is not cloned and will be modified after calling `merge(target, sources)`. Add a `mergeIf` helper which merge the source properties only if they do not exist in the target object.
2017-07-01 14:51:38 +02:00
Simon Brunel
5196e05062 Cleanup and reorganize core and canvas helpers
Move some of the "core" and "canvas" utils in `helpers.core.js` and `helpers.canvas.js` and introduce the new `isNullOrUndef` and `isObject` helpers. Deprecate `indexOf` and rename `drawRoundedRectangle` to `roundedRect` which now creates a simple `rect` path if radius is 0. Write missing unit tests for the moved helpers.
2017-06-24 13:28:52 -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
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