]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Rename showLines to showLine (#7936)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Wed, 21 Oct 2020 12:13:27 +0000 (15:13 +0300)
committerGitHub <noreply@github.com>
Wed, 21 Oct 2020 12:13:27 +0000 (08:13 -0400)
17 files changed:
docs/docs/charts/line.mdx
docs/docs/general/performance.md
docs/docs/getting-started/v3-migration.md
src/controllers/controller.line.js
src/controllers/controller.radar.js
src/core/core.defaults.js
test/fixtures/controller.line/showLines/dataset.js
test/fixtures/controller.line/showLines/false.js
test/fixtures/controller.radar/showLines/value.js
test/fixtures/controller.scatter/showLines/true.js
test/fixtures/controller.scatter/showLines/undefined.js
test/specs/controller.bubble.tests.js
test/specs/controller.line.tests.js
test/specs/controller.polarArea.tests.js
test/specs/controller.radar.tests.js
test/specs/core.controller.tests.js
types/controllers/index.d.ts

index 1a1ebc73881f64f3a4789f9ba38e15382aafbd83..100e935e3b4b72563876e571b932e6414fe9e7b4 100644 (file)
@@ -179,7 +179,7 @@ The line chart defines the following configuration options. These options are me
 
 | Name | Type | Default | Description
 | ---- | ---- | ------- | -----------
-| `showLines` | `boolean` | `true` | If false, the lines between points are not drawn.
+| `showLine` | `boolean` | `true` | If false, the lines between points are not drawn.
 | `spanGaps` | `boolean`\|`number` | `false` | If true, lines will be drawn between points with no or null data. If false, points with `NaN` data will create a break in the line. Can also be a number specifying the maximum gap length to span. The unit of the value depends on the scale used.
 
 ## Default Options
index 13a239092beb08b0e8b2e0eaa5623cecfcda5056..4fed8bc1e7dcfbaf1e4a979e684bdd75f8d17700 100644 (file)
@@ -188,7 +188,7 @@ new Chart(ctx, {
         }]
     },
     options: {
-        showLines: false // disable for all datasets
+        showLine: false // disable for all datasets
     }
 });
 ```
index 085a246db5193a9ee8dd0042020aaaeb2114b76c..23d8a78da582655b23c15f9d95f2add5fd171135 100644 (file)
@@ -91,6 +91,7 @@ A number of changes were made to the configuration options passed to the `Chart`
 * `scales.[x/y]Axes.zeroLine*` options of axes were removed. Use scriptable scale options instead.
 * The dataset option `steppedLine` was removed. Use `stepped`
 * The dataset option `tension` was removed. Use `lineTension`
+* The chart option `showLines` was renamed to `showLine` to match the dataset option.
 * Dataset options are now configured as `options[type].datasets` rather than `options.datasets[type]`
 * To override the platform class used in a chart instance, pass `platform: PlatformClass` in the config object. Note that the class should be passed, not an instance of the class.
 * `aspectRatio` defaults to 1 for doughnut, pie, polarArea, and radar charts
index f9ae019e703179627f81070ff167a6043ada75dc..c59b2df89658d6f5affe4997a763e47e8b8b504a 100644 (file)
@@ -87,7 +87,7 @@ export default class LineController extends DatasetController {
                const options = me.chart.options;
                const lineOptions = options.elements.line;
                const values = super.resolveDatasetElementOptions(active);
-               const showLine = valueOrDefault(config.showLine, options.showLines);
+               const showLine = valueOrDefault(config.showLine, options.showLine);
 
                // The default behavior of lines is to break at null values, according
                // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158
@@ -161,7 +161,7 @@ LineController.defaults = {
                rotation: 'pointRotation'
        },
 
-       showLines: true,
+       showLine: true,
        spanGaps: false,
 
        interaction: {
index 19283338f27a3ba8e623aee7ccdf2839ccb20b45..6dfb3b5ccb8a8a88ba36c301986b7ab176c46877 100644 (file)
@@ -76,7 +76,7 @@ export default class RadarController extends DatasetController {
                const config = me._config;
                const options = me.chart.options;
                const values = super.resolveDatasetElementOptions(active);
-               const showLine = valueOrDefault(config.showLine, options.showLines);
+               const showLine = valueOrDefault(config.showLine, options.showLine);
 
                values.spanGaps = valueOrDefault(config.spanGaps, options.spanGaps);
                values.tension = valueOrDefault(config.lineTension, options.elements.line.tension);
index be9449d621134e2ab0e37429005707af48f1923f..9793a880d09352dc0d3e7e9ad9845aacce1beae0 100644 (file)
@@ -53,7 +53,7 @@ export class Defaults {
                this.onHover = null;
                this.onClick = null;
                this.responsive = true;
-               this.showLines = true;
+               this.showLine = true;
                this.plugins = {};
                this.scale = undefined;
                this.doughnut = undefined;
index b1f47db14a24453d1169b9e1bc1a865474f8c521..fd755ca37777db780b18c30522a860f8425e4ee8 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
                options: {
                        legend: false,
                        title: false,
-                       showLines: true,
+                       showLine: true,
                        scales: {
                                x: {
                                        display: false
index d88f9ebdd9360e71a0179a36d831d49619e9bf9a..026c5102723b1e91ece2a29bfeb7883a90184d7e 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
                options: {
                        legend: false,
                        title: false,
-                       showLines: false,
+                       showLine: false,
                        scales: {
                                x: {
                                        display: false
index eab88702b4b7d1d4291bb72ed5c2a2dde387cab7..f903c38f8b852a1083ad672e764790108b0b1682 100644 (file)
@@ -25,7 +25,7 @@ module.exports = {
                options: {
                        legend: false,
                        title: false,
-                       showLines: false,
+                       showLine: false,
                        elements: {
                                line: {
                                        borderColor: '#ff0000',
index a98262653303f87730d5c334187b3869d3b2453e..9c31f48de26672bb1ba3f7ed2fb32982b7de099c 100644 (file)
@@ -1,5 +1,5 @@
 module.exports = {
-       description: 'showLines option should draw a line if true',
+       description: 'showLine option should draw a line if true',
        config: {
                type: 'scatter',
                data: {
index 42b8bef9f25849a5398d160d666744769772e736..4da3e58540b1b23f559e5e7c0601998913003b02 100644 (file)
@@ -1,5 +1,5 @@
 module.exports = {
-       description: 'showLines option should not draw a line if undefined',
+       description: 'showLine option should not draw a line if undefined',
        config: {
                type: 'scatter',
                data: {
index b0ce9723b06dc11a0decf32a994e8133255d69e3..f31513fbe5fe439df33056451115f1dafb069676 100644 (file)
@@ -70,7 +70,7 @@ describe('Chart.controllers.bubble', function() {
                        },
                        options: {
                                animation: false,
-                               showLines: true
+                               showLine: true
                        }
                });
 
index fbc7c75bd4f2cdcb09dd6d228c48c8bde392da15..d29bdc3e6863875101dcba9f8d559cf22209046b 100644 (file)
@@ -74,7 +74,7 @@ describe('Chart.controllers.line', function() {
                                labels: ['label1', 'label2', 'label3', 'label4']
                        },
                        options: {
-                               showLines: true
+                               showLine: true
                        }
                });
 
@@ -109,7 +109,7 @@ describe('Chart.controllers.line', function() {
                                labels: ['label1', 'label2', 'label3', 'label4']
                        },
                        options: {
-                               showLines: true,
+                               showLine: true,
                                legend: false,
                                title: false,
                                elements: {
index 3a5991b41436eddefcf83db0d236898d868f4112..508cc68a50a1aa36933a4d7db07eb0e9d566cf5c 100644 (file)
@@ -86,7 +86,7 @@ describe('Chart.controllers.polarArea', function() {
                                labels: ['label1', 'label2', 'label3', 'label4']
                        },
                        options: {
-                               showLines: true,
+                               showLine: true,
                                legend: false,
                                title: false,
                                elements: {
@@ -153,7 +153,7 @@ describe('Chart.controllers.polarArea', function() {
                                labels: ['label1', 'label2', 'label3', 'label4']
                        },
                        options: {
-                               showLines: true,
+                               showLine: true,
                                legend: false,
                                title: false,
                                startAngle: 90, // default is 0
@@ -201,7 +201,7 @@ describe('Chart.controllers.polarArea', function() {
                                labels: ['label1', 'label2', 'label3', 'label4']
                        },
                        options: {
-                               showLines: true,
+                               showLine: true,
                                elements: {
                                        arc: {
                                                backgroundColor: 'rgb(255, 0, 0)',
index 235d820ea0fdd007a23f344df8c244a3abb630d7..4660cd23987c87dd68b72cc1d99ad02bd9f6e89e 100644 (file)
@@ -84,7 +84,7 @@ describe('Chart.controllers.radar', function() {
                                labels: ['label1', 'label2', 'label3', 'label4']
                        },
                        options: {
-                               showLines: true,
+                               showLine: true,
                                legend: false,
                                title: false,
                                elements: {
index fe0dd85583101f08fa09d99e8508c57390326086..aa783eb0adfb3ef647a75eae7104057f3b6faa16 100644 (file)
@@ -104,7 +104,7 @@ describe('Chart', function() {
 
                        var options = chart.options;
                        expect(options.font.size).toBe(defaults.font.size);
-                       expect(options.showLines).toBe(defaults.line.showLines);
+                       expect(options.showLine).toBe(defaults.line.showLine);
                        expect(options.spanGaps).toBe(true);
                        expect(options.hover.onHover).toBe(callback);
                        expect(options.hover.mode).toBe('test');
@@ -128,7 +128,7 @@ describe('Chart', function() {
 
                        var options = chart.options;
                        expect(options.font.size).toBe(defaults.font.size);
-                       expect(options.showLines).toBe(defaults.line.showLines);
+                       expect(options.showLine).toBe(defaults.line.showLine);
                        expect(options.spanGaps).toBe(true);
                        expect(options.hover.onHover).toBe(callback);
                        expect(options.hover.mode).toBe('test');
@@ -160,7 +160,7 @@ describe('Chart', function() {
                        });
 
                        var options = chart.options;
-                       expect(options.showLines).toBe(defaults.showLines);
+                       expect(options.showLine).toBe(defaults.showLine);
                        expect(options.spanGaps).toBe(false);
                        expect(options.hover.mode).toBe('dataset');
                        expect(options.title.position).toBe('bottom');
index 0dde84bbc68c94dc9184b13e08cbb1af8ee4f026..f7fce5e26a173f6de810565dd1ecc80df4ea7ca2 100644 (file)
@@ -153,7 +153,7 @@ export interface ILineControllerChartOptions {
    * If false, the lines between points are not drawn.
    * @default true
    */
-  showLines: boolean;
+  showLine: boolean;
 }
 
 export interface LineController extends DatasetController {}
@@ -181,7 +181,7 @@ export interface IDoughnutControllerDatasetOptions
   extends IControllerDatasetOptions,
     ScriptableAndArrayOptions<IArcOptions>,
     ScriptableAndArrayOptions<IArcHoverOptions> {
-  
+
   /**
    * Sweep to allow arcs to cover.
    * @default 2 * Math.PI