Simon Brunel [Tue, 26 Jun 2018 15:58:32 +0000 (17:58 +0200)]
Enhance the rounded rectangle implementation (#5597)
Use `arcTo` instead of `quadraticCurveTo` (both methods have the same compatibility level) because it generates better results when the final rect is a circle but also when it's actually a rectangle and not a square. This change is needed by the datalabels plugin where the user can configure the `borderRadius` and thus generate circle from a rounded rectangle.
Fix responsive in IE11 with padding as percentage (#4620)
When the chart is responsive to the parent container, the calculations for padding assumes that the figure is in pixels so that 20% is taken to be 20 (pixels), which results in the chart exceeding the parent container. This appears to be an IE11 only issue.
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.