]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Rename scale `gridLines` options to be clearer (#8628)
authorEvert Timberg <evert.timberg+github@gmail.com>
Sat, 13 Mar 2021 17:49:09 +0000 (12:49 -0500)
committerGitHub <noreply@github.com>
Sat, 13 Mar 2021 17:49:09 +0000 (19:49 +0200)
* Rename `options.gridLines` to `options.grid`

* Rename `offsetGridLines` to `offset`

52 files changed:
docs/docs/axes/_common.md
docs/docs/axes/styling.mdx
docs/docs/charts/bar.mdx
docs/docs/getting-started/v3-migration.md
samples/charts/bar/multi-axis.html
samples/charts/line/multi-axis.html
samples/charts/scatter/multi-axis.html
samples/scales/financial.html
samples/scales/gridlines-display.html
samples/scales/gridlines-scriptable.html
samples/scales/gridlines-style.html
src/controllers/controller.bar.js
src/controllers/controller.polarArea.js
src/core/core.scale.js
src/plugins/plugin.filler.js
src/scales/scale.radialLinear.js
test/fixtures/core.scale/backgroundColor.js
test/fixtures/core.scale/cartesian-axis-border-settings.json
test/fixtures/core.scale/label-offset-vertical-axes.json
test/fixtures/core.scale/tick-drawing.json
test/fixtures/core.scale/tick-override-styles.json
test/fixtures/core.scale/title/align-end.js
test/fixtures/core.scale/title/align-start.js
test/fixtures/core.scale/title/default.js
test/fixtures/core.scale/title/multi-line/align-end.js
test/fixtures/core.scale/title/multi-line/align-start.js
test/fixtures/core.scale/title/multi-line/default.js
test/fixtures/core.scale/x-axis-position-center.json
test/fixtures/core.scale/x-axis-position-dynamic.json
test/fixtures/core.scale/y-axis-position-center.json
test/fixtures/core.scale/y-axis-position-dynamic.json
test/fixtures/plugin.filler/fill-radar-boundary-end-circular.json
test/fixtures/plugin.filler/fill-radar-boundary-origin-circular.json
test/fixtures/plugin.filler/fill-radar-boundary-start-circular.json
test/fixtures/plugin.filler/fill-radar-value.json
test/fixtures/scale.radialLinear/anglelines-disable.json
test/fixtures/scale.radialLinear/anglelines-indexable.js
test/fixtures/scale.radialLinear/anglelines-scriptable.js
test/fixtures/scale.radialLinear/border-dash.json
test/fixtures/scale.radialLinear/circular-backgroundColor.js
test/fixtures/scale.radialLinear/circular-border-dash.json
test/fixtures/scale.radialLinear/gridlines-disable.json
test/fixtures/scale.radialLinear/gridlines-no-z.json
test/fixtures/scale.radialLinear/gridlines-scriptable.js
test/fixtures/scale.radialLinear/gridlines-z.json
test/fixtures/scale.radialLinear/indexable-gridlines.json
test/fixtures/scale.timeseries/financial-daily.js
test/specs/core.scale.tests.js
test/specs/scale.linear.tests.js
test/specs/scale.radialLinear.tests.js
test/specs/scale.time.tests.js
types/index.esm.d.ts

index 1e9ba6450f1bc6b0e7b0e4e08f81a4e4417ef487..057b4988fe08b3f3b40d2d6b8e17d7e6d321a539 100644 (file)
@@ -7,7 +7,7 @@ Namespace: `options.scales[scaleId]`
 | `type` | `string` | | Type of scale being employed. Custom scales can be created and registered with a string key. This allows changing the type of an axis for a chart.
 | `backgroundColor` | [`Color`](../general/colors.md) | | Background color of the scale area.
 | `display` | `boolean`\|`string` | `true` | Controls the axis global visibility (visible when `true`, hidden when `false`). When `display: 'auto'`, the axis is visible only if at least one associated dataset is visible.
-| `gridLines` | `object` | | Grid line configuration. [more...](./styling.mdx#grid-line-configuration)
+| `grid` | `object` | | Grid line configuration. [more...](./styling.mdx#grid-line-configuration)
 | `min` | `number` | | User defined minimum number for the scale, overrides minimum value from data. [more...](./index.mdx#axis-range-settings)
 | `max` | `number` | | User defined maximum number for the scale, overrides maximum value from data. [more...](./index.mdx#axis-range-settings)
 | `reverse` | `boolean` | `false` | Reverse the scale.
index 6e6f479cab007b3af4a8f5cb3cb3a58a97bf36c9..e4f0bdf405168df255463391a1e69d08ebcb044b 100644 (file)
@@ -8,7 +8,7 @@ There are a number of options to allow styling an axis. There are settings to co
 
 ## Grid Line Configuration
 
-Namespace: `options.scales[scaleId].gridLines`, it defines options for the grid lines that run perpendicular to the axis.
+Namespace: `options.scales[scaleId].grid`, it defines options for the grid lines that run perpendicular to the axis.
 
 | Name | Type | Scriptable | Indexable | Default | Description
 | ---- | ---- | :-------------------------------: | :-----------------------------: | ------- | -----------
@@ -23,7 +23,7 @@ Namespace: `options.scales[scaleId].gridLines`, it defines options for the grid
 | `drawOnChartArea` | `boolean` | | | `true` | If true, draw lines on the chart area inside the axis lines. This is useful when there are multiple axes and you need to control which grid lines are drawn.
 | `drawTicks` | `boolean` | | | `true` | If true, draw lines beside the ticks in the axis area beside the chart.
 | `lineWidth` | `number` | Yes | Yes | `1` | Stroke width of grid lines.
-| `offsetGridLines` | `boolean` | | | `false` | If true, grid lines will be shifted to be between labels. This is set to `true` for a bar chart by default.
+| `offset` | `boolean` | | | `false` | If true, grid lines will be shifted to be between labels. This is set to `true` for a bar chart by default.
 | `tickBorderDash` | `number[]` | | | | Length and spacing of the tick mark line. If not set, defaults to the grid line `borderDash` value.
 | `tickBorderDashOffset` | `number` | Yes | Yes |  | Offset for the line dash of the tick mark. If unset, defaults to the grid line `borderDashOffset` value
 | `tickColor` | [`Color`](../general/colors.md) | Yes | Yes | | Color of the tick line. If unset, defaults to the grid line color.
index cce21feb2f1bfed2a7c50884d6d9eed9b5cb1f37..555fe38e544ad8a85856be70e3c753779fcb068d 100644 (file)
@@ -213,7 +213,7 @@ The bar chart sets unique default values for the following configuration from th
 | Name | Type | Default | Description
 | ---- | ---- | ------- | -----------
 | `offset` | `boolean` | `true` | If true, extra space is added to both edges and the axis is scaled to fit into the chart area.
-| `gridLines.offsetGridLines` | `boolean` | `true` | If true, the bars for a particular data point fall between the grid lines. The grid line will move to the left by one half of the tick interval. If false, the grid line will go right down the middle of the bars. [more...](#offsetgridlines)
+| `grid.offset` | `boolean` | `true` | If true, the bars for a particular data point fall between the grid lines. The grid line will move to the left by one half of the tick interval. If false, the grid line will go right down the middle of the bars. [more...](#offsetgridlines)
 
 ### Example scale configuration
 
@@ -221,15 +221,15 @@ The bar chart sets unique default values for the following configuration from th
 options = {
     scales: {
         x: {
-            gridLines: {
-                offsetGridLines: true
+            grid: {
+              offset: true
             }
         }
     }
 };
 ```
 
-### offsetGridLines
+### Offset Grid Lines
 
 If true, the bars for a particular data point fall between the grid lines. The grid line will move to the left by one half of the tick interval, which is the space between the grid lines. If false, the grid line will go right down the middle of the bars. This is set to true for a category scale in a bar chart while false for other scales or chart types by default.
 
index e0fcc7d72f12e2fd1ac903641c263090c5342fce..1a21a275b834796f6fb53361adee537feef3d924 100644 (file)
@@ -229,7 +229,9 @@ Animation system was completely rewritten in Chart.js v3. Each property can now
 
 #### Ticks
 
-* `options.gridLines.tickMarkLength` was renamed to `options.gridLines.tickLength`.
+* `options.gridLines` was renamed to `options.grid`
+* `options.gridLines.offsetGridLines` was renamed to `options.grid.offset`.
+* `options.gridLines.tickMarkLength` was renamed to `options.grid.tickLength`.
 * `options.ticks.fixedStepSize` is no longer used. Use `options.ticks.stepSize`.
 * `options.ticks.major` and `options.ticks.minor` were replaced with scriptable options for tick fonts.
 * `Chart.Ticks.formatters.linear` was renamed to `Chart.Ticks.formatters.numeric`.
index c73f6fe813205b11f743d89d0f3844c8ae47892c..30672f5c8c5a58fcca6906142676f79a453ead06 100644 (file)
@@ -86,7 +86,7 @@
                                                        type: 'linear',
                                                        display: true,
                                                        position: 'right',
-                                                       gridLines: {
+                                                       grid: {
                                                                drawOnChartArea: false
                                                        }
                                                },
index 52b05d5c04b23cb38c9761b0cbc21792482e23f3..66c12e8d6253fee145ed57840c922ffdb8fd67cf 100644 (file)
@@ -84,7 +84,7 @@
                                                        position: 'right',
 
                                                        // grid line settings
-                                                       gridLines: {
+                                                       grid: {
                                                                drawOnChartArea: false, // only want the grid lines for one axis to show up
                                                        },
                                                },
index 0708b018810dac7a3f779a9181470fbe4b3c9a0e..63a031a61e4b19f17138899431353dbadf3b6a46 100644 (file)
                                                        }
                                                },
 
-                                               gridLines: {
+                                               grid: {
                                                        drawOnChartArea: false, // only want the grid lines for one axis to show up
                                                }
                                        }
index 8847539017092ff62e83906e451f4ae879b4706b..20a6a43717efcbbd28e61f771dd4303d1cc5658f 100644 (file)
                                        },
                                        y: {
                                                type: 'linear',
-                                               gridLines: {
+                                               grid: {
                                                        drawBorder: false
                                                },
                                                title: {
index 15d2639a917bd32a02cf5436bee2679e6b2d3c36..83bec9305a89d3804b2a4796f50bfe1acb2d4909 100644 (file)
@@ -29,7 +29,7 @@
 <body>
        <div class="container"></div>
        <script>
-               function createConfig(gridlines, title) {
+               function createConfig(grid, title) {
                        return {
                                type: 'line',
                                data: {
                                        },
                                        scales: {
                                                x: {
-                                                       gridLines: gridlines
+                                                       grid: grid
                                                },
                                                y: {
-                                                       gridLines: gridlines,
+                                                       grid: grid,
                                                        min: 0,
                                                        max: 100,
                                                        ticks: {
 
                        [{
                                title: 'Display: true',
-                               gridLines: {
+                               grid: {
                                        display: true
                                }
                        }, {
                                title: 'Display: false',
-                               gridLines: {
+                               grid: {
                                        display: false
                                }
                        }, {
                                title: 'Display: false, no border',
-                               gridLines: {
+                               grid: {
                                        display: false,
                                        drawBorder: false
                                }
                        }, {
                                title: 'DrawOnChartArea: false',
-                               gridLines: {
+                               grid: {
                                        display: true,
                                        drawBorder: true,
                                        drawOnChartArea: false,
                                }
                        }, {
                                title: 'DrawTicks: false',
-                               gridLines: {
+                               grid: {
                                        display: true,
                                        drawBorder: true,
                                        drawOnChartArea: true,
                                container.appendChild(div);
 
                                var ctx = canvas.getContext('2d');
-                               var config = createConfig(details.gridLines, details.title);
+                               var config = createConfig(details.grid, details.title);
                                new Chart(ctx, config);
                        });
                };
index b2c88d9a07aeb339398f2c462f5d248144faf6f9..0d15d998026d3660568615607d3424acaf5e33da 100644 (file)
@@ -47,7 +47,7 @@
                                },
                                scales: {
                                        y: {
-                                               gridLines: {
+                                               grid: {
                                                        drawBorder: false,
                                                        color: function(context) {
                                                                if (context.tick.value > 0) {
index 2386c275dc839b60d3720bc904319bf4afca9e9f..d71e5ae46f3351ea43f52610b3dac5f5cd5ca772 100644 (file)
@@ -47,7 +47,7 @@
                                },
                                scales: {
                                        y: {
-                                               gridLines: {
+                                               grid: {
                                                        drawBorder: false,
                                                        color: ['pink', 'red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'purple']
                                                },
index 2a8c6c8e02dd1cec9f0333b1c653c2db6400335e..54be96a96a59fd7f6721a11a0c38d76bb5fc42c0 100644 (file)
@@ -535,8 +535,8 @@ BarController.overrides = {
     _index_: {
       type: 'category',
       offset: true,
-      gridLines: {
-        offsetGridLines: true
+      grid: {
+        offset: true
       }
     },
     _value_: {
index 408ca22aa4458db0005f3e3919fdc00131f8e92a..b7c66cdc5213041ed1d5ab2a24eada710c878f6a 100644 (file)
@@ -187,7 +187,7 @@ PolarAreaController.overrides = {
         display: false
       },
       beginAtZero: true,
-      gridLines: {
+      grid: {
         circular: true
       },
       pointLabels: {
index dcd3a7a64fbec22f9e0f00894d51acefb7ee5440..1f413b5d999d0a988c8e40ddacf2994e36e6471d 100644 (file)
@@ -37,7 +37,7 @@ defaults.set('scale', {
   grace: 0,
 
   // grid line settings
-  gridLines: {
+  grid: {
     display: true,
     lineWidth: 1,
     drawBorder: true,
@@ -46,7 +46,7 @@ defaults.set('scale', {
     tickLength: 10,
     tickWidth: (_ctx, options) => options.lineWidth,
     tickColor: (_ctx, options) => options.color,
-    offsetGridLines: false,
+    offset: false,
     borderDash: [],
     borderDashOffset: 0.0,
     borderColor: (_ctx, options) => options.color,
@@ -90,7 +90,7 @@ defaults.set('scale', {
 });
 
 defaults.route('scale.ticks', 'color', '', 'color');
-defaults.route('scale.gridLines', 'color', '', 'borderColor');
+defaults.route('scale.grid', 'color', '', 'borderColor');
 defaults.route('scale.title', 'color', '', 'color');
 
 defaults.describe('scale', {
@@ -792,7 +792,7 @@ export default class Scale extends Element {
     // Allow 3 pixels x2 padding either side for label readability
     if (maxLabelWidth + 6 > tickWidth) {
       tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));
-      maxHeight = me.maxHeight - getTickMarkLength(options.gridLines)
+      maxHeight = me.maxHeight - getTickMarkLength(options.grid)
                                - tickOpts.padding - getTitleHeight(options.title, me.chart.options.font);
       maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);
       labelRotation = toDegrees(Math.min(
@@ -825,7 +825,7 @@ export default class Scale extends Element {
     const opts = me.options;
     const tickOpts = opts.ticks;
     const titleOpts = opts.title;
-    const gridLineOpts = opts.gridLines;
+    const gridLineOpts = opts.grid;
     const display = me._isVisible();
     const labelsBelowTicks = opts.position !== 'top' && me.axis === 'x';
     const isHorizontal = me.isHorizontal();
@@ -1254,15 +1254,15 @@ export default class Scale extends Element {
     const axis = me.axis;
     const chart = me.chart;
     const options = me.options;
-    const {gridLines, position} = options;
-    const offsetGridLines = gridLines.offsetGridLines;
+    const {grid, position} = options;
+    const offset = grid.offset;
     const isHorizontal = me.isHorizontal();
     const ticks = me.ticks;
-    const ticksLength = ticks.length + (offsetGridLines ? 1 : 0);
-    const tl = getTickMarkLength(gridLines);
+    const ticksLength = ticks.length + (offset ? 1 : 0);
+    const tl = getTickMarkLength(grid);
     const items = [];
 
-    const borderOpts = gridLines.setContext(me.getContext(0));
+    const borderOpts = grid.setContext(me.getContext(0));
     const axisWidth = borderOpts.drawBorder ? borderOpts.borderWidth : 0;
     const axisHalfWidth = axisWidth / 2;
     const alignBorderValue = function(pixel) {
@@ -1324,11 +1324,11 @@ export default class Scale extends Element {
     }
 
     for (i = 0; i < ticksLength; ++i) {
-      const optsAtIndex = gridLines.setContext(me.getContext(i));
+      const optsAtIndex = grid.setContext(me.getContext(i));
 
       const lineWidth = optsAtIndex.lineWidth;
       const lineColor = optsAtIndex.color;
-      const borderDash = gridLines.borderDash || [];
+      const borderDash = grid.borderDash || [];
       const borderDashOffset = optsAtIndex.borderDashOffset;
 
       const tickWidth = optsAtIndex.tickWidth;
@@ -1336,7 +1336,7 @@ export default class Scale extends Element {
       const tickBorderDash = optsAtIndex.tickBorderDash || [];
       const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;
 
-      lineValue = getPixelForGridLine(me, i, offsetGridLines);
+      lineValue = getPixelForGridLine(me, i, offset);
 
       // Skip if the pixel is out of the range
       if (lineValue === undefined) {
@@ -1388,7 +1388,7 @@ export default class Scale extends Element {
     const isHorizontal = me.isHorizontal();
     const ticks = me.ticks;
     const {align, crossAlign, padding} = optionTicks;
-    const tl = getTickMarkLength(options.gridLines);
+    const tl = getTickMarkLength(options.grid);
     const tickAndPadding = tl + padding;
     const rotation = -toRadians(me.labelRotation);
     const items = [];
@@ -1609,20 +1609,20 @@ export default class Scale extends Element {
         */
   drawGrid(chartArea) {
     const me = this;
-    const gridLines = me.options.gridLines;
+    const grid = me.options.grid;
     const ctx = me.ctx;
     const chart = me.chart;
-    const borderOpts = gridLines.setContext(me.getContext(0));
-    const axisWidth = gridLines.drawBorder ? borderOpts.borderWidth : 0;
+    const borderOpts = grid.setContext(me.getContext(0));
+    const axisWidth = grid.drawBorder ? borderOpts.borderWidth : 0;
     const items = me._gridLineItems || (me._gridLineItems = me._computeGridLineItems(chartArea));
     let i, ilen;
 
-    if (gridLines.display) {
+    if (grid.display) {
       for (i = 0, ilen = items.length; i < ilen; ++i) {
         const item = items[i];
         const {color, tickColor, tickWidth, width} = item;
 
-        if (width && color && gridLines.drawOnChartArea) {
+        if (width && color && grid.drawOnChartArea) {
           ctx.save();
           ctx.lineWidth = width;
           ctx.strokeStyle = color;
@@ -1638,7 +1638,7 @@ export default class Scale extends Element {
           ctx.restore();
         }
 
-        if (tickWidth && tickColor && gridLines.drawTicks) {
+        if (tickWidth && tickColor && grid.drawTicks) {
           ctx.save();
           ctx.lineWidth = tickWidth;
           ctx.strokeStyle = tickColor;
@@ -1658,7 +1658,7 @@ export default class Scale extends Element {
 
     if (axisWidth) {
       // Draw the line at the edge of the axis
-      const edgeOpts = gridLines.setContext(me.getContext(me._ticksLength - 1));
+      const edgeOpts = grid.setContext(me.getContext(me._ticksLength - 1));
       const lastLineWidth = edgeOpts.lineWidth;
       const borderValue = me._borderValue;
       let x1, x2, y1, y2;
@@ -1773,7 +1773,7 @@ export default class Scale extends Element {
     const me = this;
     const opts = me.options;
     const tz = opts.ticks && opts.ticks.z || 0;
-    const gz = opts.gridLines && opts.gridLines.z || 0;
+    const gz = opts.grid && opts.grid.z || 0;
 
     if (!me._isVisible() || tz === gz || me.draw !== Scale.prototype.draw) {
       // backward compatibility: draw has been overridden by custom scale
index e91551c78fe40ac477f1d3b40f6d16e3c85a7e3a..a7e4dfeac0197acda0a00074fbc01ee94faa2886 100644 (file)
@@ -148,7 +148,7 @@ function computeCircularBoundary(source) {
     value = scale.getBaseValue();
   }
 
-  if (options.gridLines.circular) {
+  if (options.grid.circular) {
     center = scale.getPointPositionForValue(0, start);
     return new simpleArc({
       x: center.x,
index 17928a7e7515254c50ce415720b35e5b487c902a..f6d9270b9798f0dd7495bb4f34e8dd46128658d0 100644 (file)
@@ -429,7 +429,7 @@ export default class RadialLinearScale extends LinearScaleBase {
         */
   drawBackground() {
     const me = this;
-    const {backgroundColor, gridLines: {circular}} = me.options;
+    const {backgroundColor, grid: {circular}} = me.options;
     if (backgroundColor) {
       const ctx = me.ctx;
       ctx.save();
@@ -449,7 +449,7 @@ export default class RadialLinearScale extends LinearScaleBase {
     const me = this;
     const ctx = me.ctx;
     const opts = me.options;
-    const {angleLines, gridLines} = opts;
+    const {angleLines, grid} = opts;
     const labelCount = me.getLabels().length;
 
     let i, offset, position;
@@ -458,11 +458,11 @@ export default class RadialLinearScale extends LinearScaleBase {
       drawPointLabels(me, labelCount);
     }
 
-    if (gridLines.display) {
+    if (grid.display) {
       me.ticks.forEach((tick, index) => {
         if (index !== 0) {
           offset = me.getDistanceFromCenterForValue(tick.value);
-          const optsAtIndex = gridLines.setContext(me.getContext(index - 1));
+          const optsAtIndex = grid.setContext(me.getContext(index - 1));
           drawRadiusLine(me, optsAtIndex, offset, labelCount);
         }
       });
@@ -574,7 +574,7 @@ RadialLinearScale.defaults = {
     borderDashOffset: 0.0
   },
 
-  gridLines: {
+  grid: {
     circular: false
   },
 
@@ -624,6 +624,6 @@ RadialLinearScale.defaultRoutes = {
 
 RadialLinearScale.descriptors = {
   angleLines: {
-    _fallback: 'gridLines'
+    _fallback: 'grid'
   }
 };
index 47be5469fec949e645be7f6106ad06ce11412ced..2fc36beee1ce3550ae424ef4ce30e4c237245770 100644 (file)
@@ -1,7 +1,7 @@
 const ticks = {
   display: false
 };
-const gridLines = {
+const grid = {
   display: false
 };
 const title = {
@@ -19,7 +19,7 @@ module.exports = {
           backgroundColor: 'red',
           position: 'top',
           ticks,
-          gridLines,
+          grid,
           title
         },
         left: {
@@ -27,7 +27,7 @@ module.exports = {
           backgroundColor: 'green',
           position: 'left',
           ticks,
-          gridLines,
+          grid,
           title
         },
         bottom: {
@@ -35,7 +35,7 @@ module.exports = {
           backgroundColor: 'blue',
           position: 'bottom',
           ticks,
-          gridLines,
+          grid,
           title
         },
         right: {
@@ -43,7 +43,7 @@ module.exports = {
           backgroundColor: 'gray',
           position: 'right',
           ticks,
-          gridLines,
+          grid,
           title
         },
       }
index 3bcd930e8b1396232350d538f2cd094c5f2c15ba..135b04393887840d77c27f3f3e6c2ae6439b9741 100644 (file)
@@ -21,7 +21,7 @@
                     "axis": "x",
                     "min": -100,
                     "max": 100,
-                    "gridLines": {
+                    "grid": {
                         "borderColor": "blue",
                         "borderWidth": 5,
                         "color": "red",
@@ -36,7 +36,7 @@
                     "axis": "y",
                     "min": -100,
                     "max": 100,
-                    "gridLines": {
+                    "grid": {
                         "color": "red",
                         "drawOnChartArea": false
                     },
index e16d4343036bcc8c1fc00cc26fa1b50052659496..381955acea733b01ffcda7d4b2e61bfaceed16f0 100644 (file)
@@ -14,7 +14,7 @@
                     "ticks": {
                         "display": false
                     },
-                    "gridLines":{
+                    "grid":{
                         "display": false,
                         "drawBorder": false
                     }
@@ -23,7 +23,7 @@
                     "ticks": {
                         "labelOffset": 25
                     },
-                    "gridLines":{
+                    "grid":{
                         "display": false,
                         "drawBorder": false
                     }
index 12249616bebb7fa4220543809887623f71166a65..369bf88cd6792549326ee3a6e40ce35c24ac71e2 100644 (file)
@@ -15,7 +15,7 @@
                     "ticks": {
                         "display": false
                     },
-                    "gridLines":{
+                    "grid":{
                         "drawOnChartArea": false,
                         "drawBorder": false,
                         "color": "rgba(0, 0, 0, 1)"
@@ -27,7 +27,7 @@
                     "ticks": {
                         "display": false
                     },
-                    "gridLines":{
+                    "grid":{
                         "drawOnChartArea": false,
                         "drawBorder": false,
                         "color": "rgba(0, 0, 0, 1)"
@@ -43,8 +43,8 @@
                     "ticks": {
                         "display": false
                     },
-                    "gridLines":{
-                        "offsetGridLines": false,
+                    "grid":{
+                        "offset": false,
                         "drawOnChartArea": false,
                         "drawBorder": false,
                         "color": "rgba(0, 0, 0, 1)"
@@ -59,8 +59,8 @@
                     "ticks": {
                         "display": false
                     },
-                    "gridLines":{
-                        "offsetGridLines": false,
+                    "grid":{
+                        "offset": false,
                         "drawOnChartArea": false,
                         "drawBorder": false,
                         "color": "rgba(0, 0, 0, 1)"
index 5932fc8ddba66dfc85c7e6b35efb88fee01df18f..c793190117b477f079c8d5ea65ec46bfe3a80738 100644 (file)
@@ -15,7 +15,7 @@
                     "ticks": {
                         "display": false
                     },
-                    "gridLines":{
+                    "grid":{
                         "drawOnChartArea": false,
                         "drawBorder": false,
                         "color": "rgba(0, 0, 0, 1)",
@@ -34,8 +34,8 @@
                     "ticks": {
                         "display": false
                     },
-                    "gridLines":{
-                        "offsetGridLines": false,
+                    "grid":{
+                        "offset": false,
                         "drawOnChartArea": false,
                         "drawBorder": false,
                         "color": "rgba(0, 0, 0, 1)",
index 81059cf944d87291ef697b08fe8fd8b6725addea..f75f12e21c1a1e6d568351cfc1527b6c879a47ed 100644 (file)
@@ -10,7 +10,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -25,7 +25,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -40,7 +40,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -55,7 +55,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
index 385f1725ef90af023a02a6d9b7eb2e3dc5787ef7..6ca37ffa4d7ec7abdcf0b44698f3031b46882b11 100644 (file)
@@ -10,7 +10,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -25,7 +25,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -40,7 +40,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -55,7 +55,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
index 9570d89bc6c246ba3dcfdf5f458cdd98664672a6..dfd1c469cbe5c64689d088b991070c5c9f5d767f 100644 (file)
@@ -10,7 +10,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -24,7 +24,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -38,7 +38,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -52,7 +52,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
index b6d980b0629c6bf825c9b633acd66888632394e2..8e4ff0e8baa27f5e76595203fd72c43001f56664 100644 (file)
@@ -10,7 +10,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -25,7 +25,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -40,7 +40,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -55,7 +55,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
index c0e97cb0736b0e3f67d748c82f395ba64625fce1..fd6a4d6b522163069f75a7b3f2d558c777530b42 100644 (file)
@@ -10,7 +10,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -25,7 +25,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -40,7 +40,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -55,7 +55,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
index c320d0f69052a1c2206df07bb9868293d832111d..28a9f303887b61aabd7e6b4189e59494d5faecce 100644 (file)
@@ -10,7 +10,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -24,7 +24,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -38,7 +38,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
@@ -52,7 +52,7 @@ module.exports = {
           ticks: {
             display: false
           },
-          gridLines: {
+          grid: {
             display: false
           },
           title: {
index 8f3ec140980a9bf255996316112ce94165d46b7b..4ecd78329db1cb6e83d670c95d84d96c386422c9 100644 (file)
@@ -22,7 +22,7 @@
                     "axis": "x",
                     "min": -100,
                     "max": 100,
-                    "gridLines": {
+                    "grid": {
                         "color": "red",
                         "drawOnChartArea": false
                     },
@@ -35,7 +35,7 @@
                     "axis": "y",
                     "min": -100,
                     "max": 100,
-                    "gridLines": {
+                    "grid": {
                         "color": "red",
                         "drawOnChartArea": false
                     },
index 9661dedd2b2ff85677adba449215290747b90cd6..4a0be74b745c6ad38617bbd947111ed928f5d83d 100644 (file)
@@ -24,7 +24,7 @@
                     "axis": "x",
                     "min": -100,
                     "max": 100,
-                    "gridLines": {
+                    "grid": {
                         "color": "red",
                         "drawOnChartArea": false
                     },
@@ -37,7 +37,7 @@
                     "axis": "y",
                     "min": -100,
                     "max": 100,
-                    "gridLines": {
+                    "grid": {
                         "color": "red",
                         "drawOnChartArea": false
                     },
index ff0cf28f9c2b3688fa553b1564103a5ccc681f2a..e2128ad5c7e907bfd99b48983ab8caf120cbaa9e 100644 (file)
@@ -22,7 +22,7 @@
                     "axis": "x",
                     "min": -100,
                     "max": 100,
-                    "gridLines": {
+                    "grid": {
                         "color": "red",
                         "drawOnChartArea": false
                     },
@@ -35,7 +35,7 @@
                     "axis": "y",
                     "min": -100,
                     "max": 100,
-                    "gridLines": {
+                    "grid": {
                         "color": "red",
                         "drawOnChartArea": false
                     },
index 6e44d10facda8132771f49f231737a4c4f1a99c9..c3b63d3d38bcf5819019b6bce489496dd1f4c7c4 100644 (file)
@@ -22,7 +22,7 @@
                     "axis": "x",
                     "min": -100,
                     "max": 100,
-                    "gridLines": {
+                    "grid": {
                         "color": "red",
                         "drawOnChartArea": false
                     },
@@ -37,7 +37,7 @@
                     "axis": "y",
                     "min": -100,
                     "max": 100,
-                    "gridLines": {
+                    "grid": {
                         "color": "red",
                         "drawOnChartArea": false
                     },
index cee537e644b53df55428ae59c65f606f6201c2c5..ecfa8fcd5eebe16e98f21a1e592d0105440ad632 100644 (file)
@@ -28,7 +28,7 @@
       "scales": {
         "r": {
           "display": false,
-          "gridLines": {
+          "grid": {
             "circular": true
           }
         }
index d479c28a94eb4c0652e315102a3b348a9a57e2b1..f234fd5c2424ad3f43639d39c44e7d37712cfdb2 100644 (file)
@@ -28,7 +28,7 @@
       "scales": {
         "r": {
           "display": false,
-          "gridLines": {
+          "grid": {
             "circular": true
           }
         }
index f10119f7a90117f1a3596cd5dcd958dd40dcf60e..51d08ad4a6c63acecd8dd62aeca53d0788630916 100644 (file)
@@ -28,7 +28,7 @@
       "scales": {
         "r": {
           "display": false,
-          "gridLines": {
+          "grid": {
             "circular": true
           }
         }
index 882b536bac2e013d68df0123a207138df1e3038b..8a62822f54d7d66bdc49643df0e0da161571115d 100644 (file)
@@ -16,7 +16,7 @@
       "scales": {
         "r": {
           "display": false,
-          "gridLines": {
+          "grid": {
             "circular": true
           }
         }
index 2551b69a11f89bb712d5c25b3b539b11a957ee94..ac1585d60286cbddacc4ff916dbc8b124f4386ae 100644 (file)
@@ -8,7 +8,7 @@
       "responsive": false,
       "scales": {
         "r": {
-          "gridLines": {
+          "grid": {
             "color": "rgb(0, 0, 0)",
             "lineWidth": 1
           },
index df62588bdf7cad799552735bf0c45cca94afc521..8430a5ebc45a65feccea904fc895788bd0c7b0ee 100644 (file)
@@ -8,7 +8,7 @@ module.exports = {
       responsive: false,
       scales: {
         r: {
-          gridLines: {
+          grid: {
             display: true,
           },
           angleLines: {
index a3d97d1038bbba239261efe76ea34b030c2c24dc..170dbfd79899b55d07aae26485ed04e4f0f6aa24 100644 (file)
@@ -8,7 +8,7 @@ module.exports = {
       responsive: false,
       scales: {
         r: {
-          gridLines: {
+          grid: {
             display: true,
           },
           angleLines: {
index ec683c4c674ab6d26c11c81f621afc2a32571349..5aac486374acb703c58a9779460e1d256bd3d2b8 100644 (file)
@@ -8,7 +8,7 @@
       "responsive": false,
       "scales": {
         "r": {
-          "gridLines": {
+          "grid": {
             "color": "rgba(0, 0, 255, 0.5)",
             "lineWidth": 1,
             "borderDash": [4, 2],
index 5e21f244e6c97c158ebd9478e9d4ee4ed31e5cea..0e47fe0b0fcb071baa568fd3c8df2e01c46daa72 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
           backgroundColor: '#00FF00',
           min: 0,
           max: 3,
-          gridLines: {
+          grid: {
             circular: true
           },
           pointLabels: {
index c6b0ad5f9fcf1028155827c8079fa46601729899..844b526627bfdf0fe1fbd79274d6837ebec5bdf8 100644 (file)
@@ -8,7 +8,7 @@
       "responsive": false,
       "scales": {
         "r": {
-          "gridLines": {
+          "grid": {
             "circular": true,
             "color": "rgba(0, 0, 255, 0.5)",
             "lineWidth": 1,
index 45f8b8b12fd466617521cd0f3e57e6961234d840..34ddf053b84f3b6d3f194a1397fd2ebda7e50615 100644 (file)
@@ -8,7 +8,7 @@
       "responsive": false,
       "scales": {
         "r": {
-          "gridLines": {
+          "grid": {
             "display": false
           },
           "angleLines": {
index 6252753b3a85bece7effb1856b0e6571420f2302..c2ee605967d3400f8f51125cf5e13494a6521173 100644 (file)
@@ -14,7 +14,7 @@
       "responsive": false,
       "scales": {
         "r": {
-          "gridLines": {
+          "grid": {
             "color": "rgba(0, 0, 0, 1)",
             "lineWidth": 1
           },
index 535433fedaa73c484e43866a9f3a5624b222880f..9c21e30cf14f46a4414d8bcb25ac2def1b59d80e 100644 (file)
@@ -8,7 +8,7 @@ module.exports = {
       responsive: false,
       scales: {
         r: {
-          gridLines: {
+          grid: {
             display: true,
             color: function(context) {
               return context.index % 2 === 0 ? 'green' : 'red';
index 70b1e456a364c3d4f462be610ef47de49b3707f4..17aed68a292d6a41eb076d8b74d59c3b29be6b1f 100644 (file)
@@ -14,7 +14,7 @@
       "responsive": false,
       "scales": {
         "r": {
-          "gridLines": {
+          "grid": {
             "color": "rgba(0, 0, 0, 1)",
             "lineWidth": 1,
             "z": 1
index 8c8dde5ce3b5b63bce6fe55d27bbb70c8b7d63ec..7aaae2b2ae7bdc89c8508fbdc5685bf822689621 100644 (file)
@@ -8,7 +8,7 @@
       "responsive": false,
       "scales": {
         "r": {
-          "gridLines": {
+          "grid": {
             "display": true,
             "color": [
               "rgba(0, 0, 0, 0.5)",
index 66adfcfd8345708941a91192eaabb30e65e0fbd8..249572f2b2b3495a2a2b5f325a37772112e49d2c 100644 (file)
@@ -45,7 +45,7 @@ module.exports = {
         },
         y: {
           type: 'linear',
-          gridLines: {
+          grid: {
             drawBorder: false
           }
         }
index 0f337671b939b409971063bb030222bb16cfc3c4..93a046186073b043311b9d67aea1b0fb2d64203f 100644 (file)
@@ -130,8 +130,8 @@ describe('Core.scale', function() {
         options: {
           scales: {
             x: {
-              gridLines: {
-                offsetGridLines: test.offsetGridLines,
+              grid: {
+                offset: test.offsetGridLines,
                 drawTicks: false
               },
               ticks: {
@@ -178,8 +178,8 @@ describe('Core.scale', function() {
             },
             y: {
               type: 'category',
-              gridLines: {
-                offsetGridLines: test.offsetGridLines,
+              grid: {
+                offset: test.offsetGridLines,
                 drawTicks: false
               },
               ticks: {
@@ -466,7 +466,7 @@ describe('Core.scale', function() {
           scales: {
             x: {
               type: 'customScale',
-              gridLines: {
+              grid: {
                 z: 10
               },
               ticks: {
@@ -492,7 +492,7 @@ describe('Core.scale', function() {
               ticks: {
                 z: 10
               },
-              gridLines: {
+              grid: {
                 z: 10
               }
             }
@@ -528,7 +528,7 @@ describe('Core.scale', function() {
           scales: {
             x: {
               type: 'linear',
-              gridLines: {
+              grid: {
                 z: 11
               }
             }
@@ -547,7 +547,7 @@ describe('Core.scale', function() {
               ticks: {
                 z: 10
               },
-              gridLines: {
+              grid: {
                 z: 11
               }
             }
index 58932da3f5dd3a6f289fc6a0a7a052eb4978d973..364cbe76b39ca7458337c5b01be8d3c3b82d6bd3 100644 (file)
@@ -953,7 +953,7 @@ describe('Linear Scale', function() {
           },
           y: {
             type: 'linear',
-            gridLines: {
+            grid: {
               drawTicks: false,
               drawBorder: false
             },
index 818d0f3de86fdbbef877107e99ced26eb88ffef5..d4ef2a77939eead7c81e5843d9e46c5040c8911e 100644 (file)
@@ -27,7 +27,7 @@ describe('Test the radial linear scale', function() {
         borderDashOffset: 0.0
       },
 
-      gridLines: {
+      grid: {
         circular: false
       },
 
index 219e0fba664fc34401efe5fa954da6d4313c49e0..9d0ed4a243f23622f0cfd3a2fa8c0fcd4c46752a 100644 (file)
@@ -1101,7 +1101,7 @@ describe('Time scale tests', function() {
           },
           y: {
             type: 'linear',
-            gridLines: {
+            grid: {
               drawBorder: false
             }
           }
index c1947105508dfe0812d2cdcf94a6a8a464fda996..0f4739da68f002ea565ac3e3181c5bdc423e4224 100644 (file)
@@ -2619,7 +2619,7 @@ export interface GridLineOptions {
   /**
    * @default false
    */
-  offsetGridLines: boolean;
+  offset: boolean;
 }
 
 export interface TickOptions {
@@ -2696,7 +2696,7 @@ export interface CartesianScaleOptions extends CoreScaleOptions {
    */
   offset: boolean;
 
-  gridLines: GridLineOptions;
+  grid: GridLineOptions;
 
   title: {
     display: boolean;
@@ -2993,7 +2993,7 @@ export type RadialLinearScaleOptions = CoreScaleOptions & {
    */
   beginAtZero: boolean;
 
-  gridLines: GridLineOptions;
+  grid: GridLineOptions;
 
   /**
    * User defined minimum number for the scale, overrides minimum value from data.