Commit Graph

6 Commits

Author SHA1 Message Date
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