Commit Graph

2444 Commits

Author SHA1 Message Date
Ben McCann
d07fb28462 Add a note about breaking changes (#4555) 2017-07-24 14:49:26 +02:00
Simon Brunel
48d6face28 Move and rewrite time helpers (#4549)
Move time helpers back into time scale, remove the `Chart.helpers.time namespace` and attempt to make the auto generation logic a bit simpler. The generate method doesn't anymore enforce min/max, the calling code needs to clamp timestamps if needed.
2017-07-23 11:41:12 -04:00
andig
e7445a5f00 Honour time scale min/max settings (#4522) 2017-07-22 14:35:06 +02:00
Simon Brunel
4c763bff44 Enforce spaces around infix/unary words operators (#4547)
Enable ESLint `space-infix-ops` and `space-unary-ops` (for words only) rules. Also added `samples` to the linting task to match Code Climate expectations.

http://eslint.org/docs/rules/space-infix-ops
http://eslint.org/docs/rules/space-unary-ops
2017-07-22 14:13:09 +02:00
Ben McCann
f6b6956a3a Fix ESLint errors (#4485) 2017-07-22 09:19:06 +02:00
Ben McCann
48d76b20fe Allow specifying the time axis via t attribute (#4533)
For time series charts it may make more sense to specify the horizontal axis using the variable `t`. This change will make it much easier to use the time scale with the financial chart, which takes in the data points `{t, o, h, l, c}`.
2017-07-22 08:33:22 +02:00
Simon Brunel
7b6388883a Refactor padding parsing under helpers.options (#4544)
New Chart.helpers.options.toPadding helpers that converts a number or object into a padding {top, right, bottom, left, height, width} object.
2017-07-21 15:03:03 +02:00
Simon Brunel
586b8c12fc Make Chart.Element/elements.* importable (#4540) 2017-07-21 08:40:01 +02:00
Ben McCann
94099c10f7 Remove duplicate npm install (#4542) 2017-07-21 08:21:29 +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
5ad1b4ade7 New time scale ticks.mode/.source options (#4507)
`ticks.source` (`'auto'`(default)|`'labels'`): `auto` generates "optimal" ticks based on min, max and a few more options (current `time` implementation`). `labels` generates ticks from the user given `data.labels` values (two additional trailing and leading ticks can be added if min and max are provided).

`ticks.mode` (`'linear'`(default)|`series`): `series` displays ticks at the same distance from each other, whatever the time value they represent, while `linear` displays them linearly in time: the distance between each tick represent the amount of time between their time values.
2017-07-19 21:04:15 +02:00
andig
3bb31ca592 Allow category labels definition at scale level (#4506) 2017-07-19 12:41:17 +02:00
Marceau Dewilde
a0fc1c9019 Add link to Java integration (#4527) 2017-07-18 18:26:02 -04:00
Simon Brunel
889ecd560b Make Chart.defaults/Ticks/Interaction importable (#4512)
Default options can now be accessed by importing `core/core.defaults`. The returned object acts as a singleton and is populated when importing classes that expose their own default values (meaning that importing only `code.defaults` results in an empty object). Also make `Chart.Ticks` and `Chart.Interaction` importable since existing defaults rely on these values.

Add the `defaults._set` method that make easier declaring new defaults by merging given values with existing ones for a specific scope (`global`, `scale`, `bar`, etc).
2017-07-16 19:38:19 +02:00
Simon Brunel
1833614e1d Make Chart.platform importable (#4509) 2017-07-16 11:02:25 +02:00
Evert Timberg
8e643db09d Fix copy paste error in new docs with respect to settings for line and radar charts. (#4510) 2017-07-15 16:39:27 -04:00
Simon Brunel
717e8d950a Make Chart.helpers importable (#4479)
Properly export helpers and remove dependencies to `Chart.helpers`. Helpers can now be accessed from `src/helpers/index.js` (`var helpers = require('path/to/helpers/index')`, instead of `var helpers = Chart.helpers`).
2017-07-15 15:13:56 +02:00
Suhaib Khan
b03ab1ca45 Fix labelOffset not working for vertical axes (#4249) 2017-07-15 10:19:16 +02:00
Adrian Liaw
f16d8a32e2 Fix links in documentations (#4477)
* Fix relative links in documentation of configurations
* Fix relative link of 'Time Units'
* Fix relative links for chart types documentations
* Fix the release version link in developers/plugins
2017-07-09 08:58:18 -04:00
Simon Brunel
463a8dd778 Simplify formulas based on code review 2017-07-08 12:02:33 -04:00
Simon Brunel
56050dc9b7 Move easing effects in separate file + unit tests 2017-07-08 12:02:33 -04:00
Alexander Paterson
e8ebb46aad Update link to documentation for previous versions 2017-07-05 17:31:33 -04:00
Akihiko Kusanagi
6e54bc594a Clip chart area before filling
- Add clip and unclip around doFill() call
- This fixes #4450
2017-07-04 07:27:14 -04:00
etimberg
9ec78cee1c Add a note on how to use getElementAtEvent in a click handler 2017-07-04 07:26:18 -04:00
etimberg
7d60857819 Use proper reverse option in radial linear scale 2017-07-04 07:25:58 -04:00
Evert Timberg
cc9e88aebc Support an array for line chart pointBorderWidth 2017-07-04 07:24:37 -04: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
6f317135a3 Clamp radius when drawing rounded rectangle (#4448) 2017-07-01 14:08:20 +02:00
Let Aurn IV
e5a431e724 Remove .js extensions when requiring a file (#4427) 2017-07-01 09:59:26 +02:00
Simon Brunel
ecca3373b2 Increase ESLint complexity and add config for tests (#4421)
Raise the cyclomatic complexity to 10 which seems to better match the project coding style and still reasonable (6 being quite low). Also move unit tests specific eslint rules in the cascaded `./test/.eslintrc` file (previously in `gulp.js`).
2017-07-01 09:55:11 +02:00
Justin Ledford
0eedec31f0 replace self closing script tag with open and closing tags 2017-06-29 17:05:01 -04:00
etimberg
7f15bebed2 ticks.padding option applies to both vertical and horizontal axes 2017-06-25 13:32:42 -04:00
etimberg
ccb2898539 When all datasets are hidden, the linear scale defaults to a range of 0 - 1.
If `ticks.min` was set this would not set the range correctly.
Added a test to cover this case as well
2017-06-25 13:32:08 -04:00
Simon Brunel
548edc65ea Fix non-passive event listener warning in Chrome
Deprecate `addEvent` and `removeEvent`, and move implementation in `platform.dom.js`. Add 'options' feature detection to register event listeners as passive and prevent warning in Chrome.
2017-06-25 10:15:55 -04:00
etimberg
7fa6052359 Update scatter chart default config to hide lines 2017-06-25 08:47:59 -04:00
Evert Timberg
8834babef2 Ensure deprecated unitStepSize property of time scale is respected (#4401) 2017-06-25 14:37:38 +02:00
Simon Brunel
5d95280d7b Change valueAtIndexOrDefault behavior (#4423)
For consistency with `valueOrDefault`, `valueAtIndexOrDefault` now returns null if `value` (expected array) is null. Also get rid of the superfluous `get` prefix in `getValueOrDefault` and `getValueAtIndexOrDefault`.
2017-06-25 10:54:37 +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
Evert Timberg
6c82c93853 Fix error when legend label options are not defined (#4402) 2017-06-24 17:35:46 +02:00
Akihiko Kusanagi
e543f87d5f Update Display Format table
- Up to date with the latest code
- Added Example column
2017-06-24 06:41:42 -04:00
Karan Bhatia
2a7df85180 Add aria-hidden=true attribute to hidden iframe for resizing (#4400)
Add aria-hidden=true attribute to hidden iframe for resizing. This prevents screen readers in ItemMode from navigating to the hidden iframe.
2017-06-23 18:14:16 -04:00
etimberg
18707cf81f Line height setting for scale titles. The text is centered within the line height, so setting the line height to a size
greater than the font size moves it away from the axis edge.
2017-06-23 18:09:30 -04:00
Akihiko Kusanagi
961911065f Fix arguments in plugin interface description
* Fixed arguments in IPlugin#before/afterDatasetUpdate description
* Fixed arguments in IPlugin#before/afterDatasetDraw description
2017-06-23 18:08:44 -04:00
Peter-Van-Drunen
bef44ccb46 Ensure that chart dimensions are always >= 0
Elements were resizing incorrectly if they were regenerated while the chart was in a div that was display:none. Added a check to avoid this issue. Resolves #4397
2017-06-23 18:08:16 -04:00
Akihiko Kusanagi
b548d1a689 Add description on new dataset update and draw plugin hooks 2017-06-23 18:03:20 -04:00
Ben S
46c04550a9 Wording error
correct wording error
2017-06-22 17:52:05 -04:00
etimberg
de0ea5c6ba Multiple lines of text in the chart title 2017-06-19 07:07:35 -04:00
etimberg
7a02d93db4 Add note regarding non-existant fonts 2017-06-18 21:07:23 -04:00
Martin Bagge / brother
28da15455f HighCharts is not open source (#4383)
According to the (issue tracker of highcharts)[https://github.com/highcharts/highcharts/issues/4405#issuecomment-125124004] they do not consider the code open source. It's available for reading but that's about it.

The code is provided under CC-BY-NC via github.

See also:
https://shop.highsoft.com/faq#Non-Commercial-0
2017-06-16 06:48:29 -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