]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Start v3 migration guide (#6639)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Tue, 29 Oct 2019 21:21:45 +0000 (14:21 -0700)
committerEvert Timberg <evert.timberg+github@gmail.com>
Tue, 29 Oct 2019 21:21:45 +0000 (17:21 -0400)
docs/SUMMARY.md
docs/getting-started/v3-migration.md [new file with mode: 0644]
src/helpers/helpers.easing.js

index 72760b12127ccdbc79f635564600591f9583cd9d..088ea6343cf423b69a93605bdf9e05608f53f582 100644 (file)
@@ -6,6 +6,7 @@
   * [Installation](getting-started/installation.md)
   * [Integration](getting-started/integration.md)
   * [Usage](getting-started/usage.md)
+  * [Migration Guide](getting-started/v3-migration.md)
 * [General](general/README.md)
   * [Accessibility](general/accessibility.md)
   * [Responsive](general/responsive.md)
diff --git a/docs/getting-started/v3-migration.md b/docs/getting-started/v3-migration.md
new file mode 100644 (file)
index 0000000..4c0b60e
--- /dev/null
@@ -0,0 +1,70 @@
+# Chart.js 3.x Migration Guide
+
+Chart.js 3.0 introduces a number of breaking changes. Chart.js 2.0 was released in April 2016. In the years since then, as Chart.js has grown in popularity and feature set, we've learned some lessons about how to better create a charting library. In order to improve performance, offer new features, and improve maintainability it was necessary to break backwards compatibility, but we aimed to do so only when necessary.
+
+## Eng user migration
+
+### Ticks
+
+* `options.ticks.userCallback` was renamed to `options.ticks.callback`
+
+### Tooltip
+
+* `xLabel` and `yLabel` were removed. Please use `index` and `value`
+
+### Interactions
+
+* `options.onClick` is now limited to the chart area
+* `{mode: 'single'}` was replaced with `{mode: 'nearest', intersect: true}`
+* `{mode: 'label'}` was replaced with `{mode: 'index'}`
+* `modes['X-axis']` was replaced with `{mode: 'index', intersect: false}`
+
+### Customizability
+
+* `custom` attribute of elements was removed. Please use scriptable options
+
+### Options
+
+* `scales.[x/y]Axes.barPercentage` was moved to dataset option `barPercentage`
+* `scales.[x/y]Axes.barThickness` was moved to dataset option `barThickness`
+* `scales.[x/y]Axes.categoryPercentage` was moved to dataset option `categoryPercentage`
+* `scales.[x/y]Axes.minBarLength` was moved to dataset option `minBarLength`
+* `scales.[x/y]Axes.maxBarThickness` was moved to dataset option `maxBarThickness`
+* `scales.[x/y]Axes.time.format` was renamed to `scales.[x/y]Axes.time.parser`
+* `scales.[x/y]Axes.time.min` was renamed to `scales.[x/y]Axes.ticks.min`
+* `scales.[x/y]Axes.time.max` was renamed to `scales.[x/y]Axes.ticks.max`
+
+## Developer migration
+
+### Removed
+
+* `afterScaleUpdate`
+* `helpers.addEvent`
+* `helpers.aliasPixel`
+* `helpers.configMerge`
+* `helpers.indexOf`
+* `helpers.numberOfLabelLines`
+* `helpers.removeEvent`
+* `helpers.scaleMerge`
+* `scale.mergeTicksOptions`
+* `Chart.Controller`
+* `Chart.chart.chart`
+* `Chart.types`
+
+### Renamed
+
+* `helpers.clear` was renamed to `helpers.canvas.clear`
+* `helpers.drawRoundedRectangle` was renamed to `helpers.canvas.roundedRect`
+* `helpers.callCallback` was renamed to `helpers.callback`
+* `helpers.getValueOrDefault` was renamed to `helpers.valueOrDefault`
+* `helpers.getValueAtIndexOrDefault` was renamed to `helpers.valueAtIndexOrDefault`
+* `helpers.easingEffects` was renamed to `helpers.easing.effects`
+* `helpers.log10` was renamed to `helpers.math.log10`
+* `Chart.Animation.animationObject` was renamed to `Chart.Animation`
+* `Chart.Animation.chartInstance` was renamed to `Chart.Animation.chart`
+
+### Changed
+
+#### Time Scale
+
+* `getValueForPixel` now returns milliseconds since the epoch
index 350f61f0fbf4ffc2a97a288cd377fa814903b44e..5c909953e3af2930381f8675d5825f13c24cf978 100644 (file)
@@ -2,7 +2,7 @@
 
 /**
  * Easing functions adapted from Robert Penner's easing equations.
- * @namespace Chart.helpers.effects
+ * @namespace Chart.helpers.easing.effects
  * @see http://www.robertpenner.com/easing/
  */
 var effects = {