jcopperfield [Tue, 20 Feb 2018 23:44:01 +0000 (00:44 +0100)]
Bugfix: Improve polyfill function of log10 to return whole powers of 10 (#5275)
* Bugfix: Improve polyfill function of log10 to return whole powers of 10
as integer values, as it caused endless loop in IE11 in the tick
creation loop.
* Compare floating-point numbers directly instead of using unnecessary division.
Simon Brunel [Thu, 1 Feb 2018 02:35:08 +0000 (03:35 +0100)]
Fix Slack invitation link (#5217)
Setup a new Heroku app based on rauchg/slackin, using Slack legacy token from the Chart.js (chartjs.slack@...) user and reCAPTCHA from the same Google account.
Simon Brunel [Sat, 13 Jan 2018 13:23:50 +0000 (14:23 +0100)]
Fix updating plugin options (#5144)
Cached plugin descriptors hold a reference on the plugin options, which break if the plugin options object is replaced. That case happens when the user updates the plugin options with a new object, but also since the new config update logic (#4198) that now always clones the plugin options. The fix consists in explicitly invalidating that cache before updating the chart.
Simon Brunel [Thu, 11 Jan 2018 08:03:16 +0000 (09:03 +0100)]
Fix GitBook error with the shared ESLint config (#5133)
`gitbook-cli install` failed when trying to fetch eslint-config-chartjs because of the way it was installed (ie. using the GitHub repository URL). The shared config is now published on npmjs: https://www.npmjs.com/package/eslint-config-chartjs
Simon Brunel [Tue, 9 Jan 2018 13:12:40 +0000 (14:12 +0100)]
Rename Chart.layout to Chart.layouts (#5118)
Chart.layouts seems more consistent with other service names (Chart.plugins, Chart.scales, etc.) but also more inline with the service which handle many layout (one per charts).
Simon Brunel [Sat, 6 Jan 2018 22:59:13 +0000 (23:59 +0100)]
Use the Chart.js shared ESLint config (#5112)
An ESLint shareable config has been created (from this repository) in the attempt to homogenize Chart.js hosted projects and plugins style. Rename `.eslintrc` files to `.eslintrc.yml` since the name has been deprecated.
Fix the CC badge (maintainability) and disable CodeClimate ESLint plugin because it doesn't support custom shareable config but also because it already executes relevant checks as part of the regular process.
jcopperfield [Tue, 12 Dec 2017 23:43:51 +0000 (00:43 +0100)]
Fix issues #4572 and #4703 (#4959)
- issue #4572: logarithmic type if all numbers are zero browser crashes "Out of memory"
- issue #4703: [BUG] Browser unresponsive on bubble chart with logarithmic axes
Simon Brunel [Sat, 2 Dec 2017 11:38:36 +0000 (12:38 +0100)]
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).
Xingan Wang [Wed, 29 Nov 2017 21:52:23 +0000 (13:52 -0800)]
Fix scale options update (#4198)
- allow options to be updated in-place or as a new object
- re-merge new options and rebuild scales & tooltips
- preserve reference to old scale if id/type not changed
- related tests and new sample also added.
- update document about options update
- update doc and example
Kaido Hallik [Sat, 11 Nov 2017 23:02:05 +0000 (01:02 +0200)]
Avoid tooltip truncation in x axis if there is enough space (#3998)
* In tooltip x align calculation take into account caretSize
Truncation up to caretSize pixels could happen if label text produced tooltip element with size width:
* left side tooltip: width < x and width > x - caretSize
* right side tooltip: width < chartWidth - x and width > chartWidth - x - caretSize
Default caretSize = 5, so with default configuration truncation up to 5 pixels could happen.
* avoid tooltip truncation if possible
use whole chart area for displaying tooltip
* in xAlign calculation take into account caretPadding
Simon Brunel [Tue, 24 Oct 2017 17:11:40 +0000 (19:11 +0200)]
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.
Ben McCann [Sun, 22 Oct 2017 15:32:39 +0000 (08:32 -0700)]
Attempt to fix test flakiness (Firefox) (#4880)
These settings deal with browser disconnects. We had seen test flakiness from Firefox:
[Firefox 56.0.0 (Linux 0.0.0)]: Disconnected (1 times), because no message in 10000 ms
Ben McCann [Fri, 20 Oct 2017 07:03:38 +0000 (00:03 -0700)]
Respect min and max when building ticks (#4860)
Generate time scale ticks (`ticks.source: 'auto'`) based on the effective visualized range instead of the actual data range, meaning that the computed units and/or step size may change if the time options min and max are different from the data min and max.
Simon Brunel [Sat, 7 Oct 2017 15:43:09 +0000 (17:43 +0200)]
Fix responsive issue when the chart is recreated (#4774)
Chrome specific issue that happens when destroying a chart and re-creating it immediately (same animation frame?). The CSS animation used to detect when the canvas become visible is not re-evaluated, breaking responsiveness. Accessing the `offsetParent` property will force a reflow and re-evaluate the CSS animation.
Simon Brunel [Sun, 10 Sep 2017 12:31:59 +0000 (14:31 +0200)]
Add Google Analytics to samples and update badges (#4734)
Inject the GA tracking snippet for all samples, including the index page. Also update README.md badges using the shields.io service for consistency with flat-square style and cache, and add release badges to the installation documentation page.
If `window` or `document` are `undefined`, a minimal platform implementation is used instead, which one only returns a context2d read from the given canvas/context.
Simon Brunel [Sat, 26 Aug 2017 05:48:57 +0000 (07:48 +0200)]
Fix wild special zero grid line when undefined (#4700)
Remove the special drawing for an undefined zero grid line since it causes issue when the first tick is not aligned on the scale extremity (ie only linear scales now display a special grid line for the origin). Hide scales in the filler plugin unit test fixtures to avoid future failures due to changes unrelated to the tested features.
New `options.resolve` helper that determines the final value to use from an array of input values (fallback) and a given context and/or index. For now, only the bubble chart support scriptable options, see documentation for details.
Add scriptable options documentation and update the bubble chart dataset properties table with their scriptable and indexable capabilities and default values. Also move point style description under the element configuration section.
Akihiko Kusanagi [Mon, 14 Aug 2017 08:09:33 +0000 (16:09 +0800)]
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.