]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Convert axis options from arrays to objects (#6773)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Thu, 21 Nov 2019 23:46:49 +0000 (01:46 +0200)
committerEvert Timberg <evert.timberg+github@gmail.com>
Thu, 21 Nov 2019 23:46:49 +0000 (18:46 -0500)
* Convert axis options from arrays to objects

* Updated all chart type defaults
* Throw errors when axis type or position are not specified
* Avoid raising unnecessary errors when merging options into the default configs

* Fix additional tests

* Ensure scale defaults are set if type is not explicitly defined

* Another step

* Include `scale` as `firstIDs.r`

* update docs

* Update for buildOrUpdateScales

* Update migration guide

* Add test back

211 files changed:
docs/README.md
docs/axes/cartesian/README.md
docs/axes/cartesian/category.md
docs/axes/cartesian/linear.md
docs/axes/cartesian/time.md
docs/axes/labelling.md
docs/charts/bar.md
docs/charts/line.md
docs/charts/mixed.md
docs/charts/scatter.md
docs/developers/axes.md
docs/developers/updates.md
docs/getting-started/usage.md
docs/getting-started/v3-migration.md
samples/charts/area/line-boundaries.html
samples/charts/area/line-datasets.html
samples/charts/area/line-stacked.html
samples/charts/bar/multi-axis.html
samples/charts/bar/stacked-group.html
samples/charts/bar/stacked.html
samples/charts/line/basic.html
samples/charts/line/interpolation-modes.html
samples/charts/line/line-styles.html
samples/charts/line/multi-axis.html
samples/charts/line/point-sizes.html
samples/charts/line/skip-points.html
samples/charts/scatter/multi-axis.html
samples/legend/callbacks.html
samples/legend/point-style.html
samples/legend/positioning.html
samples/scales/filtering-labels.html
samples/scales/gridlines-display.html
samples/scales/gridlines-style.html
samples/scales/linear/min-max-suggested.html
samples/scales/linear/min-max.html
samples/scales/linear/step-size.html
samples/scales/logarithmic/line.html
samples/scales/logarithmic/scatter.html
samples/scales/non-numeric-y.html
samples/scales/time/combo.html
samples/scales/time/financial.html
samples/scales/time/line-point-data.html
samples/scales/time/line.html
samples/scales/toggle-scale-type.html
samples/tooltips/callbacks.html
src/controllers/controller.bar.js
src/controllers/controller.bubble.js
src/controllers/controller.horizontalBar.js
src/controllers/controller.line.js
src/controllers/controller.polarArea.js
src/controllers/controller.radar.js
src/controllers/controller.scatter.js
src/core/core.controller.js
src/core/core.datasetController.js
src/core/core.scale.js
src/plugins/plugin.filler.js
test/fixtures/controller.bar/backgroundColor/indexable.js
test/fixtures/controller.bar/backgroundColor/scriptable.js
test/fixtures/controller.bar/backgroundColor/value.js
test/fixtures/controller.bar/bar-thickness-absolute.json
test/fixtures/controller.bar/bar-thickness-flex-offset.json
test/fixtures/controller.bar/bar-thickness-flex-single-reverse.json
test/fixtures/controller.bar/bar-thickness-flex-single.json
test/fixtures/controller.bar/bar-thickness-flex.json
test/fixtures/controller.bar/bar-thickness-max.json
test/fixtures/controller.bar/bar-thickness-min-interval.json
test/fixtures/controller.bar/bar-thickness-multiple.json
test/fixtures/controller.bar/bar-thickness-no-overlap.json
test/fixtures/controller.bar/bar-thickness-offset.json
test/fixtures/controller.bar/bar-thickness-per-dataset-stacked.json
test/fixtures/controller.bar/bar-thickness-per-dataset.json
test/fixtures/controller.bar/bar-thickness-reverse.json
test/fixtures/controller.bar/bar-thickness-single-xy.json
test/fixtures/controller.bar/bar-thickness-single.json
test/fixtures/controller.bar/bar-thickness-stacked.json
test/fixtures/controller.bar/borderColor/indexable.js
test/fixtures/controller.bar/borderColor/scriptable.js
test/fixtures/controller.bar/borderColor/value.js
test/fixtures/controller.bar/borderSkipped/indexable.js
test/fixtures/controller.bar/borderSkipped/scriptable.js
test/fixtures/controller.bar/borderSkipped/value.js
test/fixtures/controller.bar/borderWidth/indexable-object.js
test/fixtures/controller.bar/borderWidth/indexable.js
test/fixtures/controller.bar/borderWidth/negative.js
test/fixtures/controller.bar/borderWidth/object.js
test/fixtures/controller.bar/borderWidth/scriptable-object.js
test/fixtures/controller.bar/borderWidth/scriptable.js
test/fixtures/controller.bar/borderWidth/value.js
test/fixtures/controller.bar/chart-area-clip.js
test/fixtures/controller.bar/data/object.js
test/fixtures/controller.bar/floatBar/data-as-objects-horizontal.js
test/fixtures/controller.bar/floatBar/data-as-objects.js
test/fixtures/controller.bar/floatBar/float-bar-horizontal.json
test/fixtures/controller.bar/floatBar/float-bar-stacked-horizontal.json
test/fixtures/controller.bar/floatBar/float-bar-stacked.json
test/fixtures/controller.bar/floatBar/float-bar.json
test/fixtures/controller.bar/horizontal-borders.js
test/fixtures/controller.bar/stacking/order-default.json
test/fixtures/controller.bar/stacking/order-specified.json
test/fixtures/controller.bubble/clip.js
test/fixtures/controller.bubble/point-style.json
test/fixtures/controller.bubble/radius-data.js
test/fixtures/controller.bubble/radius-scriptable.js
test/fixtures/controller.line/backgroundColor/scriptable.js
test/fixtures/controller.line/backgroundColor/value.js
test/fixtures/controller.line/borderCapStyle/scriptable.js
test/fixtures/controller.line/borderCapStyle/value.js
test/fixtures/controller.line/borderColor/scriptable.js
test/fixtures/controller.line/borderColor/value.js
test/fixtures/controller.line/borderDash/scriptable.js
test/fixtures/controller.line/borderDash/value.js
test/fixtures/controller.line/borderDashOffset/scriptable.js
test/fixtures/controller.line/borderDashOffset/value.js
test/fixtures/controller.line/borderJoinStyle/scriptable.js
test/fixtures/controller.line/borderJoinStyle/value.js
test/fixtures/controller.line/borderWidth/scriptable.js
test/fixtures/controller.line/borderWidth/value.js
test/fixtures/controller.line/clip/default-x-max.json
test/fixtures/controller.line/clip/default-x-min.json
test/fixtures/controller.line/clip/default-x.json
test/fixtures/controller.line/clip/default-y-max.json
test/fixtures/controller.line/clip/default-y-min.json
test/fixtures/controller.line/clip/default-y.json
test/fixtures/controller.line/clip/specified.json
test/fixtures/controller.line/cubicInterpolationMode/scriptable.js
test/fixtures/controller.line/cubicInterpolationMode/value.js
test/fixtures/controller.line/fill/order-default.js
test/fixtures/controller.line/fill/order.js
test/fixtures/controller.line/fill/scriptable.js
test/fixtures/controller.line/fill/value.js
test/fixtures/controller.line/non-numeric-y.json
test/fixtures/controller.line/point-style.json
test/fixtures/controller.line/pointBackgroundColor/indexable.js
test/fixtures/controller.line/pointBackgroundColor/scriptable.js
test/fixtures/controller.line/pointBackgroundColor/value.js
test/fixtures/controller.line/pointBorderColor/indexable.js
test/fixtures/controller.line/pointBorderColor/scriptable.js
test/fixtures/controller.line/pointBorderColor/value.js
test/fixtures/controller.line/pointBorderWidth/indexable.js
test/fixtures/controller.line/pointBorderWidth/scriptable.js
test/fixtures/controller.line/pointBorderWidth/value.js
test/fixtures/controller.line/pointStyle/indexable.js
test/fixtures/controller.line/pointStyle/scriptable.js
test/fixtures/controller.line/pointStyle/value.js
test/fixtures/controller.line/radius/indexable.js
test/fixtures/controller.line/radius/scriptable.js
test/fixtures/controller.line/radius/value.js
test/fixtures/controller.line/rotation/indexable.js
test/fixtures/controller.line/rotation/scriptable.js
test/fixtures/controller.line/rotation/value.js
test/fixtures/controller.line/stacking/order-default.js
test/fixtures/controller.line/stacking/order-specified.js
test/fixtures/core.scale/label-offset-vertical-axes.json
test/fixtures/core.scale/tick-drawing.json
test/fixtures/core.tooltip/opacity.js
test/fixtures/element.line/default.js
test/fixtures/element.line/skip/all.js
test/fixtures/element.line/skip/first-span.js
test/fixtures/element.line/skip/first.js
test/fixtures/element.line/skip/last-span.js
test/fixtures/element.line/skip/last.js
test/fixtures/element.line/skip/middle-span.js
test/fixtures/element.line/skip/middle.js
test/fixtures/element.line/stepped/after.js
test/fixtures/element.line/stepped/before.js
test/fixtures/element.line/stepped/default.js
test/fixtures/element.line/stepped/middle.js
test/fixtures/element.line/tension/default.js
test/fixtures/element.line/tension/one.js
test/fixtures/element.line/tension/zero.js
test/fixtures/element.point/point-style-circle.json
test/fixtures/element.point/point-style-cross-rot.json
test/fixtures/element.point/point-style-cross.json
test/fixtures/element.point/point-style-dash.json
test/fixtures/element.point/point-style-image.js
test/fixtures/element.point/point-style-line.json
test/fixtures/element.point/point-style-rect-rot.json
test/fixtures/element.point/point-style-rect-rounded.json
test/fixtures/element.point/point-style-rect.json
test/fixtures/element.point/point-style-star.json
test/fixtures/element.point/point-style-triangle.json
test/fixtures/element.point/rotation.js
test/fixtures/plugin.filler/fill-line-boundary-end-span.json
test/fixtures/plugin.filler/fill-line-boundary-end.json
test/fixtures/plugin.filler/fill-line-boundary-origin-span.json
test/fixtures/plugin.filler/fill-line-boundary-origin-spline-span.json
test/fixtures/plugin.filler/fill-line-boundary-origin-spline.json
test/fixtures/plugin.filler/fill-line-boundary-origin-stepped-span.json
test/fixtures/plugin.filler/fill-line-boundary-origin-stepped.json
test/fixtures/plugin.filler/fill-line-boundary-origin.json
test/fixtures/plugin.filler/fill-line-boundary-start-span.json
test/fixtures/plugin.filler/fill-line-boundary-start.json
test/fixtures/plugin.filler/fill-line-dataset-border.json
test/fixtures/plugin.filler/fill-line-dataset-span.json
test/fixtures/plugin.filler/fill-line-dataset-spline-span.json
test/fixtures/plugin.filler/fill-line-dataset-spline.json
test/fixtures/plugin.filler/fill-line-dataset.json
test/fixtures/scale.radialLinear/indexable-gridlines.json
test/specs/controller.bar.tests.js
test/specs/controller.bubble.tests.js
test/specs/controller.line.tests.js
test/specs/core.controller.tests.js
test/specs/core.datasetController.tests.js
test/specs/core.layouts.tests.js
test/specs/core.scale.tests.js
test/specs/core.ticks.tests.js
test/specs/scale.category.tests.js
test/specs/scale.linear.tests.js
test/specs/scale.logarithmic.tests.js
test/specs/scale.radialLinear.tests.js
test/specs/scale.time.tests.js

index c82e938724e66ad910a44a2475c480872dbe9ac4..e56935b36914066acf52257f4ed1a7f065156815 100644 (file)
@@ -43,9 +43,9 @@ var myChart = new Chart(ctx, {
     },
     options: {
         scales: {
-            yAxes: [{
+            y{
                 beginAtZero: true
-            }]
+            }
         }
     }
 });
index 386fadc1114b00235acb7745cd77a70f6fb422d6..6b9b98253ae53afb65ae3bef5eb229e9fe601cb4 100644 (file)
@@ -38,7 +38,8 @@ The following options are common to all cartesian axes but do not apply to other
 | `padding` | `number` | `0` | Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this applies in the vertical (Y) direction.
 
 ### Axis ID
-The properties `dataset.xAxisID` or `dataset.yAxisID` have to match the scale properties `scales.xAxes.id` or `scales.yAxes.id`. This is especially needed if multi-axes charts are used.
+
+The properties `dataset.xAxisID` or `dataset.yAxisID` have to match to `scales` property. This is especially needed if multi-axes charts are used.
 
 ```javascript
 var myChart = new Chart(ctx, {
@@ -54,11 +55,10 @@ var myChart = new Chart(ctx, {
     },
     options: {
         scales: {
-            yAxes: [{
-                id: 'first-y-axis',
+            'first-y-axis': {
                 type: 'linear'
-            }, {
-                id: 'second-y-axis',
+            },
+            'second-y-axis': {
                 type: 'linear'
             }]
         }
@@ -93,12 +93,11 @@ var myChart = new Chart(ctx, {
     },
     options: {
         scales: {
-            yAxes: [{
-                id: 'left-y-axis',
+            'left-y-axis': {
                 type: 'linear',
                 position: 'left'
-            }, {
-                id: 'right-y-axis',
+            },
+            'right-y-axis': {
                 type: 'linear',
                 position: 'right'
             }]
index acb140cbedbb012bb835530a982ae54f3e70db98..69bad18029acb2b544292ab985f4b5aa78375482 100644 (file)
@@ -25,10 +25,10 @@ let chart = new Chart(ctx, {
     data: ...
     options: {
         scales: {
-            xAxes: [{
+            x{
                 type: 'category',
                 labels: ['January', 'February', 'March', 'April', 'May', 'June']
-            }]
+            }
         }
     }
 });
@@ -58,9 +58,9 @@ let chart = new Chart(ctx, {
     },
     options: {
         scales: {
-            xAxes: [{
+            x{
                 min: 'March'
-            }]
+            }
         }
     }
 });
index 52b287dfe167a66e269b6841db4df0d3ecd9f8d1..44e74b9fc277bddfd325a08e60f5b055d35e30c0 100644 (file)
@@ -45,10 +45,10 @@ let chart = new Chart(ctx, {
     },
     options: {
         scales: {
-            yAxes: [{
+            y{
                 suggestedMin: 50,
                 suggestedMax: 100
-            }]
+            }
         }
     }
 });
@@ -65,13 +65,13 @@ This example sets up a chart with a y axis that creates ticks at `0, 0.5, 1, 1.5
 ```javascript
 let options = {
     scales: {
-        yAxes: [{
+        y{
             max: 5,
             min: 0,
             ticks: {
                 stepSize: 0.5
             }
-        }]
+        }
     }
 };
 ```
index faa89a9e796be125556367e94580fec869f6eb1e..157d6c612f4f988fbb347407fe51750a93e2f8f2 100644 (file)
@@ -67,18 +67,19 @@ var chart = new Chart(ctx, {
     data: data,
     options: {
         scales: {
-            xAxes: [{
+            x{
                 type: 'time',
                 time: {
                     unit: 'month'
                 }
-            }]
+            }
         }
     }
 });
 ```
 
 ### Display Formats
+
 The following display formats are used to configure how different time units are formed into strings for the axis tick marks. See [Moment.js](https://momentjs.com/docs/#/displaying/format/) for the allowable format strings.
 
 Name | Default | Example
@@ -101,14 +102,14 @@ var chart = new Chart(ctx, {
     data: data,
     options: {
         scales: {
-            xAxes: [{
+            x{
                 type: 'time',
                 time: {
                     displayFormats: {
                         quarter: 'MMM YYYY'
                     }
                 }
-            }]
+            }
         }
     }
 });
@@ -127,10 +128,10 @@ var chart = new Chart(ctx, {
     data: data,
     options: {
         scales: {
-            xAxes: [{
+            x{
                 type: 'time',
                 distribution: 'series'
-            }]
+            }
         }
     }
 });
index f92f9be42f2f64fe71a06c449ef42533d37de2f0..5eb6224dbd1c71778b0bd9eb545c87e05a6c7d6f 100644 (file)
@@ -31,14 +31,14 @@ var chart = new Chart(ctx, {
     data: data,
     options: {
         scales: {
-            yAxes: [{
+            y{
                 ticks: {
                     // Include a dollar sign in the ticks
                     callback: function(value, index, values) {
                         return '$' + value;
                     }
                 }
-            }]
+            }
         }
     }
 });
index 8cf78f9950288263fad73c96964d6650ed6440d6..e064309d375068d85dec5da0f0160b3ae6e12d91 100644 (file)
@@ -41,9 +41,9 @@ A bar chart provides a way of showing data values represented as vertical bars.
     },
     "options": {
         "scales": {
-            "yAxes": [{
+            "y": {
                 "beginAtZero": true
-            }]
+            }
         }
     }
 }
@@ -160,7 +160,9 @@ data: {
     }]
 };
 ```
+
 ### barThickness
+
 If this value is a number, it is applied to the width of each bar, in pixels. When this is enforced, `barPercentage` and `categoryPercentage` are ignored.
 
 If set to `'flex'`, the base sample widths are calculated automatically based on the previous and following samples so that they take the full available widths without overlap. Then, bars are sized using `barPercentage` and `categoryPercentage`. There is no gap when the percentage options are 1. This mode generates bars with different widths when data are not evenly spaced.
@@ -168,6 +170,7 @@ If set to `'flex'`, the base sample widths are calculated automatically based on
 If not set (default), the base sample widths are calculated using the smallest interval that prevents bar overlapping, and bars are sized using `barPercentage` and `categoryPercentage`. This mode always generates bars equally sized.
 
 ## Scale Configuration
+
 The bar chart sets unique default values for the following configuration from the associated `scale` options:
 
 | Name | Type | Default | Description
@@ -180,16 +183,17 @@ The bar chart sets unique default values for the following configuration from th
 ```javascript
 options = {
     scales: {
-        xAxes: [{
+        x{
             gridLines: {
                 offsetGridLines: true
             }
-        }]
+        }
     }
 };
 ```
 
 ### offsetGridLines
+
 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.
 
 ## Default Options
@@ -249,12 +253,12 @@ var stackedBar = new Chart(ctx, {
     data: data,
     options: {
         scales: {
-            xAxes: [{
+            x{
                 stacked: true
-            }],
-            yAxes: [{
+            },
+            y{
                 stacked: true
-            }]
+            }
         }
     }
 });
@@ -267,6 +271,7 @@ The following dataset properties are specific to stacked bar charts.
 | `stack` | `string` | The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack).
 
 ## Horizontal Bar Chart
+
 A horizontal bar chart is a variation on a vertical bar chart. It is sometimes used to show trend data, and the comparison of multiple data sets side by side.
 {% chartjs %}
 {
@@ -300,9 +305,9 @@ A horizontal bar chart is a variation on a vertical bar chart. It is sometimes u
     },
     "options": {
         "scales": {
-            "xAxes": [{
+            "x": {
                 "beginAtZero": true
-            }]
+            }
         }
     }
 }
index 665513dae2d78e391a1ef84ab9aaca5a939a99f5..cda304b27e18fe400cfc578aac8f393874df7977 100644 (file)
@@ -211,9 +211,9 @@ var stackedLine = new Chart(ctx, {
     data: data,
     options: {
         scales: {
-            yAxes: [{
+            y{
                 stacked: true
-            }]
+            }
         }
     }
 });
index 96f541672ae2990f18705b8343ef1a49b9501803..1bdf1fd647829d92de556c9c605674f972502777 100644 (file)
@@ -61,9 +61,9 @@ At this point we have a chart rendering how we'd like. It's important to note th
     },
     "options": {
         "scales": {
-            "yAxes": [{
+            "y": {
                 "beginAtZero": true
-            }]
+            }
         }
     }
 }
index 8fc7726d3d8eace68a0026e312c8bd18e33e0c6e..bc6eefb963cc62731e2e8903355077ae88aa8433 100644 (file)
@@ -22,10 +22,10 @@ var scatterChart = new Chart(ctx, {
     },
     options: {
         scales: {
-            xAxes: [{
+            x{
                 type: 'linear',
                 position: 'bottom'
-            }]
+            }
         }
     }
 });
index 4b919815c960f5d82c6b4f4232ce5deece1cf891..86b8dc617f108964de6f0fe65156f952b5894716 100644 (file)
@@ -24,9 +24,9 @@ var lineChart = new Chart(ctx, {
     type: 'line',
     options: {
         scales: {
-            yAxes: [{
+            y{
                 type: 'myScale' // this is the same key that was passed to the registerScaleType function
-            }]
+            }
         }
     }
 });
index f515a3a3f643567e9a53d7fa7e8a2fb4708209af..e50b26004a5e252379113ea9b9fe0d99127de3aa 100644 (file)
@@ -45,12 +45,12 @@ function updateConfigAsNewObject(chart) {
             text: 'Chart.js'
         },
         scales: {
-            xAxes: [{
+            x{
                 display: true
-            }],
-            yAxes: [{
+            },
+            y{
                 display: true
-            }]
+            }
         }
     };
     chart.update();
@@ -64,30 +64,29 @@ Variables referencing any one from `chart.scales` would be lost after updating s
 
 ```javascript
 function updateScales(chart) {
-    var xScale = chart.scales['x-axis-0'];
-    var yScale = chart.scales['y-axis-0'];
+    var xScale = chart.scales.x;
+    var yScale = chart.scales.y;
     chart.options.scales = {
-        xAxes: [{
-            id: 'newId',
+        newId: {
             display: true
-        }],
-        yAxes: [{
+        },
+        y{
             display: true,
             type: 'logarithmic'
-        }]
+        }
     };
     chart.update();
     // need to update the reference
-    xScale = chart.scales['newId'];
-    yScale = chart.scales['y-axis-0'];
+    xScale = chart.scales.newId;
+    yScale = chart.scales.y;
 }
 ```
 
-You can also update a specific scale either by specifying its index or id.
+You can also update a specific scale either by its id.
 
 ```javascript
 function updateScale(chart) {
-    chart.options.scales.yAxes[0] = {
+    chart.options.scales.y = {
         type: 'logarithmic'
     };
     chart.update();
index 5b6311d91d601b6f739611326eba3ce4a0da8307..6da1290ca347ba1dbd9d57363371b1c1df900156 100644 (file)
@@ -53,9 +53,9 @@ var myChart = new Chart(ctx, {
     },
     options: {
         scales: {
-            yAxes: [{
+            y{
                 beginAtZero: true
-            }]
+            }
         }
     }
 });
index 62c66750b2b1502c372e0f8a847fee8e0f51860c..1ce1f146c67f6c1b487e6b2d2361471c1a079d85 100644 (file)
@@ -33,20 +33,21 @@ Chart.js 3.0 introduces a number of breaking changes. Chart.js 2.0 was released
 ### Options
 
 * The dataset option `tension` was renamed to `lineTension`
+* `scales.[x/y]Axes` arrays were removed. Scales are now configured directly to `options.scales` object with the object key being the scale Id.
 * `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.ticks.beginAtZero` was renamed to `scales.[x/y]Axes.beginAtZero`
-* `scales.[x/y]Axes.ticks.max` was renamed to `scales.[x/y]Axes.max`
-* `scales.[x/y]Axes.ticks.min` was renamed to `scales.[x/y]Axes.min`
-* `scales.[x/y]Axes.ticks.reverse` was renamed to `scales.[x/y]Axes.reverse`
-* `scales.[x/y]Axes.ticks.suggestedMax` was renamed to `scales.[x/y]Axes.suggestedMax`
-* `scales.[x/y]Axes.ticks.suggestedMin` was renamed to `scales.[x/y]Axes.suggestedMin`
-* `scales.[x/y]Axes.time.format` was renamed to `scales.[x/y]Axes.time.parser`
-* `scales.[x/y]Axes.time.max` was renamed to `scales.[x/y]Axes.max`
-* `scales.[x/y]Axes.time.min` was renamed to `scales.[x/y]Axes.min`
+* `scales.[x/y]Axes.ticks.beginAtZero` was renamed to `scales[id].beginAtZero`
+* `scales.[x/y]Axes.ticks.max` was renamed to `scales[id].max`
+* `scales.[x/y]Axes.ticks.min` was renamed to `scales[id].min`
+* `scales.[x/y]Axes.ticks.reverse` was renamed to `scales[id].reverse`
+* `scales.[x/y]Axes.ticks.suggestedMax` was renamed to `scales[id].suggestedMax`
+* `scales.[x/y]Axes.ticks.suggestedMin` was renamed to `scales[id].suggestedMin`
+* `scales.[x/y]Axes.time.format` was renamed to `scales[id].time.parser`
+* `scales.[x/y]Axes.time.max` was renamed to `scales[id].max`
+* `scales.[x/y]Axes.time.min` was renamed to `scales[id].min`
 
 ## Developer migration
 
index 928fd378f5a0b3d8cde87be5b6e94b3acaddadef..a8c376c24a8954533571dadfafd3eb9a925ff904 100644 (file)
                                }
                        },
                        scales: {
-                               xAxes: [{
+                               x{
                                        ticks: {
                                                autoSkip: false,
                                                maxRotation: 0
                                        }
-                               }]
+                               }
                        }
                };
 
index 3796459d2ab2b2b790d9cd97e365620d993cfd88..7e89883c3b17a1dbd441e528ff5a4b2f45d2fa4e 100644 (file)
                                }
                        },
                        scales: {
-                               yAxes: [{
-                                       stacked: true
-                               }]
+                               y{
+                                       stacked: true,
+                               }
                        },
                        plugins: {
                                filler: {
index 50ad6c98acbc6919a5f85fd636309ae8e05ff392..75b4f07f2ed512d0fb7f3bca8cb9d0a20256bfc6 100644 (file)
                                        mode: 'index'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Month'
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                stacked: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Value'
                                                }
-                                       }]
+                                       }
                                }
                        }
                };
index 34cb75fbdc63b58d7510f7a59904ccf393e668c6..3240542569994278b7eccc2515bbc8d9fd0bb73f 100644 (file)
@@ -33,7 +33,7 @@
                                        window.chartColors.purple,
                                        window.chartColors.red
                                ],
-                               yAxisID: 'y-axis-1',
+                               yAxisID: 'y',
                                data: [
                                        randomScalingFactor(),
                                        randomScalingFactor(),
@@ -46,7 +46,7 @@
                        }, {
                                label: 'Dataset 2',
                                backgroundColor: window.chartColors.grey,
-                               yAxisID: 'y-axis-2',
+                               yAxisID: 'y1',
                                data: [
                                        randomScalingFactor(),
                                        randomScalingFactor(),
                                                intersect: true
                                        },
                                        scales: {
-                                               yAxes: [{
-                                                       type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
+                                               y{
+                                                       type: 'linear',
                                                        display: true,
                                                        position: 'left',
-                                                       id: 'y-axis-1',
-                                               }, {
-                                                       type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
+                                               },
+                                               y1: {
+                                                       type: 'linear',
                                                        display: true,
                                                        position: 'right',
-                                                       id: 'y-axis-2',
                                                        gridLines: {
                                                                drawOnChartArea: false
                                                        }
-                                               }],
+                                               },
                                        }
                                }
                        });
index 3981bd488b2186b14ffa4742e2c20cca547230ec..51605c7e692772ef5ec7314b0bf831eea9e78a0c 100644 (file)
                                        },
                                        responsive: true,
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: true,
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: true
-                                               }]
+                                               }
                                        }
                                }
                        });
index b03bc915c047f312b1075d544b6adf94ebe1219d..e29994bf3045c5474aa340078123a813217c46a1 100644 (file)
                                        },
                                        responsive: true,
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: true,
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: true
-                                               }]
+                                               }
                                        }
                                }
                        });
index b76bdaf962e3a386ce83f6dc2faac33b21489b55..6cd64c3c185ce83e132d2c92485a1878e65fa128 100644 (file)
                                        intersect: true
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Month'
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Value'
                                                }
-                                       }]
+                                       }
                                }
                        }
                };
index fa5717dbf64c26574ad096eddf9a0b95e0fd1f4e..f67c71ad547c6cecb24a0fd134ae628e0ab5ba57 100644 (file)
                                        mode: 'index'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
                                                scaleLabel: {
                                                        display: true
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Value'
                                                },
                                                suggestedMin: -10,
-                                               suggestedMax: 200,
-                                       }]
+                                               suggestedMax: 200
+                                       }
                                }
                        }
                };
index cfd6279c6e7231b8d62d7df3242429e55ce4c250..4edff1b0f84dae9f57b0d9af08dbc94120309f0e 100644 (file)
                                        intersect: true
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Month'
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Value'
                                                }
-                                       }]
+                                       }
                                }
                        }
                };
index 8e91547931b11678413382f3eb0a917528e3a732..a32e260121c6e86571382d2341d74cde705cb934 100644 (file)
@@ -36,7 +36,7 @@
                                        randomScalingFactor(),
                                        randomScalingFactor()
                                ],
-                               yAxisID: 'y-axis-1',
+                               yAxisID: 'y',
                        }, {
                                label: 'My Second dataset',
                                borderColor: window.chartColors.blue,
@@ -51,7 +51,7 @@
                                        randomScalingFactor(),
                                        randomScalingFactor()
                                ],
-                               yAxisID: 'y-axis-2'
+                               yAxisID: 'y1'
                        }]
                };
 
                                                text: 'Chart.js Line Chart - Multi Axis'
                                        },
                                        scales: {
-                                               yAxes: [{
+                                               y{
                                                        type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
                                                        display: true,
                                                        position: 'left',
-                                                       id: 'y-axis-1',
-                                               }, {
+                                               },
+                                               y1: {
                                                        type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
                                                        display: true,
                                                        position: 'right',
-                                                       id: 'y-axis-2',
 
                                                        // grid line settings
                                                        gridLines: {
                                                                drawOnChartArea: false, // only want the grid lines for one axis to show up
                                                        },
-                                               }],
+                                               },
                                        }
                                }
                        });
index 3ba1b9dd2d0f916bc31a21cc9873925855306b90..5d28e248b808aa7ea8fc6357dfef247f80848d6b 100644 (file)
                                        mode: 'index'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Month'
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Value'
                                                }
-                                       }]
+                                       }
                                },
                                title: {
                                        display: true,
index 07fb8b01279d68056616cc9079d50a503b50b15b..371220be098b3a4d76b43c284ce163257d808e31 100644 (file)
                                        mode: 'index'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Month'
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Value'
                                                },
-                                       }]
+                                       }
                                }
                        }
                };
index 5536256062402c3cc48ac8836a911581330056d0..957bf28f72247997df80ba93376288c6a0d8b3ca 100644 (file)
@@ -24,8 +24,8 @@
        var scatterChartData = {
                datasets: [{
                        label: 'My First dataset',
-                       xAxisID: 'x-axis-1',
-                       yAxisID: 'y-axis-1',
+                       xAxisID: 'x',
+                       yAxisID: 'y',
                        borderColor: window.chartColors.red,
                        backgroundColor: color(window.chartColors.red).alpha(0.2).rgbString(),
                        data: [{
@@ -52,8 +52,8 @@
                        }]
                }, {
                        label: 'My Second dataset',
-                       xAxisID: 'x-axis-1',
-                       yAxisID: 'y-axis-2',
+                       xAxisID: 'x',
+                       yAxisID: 'y2',
                        borderColor: window.chartColors.blue,
                        backgroundColor: color(window.chartColors.blue).alpha(0.2).rgbString(),
                        data: [{
                                        text: 'Chart.js Scatter Chart - Multi Axis'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                position: 'bottom',
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
                                                display: true,
-                                               position: 'left',
-                                               id: 'y-axis-1',
-                                       }, {
+                                               position: 'left'
+                                       },
+                                       y2: {
                                                type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
                                                display: true,
                                                position: 'right',
                                                reverse: true,
-                                               id: 'y-axis-2',
 
                                                // grid line settings
                                                gridLines: {
                                                        drawOnChartArea: false, // only want the grid lines for one axis to show up
-                                               },
-                                       }],
+                                               }
+                                       }
                                }
                        }
                });
index aa71857489e6fc562066094d1584c8417d63d43d..6d241e150c47bbf2f7efb4e0d1fb44d7ee5c8e3c 100644 (file)
                                        text: 'Chart.js Line Chart'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Month'
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Value'
                                                }
-                                       }]
+                                       }
                                }
                        }
                };
index 40c5cdbfd1256273bb956b7d0075d15ad932e5fd..46f53344e3f9fae03dea270cd33288bbb9002d14 100644 (file)
                                                }
                                        },
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        display: true,
                                                        scaleLabel: {
                                                                display: true,
                                                                labelString: 'Month'
                                                        }
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        display: true,
                                                        scaleLabel: {
                                                                display: true,
                                                                labelString: 'Value'
                                                        }
-                                               }]
+                                               }
                                        },
                                        title: {
                                                display: true,
index f2f7f37fbc3023898e2301b3c19e43f243fb5da7..f45af44ab97eabd30d7a0fa201e206c5f00792c2 100644 (file)
                                                position: legendPosition,
                                        },
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        display: true,
                                                        scaleLabel: {
                                                                display: true,
                                                                labelString: 'Month'
                                                        }
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        display: true,
                                                        scaleLabel: {
                                                                display: true,
                                                                labelString: 'Value'
                                                        }
-                                               }]
+                                               }
                                        },
                                        title: {
                                                display: true,
index 1702c5ecb0f6ad6309249c5e74753b9e624d152c..ab60c4de18746d311c9c27c839b5bf7acbaf6b54 100644 (file)
@@ -64,7 +64,7 @@
                                        text: 'Chart.js Line Chart - X-Axis Filter'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
                                                ticks: {
                                                        callback: function(dataLabel, index) {
                                                                return index % 2 === 0 ? dataLabel : '';
                                                        }
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                beginAtZero: false
-                                       }]
+                                       }
                                }
                        }
                };
index 2569a1e795e229555def7d2099513a5307e418da..0b38c700681937ca5f7fe2ee83f8e726c7a099c7 100644 (file)
                                                text: title
                                        },
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        gridLines: gridlines
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        gridLines: gridlines,
                                                        min: 0,
                                                        max: 100,
                                                        ticks: {
                                                                stepSize: 10
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        };
index 9dabae29322f974a5f8e741982548ab49b34c66e..86101976c623d605a028eb25c009f0de7aee2944 100644 (file)
@@ -44,7 +44,7 @@
                                        text: 'Grid Line Settings'
                                },
                                scales: {
-                                       yAxes: [{
+                                       y{
                                                gridLines: {
                                                        drawBorder: false,
                                                        color: ['pink', 'red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'purple']
@@ -54,7 +54,7 @@
                                                ticks: {
                                                        stepSize: 10
                                                }
-                                       }]
+                                       }
                                }
                        }
                };
index 81512ca926dbe0823e729beeda0b63d561389f46..11084c2dc53b7cf0aefece01aee20b30bdf81514 100644 (file)
                                        text: 'Min and Max Settings'
                                },
                                scales: {
-                                       yAxes: [{
+                                       y{
                                                // the data minimum used for determining the ticks is Math.min(dataMin, suggestedMin)
                                                suggestedMin: 10,
 
                                                // the data maximum used for determining the ticks is Math.max(dataMax, suggestedMax)
                                                suggestedMax: 50
-                                       }]
+                                       }
                                }
                        }
                };
index 5a8981017a422a4136303eed695cbc7e133aad60..9804aec7361b203b05f2f5030ecc737e110bf53d 100644 (file)
                                        text: 'Min and Max Settings'
                                },
                                scales: {
-                                       yAxes: [{
+                                       y{
                                                min: 10,
                                                max: 50
-                                       }]
+                                       }
                                }
                        }
                };
index ac667cc0486ee03d46eb69eb7ec013f657e6822a..bb6355e637f028ab83f054a23e8d8c9f6ed20fff 100644 (file)
                                        intersect: true
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Month'
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        // forces step size to be 5 units
                                                        stepSize: 5
                                                }
-                                       }]
+                                       }
                                }
                        }
                };
index 6a82ae47e66ce3820fa319a95bbed23bc5eb7867..4c69502657c3d217189c6cba53d63b0ae5a4ea97 100644 (file)
                                text: 'Chart.js Line Chart - Logarithmic'
                        },
                        scales: {
-                               xAxes: [{
+                               x{
                                        display: true,
-                               }],
-                               yAxes: [{
+                               },
+                               y{
                                        display: true,
                                        type: 'logarithmic',
-                               }]
+                               }
                        }
                }
        };
index 6374b97c1a13618f80bde6028165fba1e79ee798..0360b3362ce3642964c49a3a20e49e97f6309497 100644 (file)
                                        text: 'Chart.js Scatter Chart - Logarithmic X-Axis'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'logarithmic',
                                                position: 'bottom',
                                                ticks: {
                                                        labelString: 'Frequency',
                                                        display: true,
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                ticks: {
                                                        userCallback: function(tick) {
                                                        labelString: 'Voltage',
                                                        display: true
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
index 09c9a61ca2128e11dade3fc90e5b6edfdfa26540..4cfce9a8ee6afeabdcca51b669cc884c61903efe 100644 (file)
                                        text: 'Chart with Non Numeric Y Axis'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'Month'
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'category',
                                                position: 'left',
                                                display: true,
@@ -55,7 +55,7 @@
                                                        labelString: 'Request State'
                                                },
                                                reverse: true
-                                       }]
+                                       }
                                }
                        }
                };
index 01c38c93a4759fd1794597f119ff04c1ba9c5a69..ee7c9ead4de0255b40053626670731fab2a62061 100644 (file)
                                        text: 'Chart.js Combo Time Scale'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'time',
                                                display: true,
                                                offset: true,
                                                time: {
                                                        unit: 'day'
                                                }
-                                       }],
+                                       },
                                },
                        }
                };
index 87ba2b669b778137e7ccaec5296ff8f1eaeb7298..a441bbb6590b8c831c5af453ed46bce5e8a21ee8 100644 (file)
                                        duration: 0
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'time',
                                                distribution: 'series',
                                                offset: true,
                                                                lastMajor = currMajor;
                                                        }
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y: {
+                                               type: 'linear',
                                                gridLines: {
                                                        drawBorder: false
                                                },
                                                        display: true,
                                                        labelString: 'Closing price ($)'
                                                }
-                                       }]
+                                       }
                                },
                                tooltips: {
                                        intersect: false,
index 3352389c4e6b6547ed290a0c855a3a058af6ee25..922e9e42498f9adced93d499b7de31ee4249d2d6 100644 (file)
@@ -82,7 +82,7 @@
                                        text: 'Chart.js Time Point Data'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'time',
                                                display: true,
                                                scaleLabel: {
                                                                fontColor: '#FF0000'
                                                        }
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'value'
                                                }
-                                       }]
+                                       }
                                }
                        }
                };
index 20651a223953163bb94cd01cae9a11376d9e0dc3..49dba9521cb03af31a3fd7a4d405676881607801 100644 (file)
                                        text: 'Chart.js Time Scale'
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'time',
                                                time: {
                                                        parser: timeFormat,
                                                        display: true,
                                                        labelString: 'Date'
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                scaleLabel: {
                                                        display: true,
                                                        labelString: 'value'
                                                }
-                                       }]
+                                       }
                                },
                        }
                };
index a35cffd7309074145903c86014f3cb7920bade21..6a34af4326df4feba6c2f4693c51f1be2bd632a1 100644 (file)
                                        text: 'Chart.js Line Chart - ' + type
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                type: type
-                                       }]
+                                       }
                                }
                        }
                };
@@ -86,7 +86,7 @@
                document.getElementById('toggleScale').addEventListener('click', function() {
                        type = type === 'linear' ? 'logarithmic' : 'linear';
                        window.myLine.options.title.text = 'Chart.js Line Chart - ' + type;
-                       window.myLine.options.scales.yAxes[0] = {
+                       window.myLine.options.scales.y = {
                                display: true,
                                type: type
                        };
index 2cf5956323aa49213402ff18e9a93fd9f5d40453..07b1e11b9884f533e8088cb6656cf4c2fec1b876 100644 (file)
                                        intersect: true
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: true,
                                                scaleLabel: {
                                                        show: true,
                                                        labelString: 'Month'
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: true,
                                                scaleLabel: {
                                                        show: true,
                                                        labelString: 'Value'
                                                }
-                                       }]
+                                       }
                                }
                        }
                };
index c368b2d1bdbb17681599ba51893a7c53cf47151b..62b8ee0f6811f537dedcaf01b74ba5eb454a0e9a 100644 (file)
@@ -13,17 +13,16 @@ defaults._set('bar', {
        },
 
        scales: {
-               xAxes: [{
+               x{
                        type: 'category',
                        offset: true,
                        gridLines: {
                                offsetGridLines: true
                        }
-               }],
-
-               yAxes: [{
-                       type: 'linear'
-               }]
+               },
+               y: {
+                       type: 'linear',
+               }
        }
 });
 
@@ -221,13 +220,13 @@ module.exports = DatasetController.extend({
        _parseObjectData: function(meta, data, start, count) {
                const iScale = meta.iScale;
                const vScale = meta.vScale;
-               const vProp = vScale._getAxis();
+               const vProp = vScale.axis;
                const parsed = [];
                let i, ilen, item, obj, value;
                for (i = start, ilen = start + count; i < ilen; ++i) {
                        obj = data[i];
                        item = {};
-                       item[iScale.id] = iScale._parseObject(obj, iScale._getAxis(), i);
+                       item[iScale.id] = iScale._parseObject(obj, iScale.axis, i);
                        value = obj[vProp];
                        if (helpers.isArray(value)) {
                                parseFloatBar(value, item, vScale, i);
index 2809e84b482bd847911f7c84f296aeec1805297e..cca5e302c2a07cc7202fa436b8ad11b931199788 100644 (file)
@@ -10,16 +10,14 @@ var resolve = helpers.options.resolve;
 
 defaults._set('bubble', {
        scales: {
-               xAxes: [{
-                       type: 'linear', // bubble should probably use a linear scale by default
-                       position: 'bottom',
-                       id: 'x-axis-0' // need an ID so datasets can reference the scale
-               }],
-               yAxes: [{
+               x: {
                        type: 'linear',
-                       position: 'left',
-                       id: 'y-axis-0'
-               }]
+                       position: 'bottom'
+               },
+               y: {
+                       type: 'linear',
+                       position: 'left'
+               }
        },
 
        tooltips: {
index 6ee66000d0f96bcecf8c968312781cc001d289c8..7468c0922928407cd41153fbd6c0d3303a610db2 100644 (file)
@@ -10,19 +10,18 @@ defaults._set('horizontalBar', {
        },
 
        scales: {
-               xAxes: [{
+               x{
                        type: 'linear',
                        position: 'bottom'
-               }],
-
-               yAxes: [{
+               },
+               y: {
                        type: 'category',
                        position: 'left',
                        offset: true,
                        gridLines: {
                                offsetGridLines: true
                        }
-               }]
+               }
        },
 
        elements: {
index f9283974204e7d4adc63ae97980209e3f28191df..1b553b7f345b36e7b84aafaa585daddb7a6b655b 100644 (file)
@@ -18,14 +18,12 @@ defaults._set('line', {
        },
 
        scales: {
-               xAxes: [{
+               x{
                        type: 'category',
-                       id: 'x-axis-0'
-               }],
-               yAxes: [{
+               },
+               y: {
                        type: 'linear',
-                       id: 'y-axis-0'
-               }]
+               },
        }
 });
 
index d22893d5b188b2ff026818c470c9fbb6ff1720c1..c31663492d172557e386bf791d0e68110f0ea452 100644 (file)
@@ -8,17 +8,19 @@ var helpers = require('../helpers/index');
 var resolve = helpers.options.resolve;
 
 defaults._set('polarArea', {
-       scale: {
-               type: 'radialLinear',
-               angleLines: {
-                       display: false
-               },
-               beginAtZero: true,
-               gridLines: {
-                       circular: true
-               },
-               pointLabels: {
-                       display: false
+       scales: {
+               r: {
+                       type: 'radialLinear',
+                       angleLines: {
+                               display: false
+                       },
+                       beginAtZero: true,
+                       gridLines: {
+                               circular: true
+                       },
+                       pointLabels: {
+                               display: false
+                       }
                }
        },
 
@@ -123,14 +125,14 @@ module.exports = DatasetController.extend({
         * @private
         */
        _getIndexScaleId: function() {
-               return this.chart.scale.id;
+               return this._cachedMeta.rAxisID;
        },
 
        /**
         * @private
         */
        _getValueScaleId: function() {
-               return this.chart.scale.id;
+               return this._cachedMeta.rAxisID;
        },
 
        update: function(reset) {
@@ -181,7 +183,7 @@ module.exports = DatasetController.extend({
                const dataset = me.getDataset();
                const opts = chart.options;
                const animationOpts = opts.animation;
-               const scale = chart.scale;
+               const scale = chart.scales.r;
                const centerX = scale.xCenter;
                const centerY = scale.yCenter;
                var i;
index 6ae47923deba76a883b1329a348d5cbba800c892..6897827075b1fcd332d35c8feb50d408334e5928 100644 (file)
@@ -9,8 +9,10 @@ var valueOrDefault = helpers.valueOrDefault;
 
 defaults._set('radar', {
        spanGaps: false,
-       scale: {
-               type: 'radialLinear'
+       scales: {
+               r: {
+                       type: 'radialLinear',
+               }
        },
        elements: {
                line: {
@@ -67,14 +69,14 @@ module.exports = DatasetController.extend({
         * @private
         */
        _getIndexScaleId: function() {
-               return this.chart.scale.id;
+               return this._cachedMeta.rAxisID;
        },
 
        /**
         * @private
         */
        _getValueScaleId: function() {
-               return this.chart.scale.id;
+               return this._cachedMeta.rAxisID;
        },
 
        /**
@@ -122,7 +124,7 @@ module.exports = DatasetController.extend({
        updateElements: function(points, start, count, reset) {
                const me = this;
                const dataset = me.getDataset();
-               const scale = me.chart.scale;
+               const scale = me.chart.scales.r;
                var i;
 
                for (i = start; i < start + count; i++) {
index c7b107d46a9cba80a58d4a913fff987fb25db0de..3ec0af4d816c7a9121e924cd5f9d6594fc1e20ff 100644 (file)
@@ -5,16 +5,14 @@ var defaults = require('../core/core.defaults');
 
 defaults._set('scatter', {
        scales: {
-               xAxes: [{
-                       id: 'x-axis-1',    // need an ID so datasets can reference the scale
-                       type: 'linear',    // scatter should not use a category axis
+               x: {
+                       type: 'linear',
                        position: 'bottom'
-               }],
-               yAxes: [{
-                       id: 'y-axis-1',
+               },
+               y: {
                        type: 'linear',
                        position: 'left'
-               }]
+               }
        },
 
        tooltips: {
index dd42021629f92652e94d0ed320bb6616db0d4f48..5fadf0fde1d2e365435ce20ac4d6553b5c8f7b99 100644 (file)
@@ -35,44 +35,46 @@ defaults._set('global', {
        responsiveAnimationDuration: 0
 });
 
-/**
- * Recursively merge the given config objects representing the `scales` option
- * by incorporating scale defaults in `xAxes` and `yAxes` array items, then
- * returns a deep copy of the result, thus doesn't alter inputs.
- */
-function mergeScaleConfig(/* config objects ... */) {
-       return helpers.merge({}, [].slice.call(arguments), {
-               merger: function(key, target, source, options) {
-                       if (key === 'xAxes' || key === 'yAxes') {
-                               var slen = source[key].length;
-                               var i, type, scale;
+function mergeScaleConfig(config, options) {
+       options = options || {};
+       const chartDefaults = defaults[config.type] || {scales: {}};
+       const configScales = options.scales || {};
+       const firstIDs = {};
+       const scales = {};
+
+       // First figure out first scale id's per axis.
+       // Note: for now, axis is determined from first letter of scale id!
+       Object.entries(configScales).forEach(([id, scale]) => {
+               const axis = id[0];
+               firstIDs[axis] = firstIDs[axis] || id;
+               scales[id] = helpers.mergeIf({}, [scale, chartDefaults.scales[axis]]);
+       });
 
-                               if (!target[key]) {
-                                       target[key] = [];
-                               }
+       // Backward compatibility
+       if (options.scale) {
+               scales[options.scale.id || 'r'] = helpers.mergeIf({}, [options.scale, chartDefaults.scales.r]);
+               firstIDs.r = firstIDs.r || options.scale.id || 'r';
+       }
 
-                               for (i = 0; i < slen; ++i) {
-                                       scale = source[key][i];
-                                       type = valueOrDefault(scale.type, key === 'xAxes' ? 'category' : 'linear');
-
-                                       if (i >= target[key].length) {
-                                               target[key].push({});
-                                       }
-
-                                       if (!target[key][i].type || (scale.type && scale.type !== target[key][i].type)) {
-                                               // new/untyped scale or type changed: let's apply the new defaults
-                                               // then merge source scale to correctly overwrite the defaults.
-                                               helpers.merge(target[key][i], [scaleService.getScaleDefaults(type), scale]);
-                                       } else {
-                                               // scales type are the same
-                                               helpers.merge(target[key][i], scale);
-                                       }
-                               }
-                       } else {
-                               helpers._merger(key, target, source, options);
-                       }
-               }
+       // Then merge dataset defaults to scale configs
+       config.data.datasets.forEach(dataset => {
+               const datasetDefaults = defaults[dataset.type || config.type] || {scales: {}};
+               Object.entries(datasetDefaults.scales || {}).forEach(([defaultID, defaultScaleOptions]) => {
+                       const id = dataset[defaultID + 'AxisID'] || firstIDs[defaultID] || defaultID;
+                       scales[id] = scales[id] || {};
+                       helpers.mergeIf(scales[id], [
+                               configScales[id],
+                               defaultScaleOptions
+                       ]);
+               });
        });
+
+       // apply scale defaults, if not overridden by dataset defaults
+       Object.values(scales).forEach(scale => {
+               helpers.mergeIf(scale, scaleService.getScaleDefaults(scale.type));
+       });
+
+       return scales;
 }
 
 /**
@@ -83,16 +85,7 @@ function mergeScaleConfig(/* config objects ... */) {
 function mergeConfig(/* config objects ... */) {
        return helpers.merge({}, [].slice.call(arguments), {
                merger: function(key, target, source, options) {
-                       var tval = target[key] || {};
-                       var sval = source[key];
-
-                       if (key === 'scales') {
-                               // scale config merging is complex. Add our own function here for that
-                               target[key] = mergeScaleConfig(tval, sval);
-                       } else if (key === 'scale') {
-                               // used in polar area & radar charts since there is only one scale
-                               target[key] = helpers.merge(tval, [scaleService.getScaleDefaults(sval.type), sval]);
-                       } else {
+                       if (key !== 'scales' && key !== 'scale') {
                                helpers._merger(key, target, source, options);
                        }
                }
@@ -104,15 +97,19 @@ function initConfig(config) {
 
        // Do NOT use mergeConfig for the data object because this method merges arrays
        // and so would change references to labels and datasets, preventing data updates.
-       var data = config.data = config.data || {};
+       const data = config.data = config.data || {};
        data.datasets = data.datasets || [];
        data.labels = data.labels || [];
 
+       const scaleConfig = mergeScaleConfig(config, config.options);
+
        config.options = mergeConfig(
                defaults.global,
                defaults[config.type],
                config.options || {});
 
+       config.options.scales = scaleConfig;
+
        return config;
 }
 
@@ -131,12 +128,16 @@ function updateConfig(chart) {
                layouts.removeBox(chart, scale);
        });
 
+       const scaleConfig = mergeScaleConfig(chart.config, newOptions);
+
        newOptions = mergeConfig(
                defaults.global,
                defaults[chart.config.type],
                newOptions);
 
        chart.options = chart.config.options = newOptions;
+       chart.options.scales = scaleConfig;
+
        chart._animationsDisabled = isAnimationDisabled(newOptions);
        chart.ensureScalesHaveIDs();
        chart.buildOrUpdateScales();
@@ -146,19 +147,6 @@ function updateConfig(chart) {
        chart.tooltip.initialize();
 }
 
-function nextAvailableScaleId(axesOpts, prefix, index) {
-       var id;
-       var hasId = function(obj) {
-               return obj.id === id;
-       };
-
-       do {
-               id = prefix + index++;
-       } while (helpers.findIndex(axesOpts, hasId) >= 0);
-
-       return id;
-}
-
 function positionIsHorizontal(position) {
        return position === 'top' || position === 'bottom';
 }
@@ -310,16 +298,8 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
                var scalesOptions = options.scales || {};
                var scaleOptions = options.scale;
 
-               helpers.each(scalesOptions.xAxes, function(xAxisOptions, index) {
-                       if (!xAxisOptions.id) {
-                               xAxisOptions.id = nextAvailableScaleId(scalesOptions.xAxes, 'x-axis-', index);
-                       }
-               });
-
-               helpers.each(scalesOptions.yAxes, function(yAxisOptions, index) {
-                       if (!yAxisOptions.id) {
-                               yAxisOptions.id = nextAvailableScaleId(scalesOptions.yAxes, 'y-axis-', index);
-                       }
+               helpers.each(scalesOptions, function(axisOptions, axisID) {
+                       axisOptions.id = axisID;
                });
 
                if (scaleOptions) {
@@ -342,24 +322,20 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
 
                if (options.scales) {
                        items = items.concat(
-                               (options.scales.xAxes || []).map(function(xAxisOptions) {
-                                       return {options: xAxisOptions, dtype: 'category', dposition: 'bottom'};
-                               }),
-                               (options.scales.yAxes || []).map(function(yAxisOptions) {
-                                       return {options: yAxisOptions, dtype: 'linear', dposition: 'left'};
+                               Object.entries(options.scales).map(function(entry) {
+                                       var axisID = entry[0];
+                                       var axisOptions = entry[1];
+                                       var isRadial = axisID.charAt(0).toLowerCase === 'r';
+                                       var isHorizontal = axisID.charAt(0).toLowerCase() === 'x';
+                                       return {
+                                               options: axisOptions,
+                                               dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',
+                                               dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'
+                                       };
                                })
                        );
                }
 
-               if (options.scale) {
-                       items.push({
-                               options: options.scale,
-                               dtype: 'radialLinear',
-                               isDefault: true,
-                               dposition: 'chartArea'
-                       });
-               }
-
                helpers.each(items, function(item) {
                        var scaleOptions = item.options;
                        var id = scaleOptions.id;
@@ -391,6 +367,8 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
                                scales[scale.id] = scale;
                        }
 
+                       scale.axis = scale.options.position === 'chartArea' ? 'r' : scale.isHorizontal() ? 'x' : 'y';
+
                        // parse min/max value, so we can properly determine min/max for other scales
                        scale._userMin = scale._parse(scale.options.min);
                        scale._userMax = scale._parse(scale.options.max);
index e08d2000de9fab38ead3d1f8348e76d293224145..73dac2b3743d35c30003c0ea05d5050d292e66ea 100644 (file)
@@ -175,15 +175,6 @@ function getStackKey(indexScale, valueScale, meta) {
        return indexScale.id + '.' + valueScale.id + '.' + meta.stack + '.' + meta.type;
 }
 
-function getFirstScaleId(chart, axis) {
-       var scalesOpts = chart.options.scales;
-       var scale = chart.options.scale;
-       var scaleId = scale && scale.id;
-       var prop = axis + 'Axes';
-
-       return (scalesOpts && scalesOpts[prop] && scalesOpts[prop].length && scalesOpts[prop][0].id) || scaleId;
-}
-
 function getUserBounds(scale) {
        var {min, max, minDefined, maxDefined} = scale._getUserBounds();
        return {
@@ -230,6 +221,13 @@ function updateStacks(controller, parsed) {
        }
 }
 
+function getFirstScaleId(chart, axis) {
+       const scales = chart.scales;
+       return Object.keys(scales).filter(key => {
+               return scales[key].axis === axis;
+       }).shift();
+}
+
 // Base class for all dataset controllers (line, bar, etc)
 var DatasetController = function(chart, datasetIndex) {
        this.initialize(chart, datasetIndex);
@@ -300,10 +298,13 @@ helpers.extend(DatasetController.prototype, {
                const chart = me.chart;
                const meta = me._cachedMeta;
                const dataset = me.getDataset();
+
                const xid = meta.xAxisID = dataset.xAxisID || getFirstScaleId(chart, 'x');
                const yid = meta.yAxisID = dataset.yAxisID || getFirstScaleId(chart, 'y');
+               const rid = meta.rAxisID = dataset.rAxisID || getFirstScaleId(chart, 'r');
                meta.xScale = me.getScaleForId(xid);
                meta.yScale = me.getScaleForId(yid);
+               meta.rScale = me.getScaleForId(rid);
                meta.iScale = me._getIndexScale();
                meta.vScale = me._getValueScale();
        },
index 414e88b006a440ceb5160d7f6db73c87aa598d02..2157db83cb7e1c84fcd3d2458974dcc697dcb3a7 100644 (file)
@@ -1388,13 +1388,6 @@ class Scale extends Element {
                }];
        }
 
-       /**
-        * @private
-        */
-       _getAxis() {
-               return this.isHorizontal() ? 'x' : 'y';
-       }
-
        /**
         * Returns visible dataset metas that are attached to this scale
         * @param {string} [type] - if specified, also filter by dataset type
@@ -1403,7 +1396,7 @@ class Scale extends Element {
        _getMatchingVisibleMetas(type) {
                var me = this;
                var metas = me.chart._getSortedVisibleDatasetMetas();
-               var axisID = me._getAxis() + 'AxisID';
+               var axisID = me.axis + 'AxisID';
                var result = [];
                var i, ilen, meta;
 
index 7209a104b23875976f7d2f1bb5dafa2ff4163a9a..b2487e35b01faaa5d6284d9b65a35ce88e682a04 100644 (file)
@@ -428,7 +428,7 @@ module.exports = {
                                        visible: chart.isDatasetVisible(i),
                                        fill: decodeFill(el, i, count),
                                        chart: chart,
-                                       scale: meta.controller.getScaleForId(meta.yAxisID) || chart.scale,
+                                       scale: meta.yScale || meta.rScale,
                                        el: el
                                };
                        }
index 781f81b878f000e5a6fbb4d590de51b32a2da2ff..9c8d735fbd6dcf381aea6e7d37782578c82eb28a 100644 (file)
@@ -38,8 +38,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index e7bfe20ad926ec8c4bd785958482bcddeb72f1d1..171e7a63f41796b90e25fc1efd3918a548d46470 100644 (file)
@@ -36,13 +36,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index d82d60d5dfca5e8365c0d8c8438b5909e95b6703..ad004b1690320d8467031adc848f54f1edb501ab 100644 (file)
@@ -24,8 +24,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index ea55d4fab7b777fefeddfe15a8bb9685d19856e1..1a88ddb371121f3bb00816890dcfc8181542cf79 100644 (file)
@@ -16,7 +16,7 @@
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "offset": true,
                     "display": false,
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 46265b3046745702897c141a10677f1dccd6291f..ea5870b4d5d99dc0a79ac49eda771dc5463126a4 100644 (file)
@@ -16,7 +16,7 @@
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "offset": true,
                     "display": false,
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 691b33a621e7bc5af81c50ed2fc00215990d0831..e14aabab6632b93239c06b992a652b3261d825a3 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 5f682066d64f37796fbb6c33cb585177a66977f8..9ae6ceaf5bc1e8044e8d9ca584fb7c75cd1f68d0 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 8e5eebac12b0690aabc7485ff8841046e6ade1bc..5c329302df9bb190d8747335ba73c37bb9c43a2b 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index f9d0e87a2d585d6a5f2120b27ef6d26e613bdc0e..a3e7368877d5f0de2be7aa6c317d6f893f188545 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index e4f9100329a8496f83956c8291afd5e9b590e4fd..d01ae930aa3f6ae8d3a0e9e710f0872a7f4e7897 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 99a609892168dc321c1a9c5f4ed8e09abd2a8c47..7e42b142c7d53973882a22974a7077a3c3d0fac2 100644 (file)
                 }
             },
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 502b02a48af41200486e79b6fe7c481e5c6d995b..1570191beebe529a76d0c910a64493db4de614da 100644 (file)
                 }
             },
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY-MM"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 31b9304c2236aa6fffa72f3d16d0c9381bc0cde6..ce3141ee6b221dce87fd48e4433ff83b8a5eeece 100644 (file)
@@ -25,7 +25,7 @@
                 }
             },
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "offset": true,
                     "display": false,
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index b23ab4936c585b7005114730b0136893552b0abb..21f990a34758580be89d7a2e34320dd6de123109 100644 (file)
@@ -24,7 +24,7 @@
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "offset": true,
                     "stacked": true,
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "stacked": true,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 6884cfa969bbe55f6e6c3b4012c46acd65961cc3..1d27989ed6e2dbf7523f214effeaee16ee15190d 100644 (file)
@@ -19,7 +19,7 @@
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "offset": true,
                     "display": false,
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index bcc52e9874f2d28573414024164d9abfddb13a5f..950f18d2f6be8958d53788e8d0f453cd7ab32305 100644 (file)
                 }
             },
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 10fdfbae7590fb2b97b8ff729039de6f28ee878f..4e1a97ab701aeabcd4be68291b7312df20af78b8 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 9de2600e9904273d81de1d770a1435b95b5b2b79..8155ad8114e31dec117b92f25c66ce9034e0eaef 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index c3970389429c045ee70cc43b3d3ea0879cb74645..a9c24a4980812753af0bfdf9f48dd121a9470568 100644 (file)
                 }
             },
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "time",
                     "stacked": true,
                     "display": false,
+                    "offset": false,
                     "time": {
                         "parser": "YYYY"
                     },
                     "ticks": {
                         "source": "labels"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "stacked": true,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index de39b134ae80084d301f1e1ff49a666521af75d8..7c058f0b40ebebb19a107658e4b6d34a505719a4 100644 (file)
@@ -40,8 +40,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 3a0646e4a72467b9eacfcef1ddb08197f4242dcb..fb54196e5e1ac62b7c485373641183835944b57e 100644 (file)
@@ -38,13 +38,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 4f328b591688930f30974ae116f3fa7192e083a2..d6f67c864d0f815c086385a4b180e45daba063f9 100644 (file)
@@ -26,8 +26,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 405e6da62f147be0536d3ad51e83e271ed4a6dc7..70fdb01abd8664fcccf12a18a9edbe54cfdc1622 100644 (file)
@@ -41,8 +41,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 03a69142e7388d1e3f23e76d68746e514e5cc468..66387faa08a574a3196e8c41385e2030c9d9d36e 100644 (file)
@@ -39,13 +39,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index fed9592636bdef2542109b8422d4d546c4c221b6..5573bdc051139d4c5c156b4ba49ab77e22ad569b 100644 (file)
@@ -42,8 +42,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 97f9af5d46f7d0ab09420036141750cf61c38ebc..74c15502231561618a12181e2f834c41fe8f84cd 100644 (file)
@@ -42,8 +42,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index ddd544ff2012ca58c63e8ec68f3cc56557122662..71101cffb8fd7df6f6cde936d89aab225dd3f4d2 100644 (file)
@@ -40,8 +40,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 5a5189d7fbea63e17dfcd6344f6d51622150d450..6c504719ba17d4afc0ccecddb122f397e68a7d7c 100644 (file)
@@ -35,8 +35,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 9133b30aec50ccd6e8530d1c56919d3d5ce9cfd7..0d6d7fe5307021ec4051df49cf7b1da23ef5c4c1 100644 (file)
@@ -28,8 +28,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 66caf5c2d89160ea313e57aa65981f880b41720b..407c53c09ff0b548ca909750a2048056ee5fcaf4 100644 (file)
@@ -33,13 +33,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 198e92b4c97caad8aff12f3e92e25076ec5a39fc..4f301a04a9e29b2646f0c5c719647dfdcd6e3d2f 100644 (file)
@@ -31,13 +31,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 33cd40f780e489f1794c033e527d3bcebacbbfd8..ee36c86366c77fdf6a5a0cbc6394e74678225b51 100644 (file)
@@ -26,8 +26,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 6985abacd5b44b8c49fd3466805d3ca2b9d0e658..0c1984a41e861c6c3b5432ac8c69c14a59379351 100644 (file)
@@ -28,8 +28,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false, min: -10, max: 10}]
+                               x: {display: false},
+                               y: {display: false, min: -10, max: 10}
                        }
                }
        },
index f5b6ac2256ba289f39ab746ad763356fcc9588c1..368af566023637dabf7291d3d964dbb75c1ec12a 100644 (file)
@@ -18,8 +18,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index bb9f4c52758714065057b6fb57575265fd2418f7..d0e5b18b45345b4152e9e41ce3ffbe666d92582c 100644 (file)
@@ -18,8 +18,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{display: false, min: 0}],
-                               yAxes: [{display: false, stacked: true}]
+                               x: {display: false, min: 0},
+                               y: {display: false, stacked: true}
                        }
                }
        },
index ee3d43915351559bc14473007728be1f6706941f..08868b7d9e2404554935d75f1ec750abe7bc4c71 100644 (file)
@@ -18,8 +18,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{display: false, stacked: true}],
-                               yAxes: [{display: false, min: 0}]
+                               x: {display: false, stacked: true},
+                               y: {display: false, min: 0}
                        }
                }
        },
index 0a5986abbee6b4e90568b781cca1bff7802c7a95..a196596666aebf1437ebe4819e1cde291bd5ff7b 100644 (file)
             "title": false,
             "legend": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false,
                     "min": -8,
                     "max": 12
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             }
         }
     },
index 0715f7f8ab0a950cb4b6b0fcbd5f3765b277c16e..5ca15a95a6d5943a263176b1974a84deb55c7183 100644 (file)
             "title": false,
             "legend": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false,
                     "stacked": true
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "stacked": true,
                     "min": -8,
                     "max": 12
-                }]
+                }
             }
         }
     },
index 8f808cef2d86ba32c99fbca6c694fa5c1b7735b9..5c198bedafcd683f4090a092238e93f136f3c166 100644 (file)
             "title": false,
             "legend": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false,
                     "stacked": true,
                     "min": -8,
                     "max": 12
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "stacked": true
-                }]
+                }
             }
         }
     },
index 76e4d4066fe50d3e007f91c584869d9686575ef9..3ca6763b7906223d2c1a1bd1e9ae50301783bd5f 100644 (file)
             "title": false,
             "legend": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false,
                     "min": -8,
                     "max": 12
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             }
         }
     },
index c1f07126d0c92f90d0da9652e461adaa7ad8585d..66085c7001007c7d5f453051a6c4271cf9898dd5 100644 (file)
@@ -28,8 +28,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 99ac49df242508a80d4171ccb6f9da70d9f5e04c..4a0e13ded81fb5ca91a7e5bc7ad01327180687e8 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false,
                     "stacked": true
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "stacked": true,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 23988211ad58d3fb3d7195fda172c2d1b10c312b..4d7e79518e222bed30369cd22aff2f8bd484c91a 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false,
                     "stacked": true
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false,
                     "stacked": true,
                     "beginAtZero": true
-                }]
+                }
             }
         }
     },
index 1af0dfc849ce604e77ca9771050b86d2d5ed0a32..34972264743786083cc5a69e26d76c5d685d958f 100644 (file)
@@ -14,15 +14,15 @@ module.exports = {
                options: {
                        legend: false,
                        scales: {
-                               xAxes: [{ticks: {display: false}}],
-                               yAxes: [{
+                               x: {ticks: {display: false}},
+                               y{
                                        min: 8,
                                        max: 25,
                                        beginAtZero: true,
                                        ticks: {
                                                display: false
                                        }
-                               }]
+                               }
                        }
                }
        },
index e1af5d550903ecff5efb95654859942a221b8253..37835a283c0c9b60186a3d319261a7f1426f9b79 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{
+                "x": {"display": false},
+                "y": {
                     "display": false,
                     "min": 0,
                     "max": 4
-                }]
+                }
             },
             "elements": {
                 "line": {
index 0c90917fdc3660f2b85377916d34e39ab0753e3f..65f61d771a949322a385198e293afbd917dad8d3 100644 (file)
@@ -21,8 +21,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        },
                        elements: {
                                point: {
index 593316b3c73f093b2e5aa991d6c078a6239ee84e..021b678215d910f9da1cd8c2a46201d2ceceda4d 100644 (file)
@@ -20,8 +20,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        },
                        elements: {
                                point: {
index 3909168a98ec44ae3f8cd927dc74b70c1ecd4f71..ec4c653fbcc7944f857676801da5908664fc8713 100644 (file)
@@ -41,13 +41,11 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 8e632f11c2f6120d0f5c81f0480d4741eaebbdc7..1931c343f7a8c8a0b0b7e0727af598f7bc9b135f 100644 (file)
@@ -30,8 +30,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index c6221948e2dcdf4ce54edb1dc8ce6bf2b60d7b75..49d0f07aebd85cb78e06375322c29882fc7a7c8c 100644 (file)
@@ -47,13 +47,11 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index d428462467f74ce048dfd181e9cda70fc51dbf56..16393fed502f51612c9b72696b6d2df1e3cd85d0 100644 (file)
@@ -38,8 +38,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index d35b4823d314384e5624e5536bf6937d9d7f6cd9..15137ea0258d315a46a985d98cf9afd2e8c5db23 100644 (file)
@@ -44,13 +44,11 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 2b43635490c2af34eda39295bffb55526e0c1527..4dfab4c23c2549baeff40b2630c7158bee5001a8 100644 (file)
@@ -32,8 +32,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index b19f17b794c8868eaeb9b94c1de8c25161a582bc..da003ea910addb5922ad933b19567de9b6e51d03 100644 (file)
@@ -35,13 +35,11 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 3e6404f0d496ff1f8835b5d3a10c36ff4878c08d..d40c87721b31a9777769a630de3f672a61b1e0d2 100644 (file)
@@ -33,8 +33,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 453fdbffe9a81b1515548cda63686d420404f3c2..f3f8ba6e4d999c540ad1ae5752ec6ee0f691057a 100644 (file)
@@ -39,8 +39,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 8cc0808fe5cbe39041561f88405c5a66a22ed552..67f9f65501eb5481da6ae4c37c211f3ed0362d65 100644 (file)
@@ -35,8 +35,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index c694af4c329d9733408badb8f9b8c67ce91ec851..54468482e294781282a859c8a1c999d3f6740d13 100644 (file)
@@ -47,8 +47,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 784800c5994814b858ad33a176dc9f0d063ce2af..b9b8e3533a8eabc8b9aeb19b5446dc73a77f0b57 100644 (file)
@@ -38,8 +38,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index cc959799e7b5822ca9b254e92bd190a2b76bbd5d..244c7d9cd654fd2535e0cdf985768046ab207aaf 100644 (file)
@@ -42,13 +42,11 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 68b16e52e0656606ed90cc556fd9a4ba9106e603..872f8b2510755b142f18b10ad7ccdc1297d41dc2 100644 (file)
@@ -33,8 +33,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 91dc5178e533238c548e7c2ebb5fe2968ef3df83..ea8f541a3b4e0f7b079b0c07ea30c528b791958b 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "max": 3,
                     "ticks": {
                         "display": false
                     }
-                }],
-                "yAxes": [{"ticks": {"display": false}}]
+                },
+                "y": {"ticks": {"display": false}}
             },
             "layout": {
                 "padding": 24
index ae229dba89e3f82b5e897af77d54aba2ef9c3c1f..65d85cc88c1152b3129822b423fc5d96300c5704 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "min": -2,
                     "ticks": {
                         "display": false
                     }
-                }],
-                "yAxes": [{"ticks": {"display": false}}]
+                },
+                "y": {"ticks": {"display": false}}
             },
             "layout": {
                 "padding": 24
index e74f0bc125082cf4c753fadc26c51dc90b829a5a..5a8e2c16ae063b974e350f06e0c4b12a6910d1c5 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "min": -2,
                     "max": 3,
                     "ticks": {
                         "display": false
                     }
-                }],
-                "yAxes": [{"ticks": {"display": false}}]
+                },
+                "y": {"ticks": {"display": false}}
             },
             "layout": {
                 "padding": 24
index 589fc1e716a879733ba2bd846d02ac71ef2fbb32..8fe92a4d61c8c3d6e15f8d8bcdc2f3a0ca1f9c6e 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{"ticks": {"display": false}}],
-                "yAxes": [{
+                "x": {"ticks": {"display": false}},
+                "y": {
                     "max": 6,
                     "ticks": {
                         "display": false
                     }
-                }]
+                }
             },
             "layout": {
                 "padding": 24
index 3085fffa1f0b2bd90030fd8ba0260c1c9090d464..1d7f78363a9e62e3a0156ded7e87c5412423dc9d 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{"ticks": {"display": false}}],
-                "yAxes": [{
+                "x": {"ticks": {"display": false}},
+                "y": {
                     "min": 2,
                     "ticks": {
                         "display": false
                     }
-                }]
+                }
             },
             "layout": {
                 "padding": 24
index 06b63426819ca10438db621165bd962b5a64c208..44034c657da13c5da46283888c5cedabce90c092 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{"ticks": {"display": false}}],
-                "yAxes": [{
+                "x": {"ticks": {"display": false}},
+                "y": {
                     "min": 2,
                     "max": 6,
                     "ticks": {
                         "display": false
                     }
-                }]
+                }
             },
             "layout": {
                 "padding": 24
index 712dc5bf077822a260d4805289ccbf7f5db2d221..2c34d3d0bbc37313104534804c6006b88a523d0a 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "min": -2,
                     "max": 2,
                     "ticks": {
                         "display": false
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "min": -2,
                     "max": 2,
                     "ticks": {
                         "display": false
                     }
-                }]
+                }
             },
             "layout": {
                 "padding": 24
index c1f3eb281b4937d8384dfe07717fa8da40c51d18..39f8ed56f6af59eb8f3e96b6f33e66d020d15849 100644 (file)
@@ -35,8 +35,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 01b49951deba9b24ddaa327ca5f050644525e9e2..6183d4630b4535f1e587e24063e8c03b7089af92 100644 (file)
@@ -31,8 +31,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 5fcade526114e58ce3ddfd2a1b1b7ce2aa057998..93625a508268f213a98d16cb4185e54656608f6f 100644 (file)
@@ -31,8 +31,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 7d76cf43257459ef31500747ceaed9e75ead2036..11b2496d39dc9f840c6a9458a9a2905367d9df73 100644 (file)
@@ -31,8 +31,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 84c93bfd1978badea591839414b1fb4c19a2fa2f..fce9a888d59e321377f10345bb2eaa325a1752c0 100644 (file)
@@ -33,8 +33,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index ca4ec0788edd0f8ca00039e993077a3298867ecd..469c6f42dbaaa218490bf2610fd5e1cda497ea25 100644 (file)
@@ -29,8 +29,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index db5f3c3818096c4319011cc38770054ed9e408cd..c12afdc6599c13cb0b2ce2bb1a84dd006b21ccbd 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{
+                "x": {"display": false},
+                "y": {
                     "type": "category",
                     "display": false
-                }]
+                }
             }
         }
     },
index 7e50e7210964e4f0690c9e219487e95a8bdf1d58..de860cc046653acb7d531a9cba7b291844450b1f 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{
+                "x": {"display": false},
+                "y": {
                     "display": false,
                     "min": 0,
                     "max": 4
-                }]
+                }
             },
             "elements": {
                 "line": {
index 7b939724e6b8da7d25456e73b85bb9ff55d0ce64..dc8ca784c3b649807f16d2e524a42b5a153c7e09 100644 (file)
@@ -42,8 +42,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 5edfbdcd5fe4cb147e218c36210e180adb40a2d0..c265d2d4fb923eed6c32e3b123637bc840f3ae80 100644 (file)
@@ -40,13 +40,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index a096cae00eaafdd275126ef64a0fcf1ea8e1288f..ccf1f22b93a00121a4a796a6e100b9ca5354aed0 100644 (file)
@@ -28,8 +28,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 9a186e950402e5a9c4bd0ac543bd7ba14b66a51b..e2836f9f46cf1316846de58b0c67432197bec824 100644 (file)
@@ -42,8 +42,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 3be7968958dc8aac1a42546665cef78745a77d6b..3d0c917442c52a2bf9b9fa01c1926d9050499bd0 100644 (file)
@@ -40,13 +40,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 84e4d6adfb910af63c9f367bf00c9c56b2554ede..f35162fbb9dba39b4a3dc469ab3bbc33fe279165 100644 (file)
@@ -28,8 +28,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index fad97da1e5cc979bfb33fa26d50bfd52b02e1d0e..6baf54ffd03b019e9fc9e93452339611320de31f 100644 (file)
@@ -34,8 +34,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 01e2967ec5378e404005bb3a1c3ddebcfafabd3e..9e9e1f3b1ae802b37b3a79875dc11c4c6c9cc9ab 100644 (file)
@@ -40,13 +40,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 291f422e527f6c22fe5c857f24acf7a637ea452e..da80f95521061429e0e1852d1d7d8d29fc5b0f54 100644 (file)
@@ -30,8 +30,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 50808708615765c61d2d089ce5395689c5a14ce9..433f0618a35587824680f01981cd293945da34be 100644 (file)
@@ -46,8 +46,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 05f8161d6aa4465df2f6da808e95b28bd1267294..50706e942f672b5c2d53c4aab4670db165458d90 100644 (file)
@@ -44,13 +44,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 3e2f2cf58adf149aa485b2f3cbf80a215703988a..1a408bea09ec1eea438a307e99c851bdbfa59532 100644 (file)
@@ -30,8 +30,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index f2b70d385d8750f8e885842474bbc005e9938a1c..605e19ced58ace6b7974c589ce7cccecb10f0d3d 100644 (file)
@@ -33,8 +33,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 3d1f529074aad1cf0a7ae635e974506011d3d161..eb32bb8fec53e264a90969d9181fa6ef4b0f1917 100644 (file)
@@ -39,13 +39,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index bba6146ec6251333f69801e1004351e308b3f2c0..155b113bcf7e2a71d4b28e6a5b9d61499637032d 100644 (file)
@@ -29,8 +29,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 4aea90a873fb26a1ffaa524edd9238906550584e..4510f3898cf7eaee5dbf34b6eccb11d396de3d36 100644 (file)
@@ -35,8 +35,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index 5d5b009e37041cf97b87fa866e4a2d0fed439243..0ba7e151d1098cf0723ac400f1530dfae94165b6 100644 (file)
@@ -41,13 +41,11 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [
-                                       {
-                                               display: false,
-                                               beginAtZero: true
-                                       }
-                               ]
+                               x: {display: false},
+                               y: {
+                                       display: false,
+                                       beginAtZero: true
+                               }
                        }
                }
        },
index 7cc6e2e5757dac6385fcbe65dd5617730e3aa69c..77b69694200349e1977307fd49292ab18825b9ac 100644 (file)
@@ -31,8 +31,8 @@ module.exports = {
                                }
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index d8b292e956de5fe9ec4133460f29a1503bb64f56..2e2a56ba842811b95abc8c62019bf39d3139408a 100644 (file)
@@ -31,8 +31,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{stacked: true, display: false}],
-                               yAxes: [{stacked: true, display: false}]
+                               x: {stacked: true, display: false},
+                               y: {stacked: true, display: false}
                        }
                }
        },
index 5a95441343da0a01cf78f45845cb02e272a734dc..7c7a2602a48db552e94fda5f47016dced5561e04 100644 (file)
@@ -33,8 +33,8 @@ module.exports = {
                                padding: 32
                        },
                        scales: {
-                               xAxes: [{stacked: true, display: false}],
-                               yAxes: [{stacked: true, display: false}]
+                               x: {stacked: true, display: false},
+                               y: {stacked: true, display: false}
                        }
                }
        },
index dbd979ecd8e762e60abe0d369f9648142b1e4766..5231c6a9fe0c2e2b3b1496ac9bb865274fd7f2c5 100644 (file)
@@ -11,7 +11,7 @@
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "ticks": {
                         "display": false
                     },
@@ -19,8 +19,8 @@
                         "display": false,
                         "drawBorder": false
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "ticks": {
                         "labelOffset": 25
                     },
@@ -28,7 +28,7 @@
                         "display": false,
                         "drawBorder": false
                     }
-                }]
+                }
             }
         }
     },
index d7412edb3970f806cc71a07bec29059a79cd5080..b7f55b1fdf1c219bbe6f2e21af9f7517b891b8ce 100644 (file)
@@ -9,7 +9,7 @@
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "type": "category",
                     "position": "top",
                     "id": "x-axis-1",
                         "drawBorder": false,
                         "color": "rgba(0, 0, 0, 1)"
                     }
-                }, {
+                },
+                "x2": {
                     "type": "category",
                     "position": "bottom",
-                    "id": "x-axis-2",
                     "ticks": {
                         "display": false
                     },
                         "drawBorder": false,
                         "color": "rgba(0, 0, 0, 1)"
                     }
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "position": "left",
                     "id": "y-axis-1",
                     "type": "linear",
+                    "offset": false,
                     "min": -100,
                     "max": 100,
                     "ticks": {
                         "display": false
                     },
                     "gridLines":{
+                        "offsetGridLines": false,
                         "drawOnChartArea": false,
                         "drawBorder": false,
                         "color": "rgba(0, 0, 0, 1)"
                     }
-                }, {
+                },
+                "y2": {
                     "type": "linear",
-                    "id": "y-axis-2",
                     "position": "right",
+                    "offset": false,
                     "min": 0,
                     "max": 50,
                     "ticks": {
                         "display": false
                     },
                     "gridLines":{
+                        "offsetGridLines": false,
                         "drawOnChartArea": false,
                         "drawBorder": false,
                         "color": "rgba(0, 0, 0, 1)"
                     }
-                }]
+                }
             }
         }
     },
index 8b872e75d730f006719309983c6a7d591fa4aa08..fc63d3740aebf71d0fe880feb0fecef133f841cb 100644 (file)
@@ -38,8 +38,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        },
                        elements: {
                                line: {
index 2cbbaed38881cacab34f210f9b3546c9d919983e..46628224ee180de5e1ae2ee14fa27e8126ecd993 100644 (file)
@@ -12,8 +12,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 6f8b82299a7e70e2e740d7d5dfb27b1cf7db9da2..dd313913c36dbae0e183a75f693064dc9ab7bd32 100644 (file)
@@ -15,8 +15,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index a76e6dea89ba0edfa836cd912488e65eefd88c9f..c0ac21a6757acf9845408998bdfe7e02325056f5 100644 (file)
@@ -16,8 +16,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 76f9d79e5ae75f0dfc99132d6efcc0f38fe68729..ec2f9b5087f3bcee09e02bd53bb7a32fd061ee83 100644 (file)
@@ -15,8 +15,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 36ec82ad81fc6f5cff9016cf3bba72cecc9550ce..b038232f97f35733756e362ca09b369c8085b4bf 100644 (file)
@@ -16,8 +16,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 7d0a9b8b8ea4a280fcf05517a01d8d38eb0ef85a..7ffcac2111f298b6dd1a8d57c58d0ae1b27dce10 100644 (file)
@@ -15,8 +15,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 9f0798b43c281061a11855c357bf9a4deb89b6a7..52ecb1fe3da0e3165e48f18c8e134a0391668530 100644 (file)
@@ -16,8 +16,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index a2392ea9ed7f2fd05de475d87222e3d5101d2b07..8e312604e6a0633c9a7844a2519c1744caba1db3 100644 (file)
@@ -15,8 +15,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index fd7fbe693ff6c46c7ad70de32d2f652660bba7bc..b6fb116400fb043f95b314f3b09bf140895c411c 100644 (file)
@@ -16,8 +16,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 51c82c43410a30dc5e908690e482f541851e63cf..96066358cbd9cf0248681e59d9bf8b6641458352 100644 (file)
@@ -16,8 +16,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 641b3a711879d6acaab9ff4e27826c0798f673b9..67f4089654d6bf5cc5c587c2f76b5f4cde095bec 100644 (file)
@@ -16,8 +16,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 775e8a71c0364758858493ec99b3ae15439edde0..a039a27aeaa9a043520f0c3a9aee8ac9561e000e 100644 (file)
@@ -16,8 +16,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index f91a6c446093ba2605d332107aa52196d483d656..d42e3ccd5f14f02d73c6d53cd62491ff61b50112 100644 (file)
@@ -14,8 +14,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 2ac89f8e5bf0452eb0e2cc1e5837e99959a3b1fe..144c98a24a1a9c63a17abb6b053222311954967d 100644 (file)
@@ -15,8 +15,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 915a9c3a098f2dbc06bc5fd675d16565be95027d..31d7165b93bfebfe295be77adc9a74052bb311e5 100644 (file)
@@ -15,8 +15,8 @@ module.exports = {
                        legend: false,
                        title: false,
                        scales: {
-                               xAxes: [{type: 'linear', display: false, min: 0, max: 20}],
-                               yAxes: [{display: false, min: -15, max: 15}]
+                               x: {type: 'linear', display: false, min: 0, max: 20},
+                               y: {display: false, min: -15, max: 15}
                        }
                }
        },
index 714d421a04992512dc371aeb93129cce83e61e86..ba84c4c7bcc589da84cc2b9a3c71fd80d2751538 100644 (file)
@@ -53,8 +53,8 @@
                 "padding": 40
             },
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{"display": false}]
+                "x": {"display": false},
+                "y": {"display": false}
             }
         }
     },
index e81b8b73113bc463887ec955c0ec894b89466357..c5add4a30e2f4e5afb952f0c835a3afbd0ec9cd0 100644 (file)
@@ -53,8 +53,8 @@
                 "padding": 40
             },
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{"display": false}]
+                "x": {"display": false},
+                "y": {"display": false}
             }
         }
     },
index 5eb99441fce477384ca03b1f84be619cb0fda48a..5cce6483fa260d98eb1fb7b39a165a7228ecae10 100644 (file)
@@ -53,8 +53,8 @@
                 "padding": 40
             },
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{"display": false}]
+                "x": {"display": false},
+                "y": {"display": false}
             }
         }
     },
index 16f059eef0d046e6812d5beade45d45cabc48367..0b08ef5925ce1450ffba1146ed3fb5ee1f16a2e6 100644 (file)
@@ -53,8 +53,8 @@
                 "padding": 40
             },
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{"display": false}]
+                "x": {"display": false},
+                "y": {"display": false}
             }
         }
     },
index 7ed2d97ef5c155ab6edd63ba4f85f937f677cbbe..6ac2f1f8a8c3d49e0d79f894bf309ee3ab776d2a 100644 (file)
@@ -44,8 +44,8 @@ module.exports = {
                                padding: 20
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index eda6d98f62c43ab46aed427d2db20ed614d59f76..7260455dfbc05f86613d4fe708329da012137d81 100644 (file)
@@ -53,8 +53,8 @@
                 "padding": 40
             },
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{"display": false}]
+                "x": {"display": false},
+                "y": {"display": false}
             }
         }
     },
index 85875655e1c2aa28f3ba5c8a486da228a50bdfae..642b400e4169e7a5a80a2d12b650e8b9b04af6f3 100644 (file)
@@ -53,8 +53,8 @@
                 "padding": 40
             },
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{"display": false}]
+                "x": {"display": false},
+                "y": {"display": false}
             }
         }
     },
index 6d65b46d820e143b52e37eaadffdea0889c6c467..d99d03c44ccbb74385b63c207d590ca8f5baa95b 100644 (file)
@@ -53,8 +53,8 @@
                 "padding": 40
             },
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{"display": false}]
+                "x": {"display": false},
+                "y": {"display": false}
             }
         }
     },
index 5e2be596366232a781a3d7a970c827cf8159df79..1d0c361f986997c0f48d4ce9c3634f6341a3224e 100644 (file)
@@ -53,8 +53,8 @@
                 "padding": 40
             },
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{"display": false}]
+                "x": {"display": false},
+                "y": {"display": false}
             }
         }
     },
index 58ea577d44ad42a09502ba7971455e5a3fb45140..62808cca0e2a90393150bd15afdd242dc00a4699 100644 (file)
@@ -53,8 +53,8 @@
                 "padding": 40
             },
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{"display": false}]
+                "x": {"display": false},
+                "y": {"display": false}
             }
         }
     },
index e7657f1af25345477afcff45d69a818863589e14..46c510ede0f00ef36e14aa1b8969c4f0a2d51995 100644 (file)
@@ -53,8 +53,8 @@
                 "padding": 40
             },
             "scales": {
-                "xAxes": [{"display": false}],
-                "yAxes": [{"display": false}]
+                "x": {"display": false},
+                "y": {"display": false}
             }
         }
     },
index b713f5d6bf4c1bf7fbcf407046c422b6d9b17ee2..12087d88fcfcfbbc5efcc463413c17de9b8c9936 100644 (file)
@@ -42,8 +42,8 @@ module.exports = {
                                padding: 20
                        },
                        scales: {
-                               xAxes: [{display: false}],
-                               yAxes: [{display: false}]
+                               x: {display: false},
+                               y: {display: false}
                        }
                }
        },
index d197b40626472c6bf3f92e66b9a588c22f48cdae..cab5f703ad7a05903aa831d20e1043f629714e29 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index 4c99b445bb0db7641d60ffb749fb8218087b0b64..8cd8146bc2a0fd0809075c4b14e7fa4a3525bcfb 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index 391bc98d80ad05fb1efd4df21fb3c349cf3b6a1b..23ee0bfddecf45246431364f1c71181fd47d84ac 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index 709df7649417a73eb820a52e17bf8d6a40686d31..f7c1c2c4ed6d91e626326fb59a5d034b820f116f 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index 05adc36253ccaea1a7e2f9ca101e0885c98f8ced..73d450e4291acf274c4ac9c3247b38966ee118f6 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index 79ee41aa0b9b6c9e3e86ca42a08e9a953541b02b..10a0590fde08380891018215ccad741a5fdcf8f1 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index 6e5eafed299ae0a44edfeb6f109b23ad60f3c859..7d795b2a143fde305f338c63ce9f181e123e08af 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index 5aa0bf289fd817bd7d2951d861233ab2792d2aa9..bb490bf8aa43ba4c8a29acb908f388e10b38c6da 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index 970e928045addf1d6d4654016ad480984ab8fa4b..948d703677c916a4fbdb2a9b82de97b8eb313cf7 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index fccd681bf012c28bfe41c5c16fd5eddd6e324f91..956135f77ab472eb79f381eca9a99b31c46a0263 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index 46d923374c974aa6d48785ff96b851d7eea97279..08efb45f1e37a7377769d0cd133727e571b0cf1b 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index e1b159c01a2fa939a7cfaba507ab833068e86914..e3d198df71409ac3a368de0e9e4a09f1fcf513a4 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index 5635b6c91989fce82c1cefbc6b0ebc7845383240..dfa41445373a57f5b76a3786e151dd9cdf240e43 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index fbddcc3a5a0502d5e0871d835336afdd63ab9e89..81c161d6318a7fa637794ff72412be388a77ba18 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index dcf118cdee7a0156e7757ba2a32d3f5f9d9c9d46..26a72fbd21a03bed3e30a3afac3305011ffb7b6b 100644 (file)
             "legend": false,
             "title": false,
             "scales": {
-                "xAxes": [{
+                "x": {
                     "display": false
-                }],
-                "yAxes": [{
+                },
+                "y": {
                     "display": false
-                }]
+                }
             },
             "elements": {
                 "point": {
index d1ffb619c93ba6ea943a9dfce2e7c9d48c470c04..add191b8d994aebb4e2699997b779d2c1f471af0 100644 (file)
@@ -10,6 +10,7 @@
             "title": false,
             "scale": {
                 "gridLines": {
+                    "display": true,
                     "color": [
                         "rgba(0, 0, 0, 0.5)",
                         "rgba(255, 255, 255, 0.5)",
index 67f72d6bfc7509deed2878cacccb66bd0e7fa75b..e0894dbc579b4b82ce59e5655f6d87f3bf2c5deb 100644 (file)
@@ -41,21 +41,11 @@ describe('Chart.controllers.bar', function() {
                                ],
                                labels: []
                        },
-                       options: {
-                               scales: {
-                                       xAxes: [{
-                                               id: 'firstXScaleID'
-                                       }],
-                                       yAxes: [{
-                                               id: 'firstYScaleID'
-                                       }]
-                               }
-                       }
                });
 
                var meta = chart.getDatasetMeta(1);
-               expect(meta.xAxisID).toBe('firstXScaleID');
-               expect(meta.yAxisID).toBe('firstYScaleID');
+               expect(meta.xAxisID).toBe('x');
+               expect(meta.yAxisID).toBe('y');
        });
 
        it('should correctly count the number of stacks ignoring datasets of other types and hidden datasets', function() {
@@ -122,12 +112,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: true
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: true
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -155,12 +145,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: false
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: false
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -211,12 +201,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: true
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: true
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -244,12 +234,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: false
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: false
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -300,12 +290,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: true
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: true
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -333,12 +323,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: false
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: false
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -416,12 +406,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: true
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: true
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -452,12 +442,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: false
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: false
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -514,12 +504,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: true
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: true
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -550,12 +540,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: false
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: false
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -612,12 +602,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: true
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: true
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -648,12 +638,12 @@ describe('Chart.controllers.bar', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: false
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: false
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -712,16 +702,14 @@ describe('Chart.controllers.bar', function() {
                                        }
                                },
                                scales: {
-                                       xAxes: [{
-                                               id: 'firstXScaleID',
+                                       x: {
                                                type: 'category',
                                                display: false
-                                       }],
-                                       yAxes: [{
-                                               id: 'firstYScaleID',
+                                       },
+                                       y: {
                                                type: 'linear',
                                                display: false
-                                       }]
+                                       }
                                }
                        }
                });
@@ -778,14 +766,14 @@ describe('Chart.controllers.bar', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                display: false
-                                       }]
+                                       }
                                }
                        }
                });
@@ -819,15 +807,15 @@ describe('Chart.controllers.bar', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                display: false,
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
@@ -878,17 +866,17 @@ describe('Chart.controllers.bar', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                display: false,
                                                stacked: true,
                                                min: 50,
                                                max: 100
-                                       }]
+                                       }
                                }
                        }
                });
@@ -939,15 +927,15 @@ describe('Chart.controllers.bar', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false,
                                                stacked: true
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                display: false
-                                       }]
+                                       }
                                }
                        }
                });
@@ -998,15 +986,15 @@ describe('Chart.controllers.bar', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                display: false,
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
@@ -1059,15 +1047,15 @@ describe('Chart.controllers.bar', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                display: false,
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
@@ -1118,15 +1106,15 @@ describe('Chart.controllers.bar', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                display: false,
                                                stacked: true,
-                                       }]
+                                       }
                                }
                        }
                });
@@ -1164,15 +1152,15 @@ describe('Chart.controllers.bar', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                display: false,
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
@@ -1212,16 +1200,16 @@ describe('Chart.controllers.bar', function() {
                                        }
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false,
                                                stacked: true,
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'logarithmic',
                                                display: false,
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
@@ -1277,16 +1265,16 @@ describe('Chart.controllers.bar', function() {
                                        }
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false,
                                                stacked: true,
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'logarithmic',
                                                display: false,
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
@@ -1511,10 +1499,10 @@ describe('Chart.controllers.bar', function() {
                                data: this.data,
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        min: 'March',
                                                        max: 'May',
-                                               }]
+                                               }
                                        }
                                }
                        };
@@ -1526,13 +1514,13 @@ describe('Chart.controllers.bar', function() {
                                data: this.data,
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        min: 'March',
                                                        max: 'May',
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        stacked: true
-                                               }]
+                                               }
                                        }
                                }
                        };
@@ -1585,10 +1573,10 @@ describe('Chart.controllers.bar', function() {
                                data: this.data,
                                options: {
                                        scales: {
-                                               yAxes: [{
+                                               y{
                                                        min: 'March',
                                                        max: 'May',
-                                               }]
+                                               }
                                        }
                                }
                        };
@@ -1600,13 +1588,13 @@ describe('Chart.controllers.bar', function() {
                                data: this.data,
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        stacked: true
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        min: 'March',
                                                        max: 'May',
-                                               }]
+                                               }
                                        }
                                }
                        };
@@ -1636,13 +1624,13 @@ describe('Chart.controllers.bar', function() {
                                                                }
                                                        },
                                                        scales: {
-                                                               xAxes: [{
+                                                               x{
                                                                        id: 'x',
                                                                        type: 'category',
-                                                               }],
-                                                               yAxes: [{
+                                                               },
+                                                               y{
                                                                        type: 'linear',
-                                                               }]
+                                                               }
                                                        }
                                                }
                                        });
@@ -1724,5 +1712,4 @@ describe('Chart.controllers.bar', function() {
                expect(data[0]._model.base + minBarLength).toEqual(data[0]._model.x);
                expect(data[1]._model.base - minBarLength).toEqual(data[1]._model.x);
        });
-
 });
index 97192b0fea2beee3b7b7f1053ac968a5c1af4075..9de15b1b812e24baa6fcb4411c90935216095cd8 100644 (file)
@@ -33,22 +33,12 @@ describe('Chart.controllers.bubble', function() {
                                        data: []
                                }]
                        },
-                       options: {
-                               scales: {
-                                       xAxes: [{
-                                               id: 'firstXScaleID'
-                                       }],
-                                       yAxes: [{
-                                               id: 'firstYScaleID'
-                                       }]
-                               }
-                       }
                });
 
                var meta = chart.getDatasetMeta(0);
 
-               expect(meta.xAxisID).toBe('firstXScaleID');
-               expect(meta.yAxisID).toBe('firstYScaleID');
+               expect(meta.xAxisID).toBe('x');
+               expect(meta.yAxisID).toBe('y');
        });
 
        it('should create point elements for each data item during initialization', function() {
@@ -128,14 +118,14 @@ describe('Chart.controllers.bubble', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'category',
                                                display: false
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                display: false
-                                       }]
+                                       }
                                }
                        }
                });
index 39157bb8bc62811e879bd1215e187425e725e5f3..51c6928e232148b992870f575a5dc97ba10f0ad7 100644 (file)
@@ -35,21 +35,11 @@ describe('Chart.controllers.line', function() {
                                }],
                                labels: []
                        },
-                       options: {
-                               scales: {
-                                       xAxes: [{
-                                               id: 'firstXScaleID'
-                                       }],
-                                       yAxes: [{
-                                               id: 'firstYScaleID'
-                                       }]
-                               }
-                       }
                });
 
                var meta = chart.getDatasetMeta(0);
-               expect(meta.xAxisID).toBe('firstXScaleID');
-               expect(meta.yAxisID).toBe('firstYScaleID');
+               expect(meta.xAxisID).toBe('x');
+               expect(meta.yAxisID).toBe('y');
        });
 
        it('Should create line elements and point elements for each data item during initialization', function() {
@@ -173,8 +163,8 @@ describe('Chart.controllers.line', function() {
                                datasets: [{
                                        data: [10, 15, 0, -4],
                                        label: 'dataset',
-                                       xAxisID: 'firstXScaleID',
-                                       yAxisID: 'firstYScaleID'
+                                       xAxisID: 'x',
+                                       yAxisID: 'y'
                                }],
                                labels: ['label1', 'label2', 'label3', 'label4']
                        },
@@ -189,14 +179,12 @@ describe('Chart.controllers.line', function() {
                                        }
                                },
                                scales: {
-                                       xAxes: [{
-                                               id: 'firstXScaleID',
+                                       x: {
                                                display: false
-                                       }],
-                                       yAxes: [{
-                                               id: 'firstYScaleID',
+                                       },
+                                       y: {
                                                display: false
-                                       }]
+                                       }
                                }
                        },
                });
@@ -246,13 +234,13 @@ describe('Chart.controllers.line', function() {
                                        intersect: true
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: false,
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: false,
                                                beginAtZero: true
-                                       }]
+                                       }
                                }
                        }
                });
@@ -313,13 +301,13 @@ describe('Chart.controllers.line', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: false,
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: false,
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
@@ -363,7 +351,7 @@ describe('Chart.controllers.line', function() {
                                }, {
                                        data: [10, 10, -10, -10],
                                        label: 'dataset3',
-                                       yAxisID: 'secondAxis'
+                                       yAxisID: 'y2'
                                }],
                                labels: ['label1', 'label2', 'label3', 'label4']
                        },
@@ -371,17 +359,18 @@ describe('Chart.controllers.line', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: false,
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: false,
                                                stacked: true
-                                       }, {
-                                               id: 'secondAxis',
+                                       },
+                                       y2: {
                                                type: 'linear',
+                                               position: 'right',
                                                display: false
-                                       }]
+                                       }
                                }
                        }
                });
@@ -453,13 +442,13 @@ describe('Chart.controllers.line', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: false,
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: false,
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
@@ -507,13 +496,13 @@ describe('Chart.controllers.line', function() {
                                legend: false,
                                title: false,
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                display: false,
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                display: false,
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
index e8a37da58e9ca7db63699c925aa7941e3554e02e..c0528ccf985683480d5194179a0e4155ea7ebbee 100644 (file)
@@ -130,19 +130,19 @@ describe('Chart', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        position: 'left',
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        position: 'bottom'
-                                               }]
+                                               }
                                        }
                                }
                        });
 
                        var scaleOptions = chart.options.scales;
-                       expect(scaleOptions.xAxes[0].position).toBe('bottom');
-                       expect(scaleOptions.yAxes[0].position).toBe('left');
+                       expect(scaleOptions.x.position).toBe('bottom');
+                       expect(scaleOptions.y.position).toBe('left');
                });
 
                it('should throw an error if the chart type is incorrect', function() {
@@ -158,12 +158,14 @@ describe('Chart', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
+                                                       x: {
+                                                               type: 'linear',
                                                                position: 'left',
-                                                       }],
-                                                       yAxes: [{
+                                                       },
+                                                       y: {
+                                                               type: 'category',
                                                                position: 'bottom'
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -199,22 +201,18 @@ describe('Chart', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [
-                                                       {id: 'foo0'},
-                                                       {id: 'foo1'}
-                                               ],
-                                               yAxes: [
-                                                       {id: 'bar0'},
-                                                       {id: 'bar1'}
-                                               ]
+                                               xFoo0: {},
+                                               xFoo1: {},
+                                               yBar0: {},
+                                               yBar1: {},
                                        }
                                }
                        });
 
-                       expect(chart.scales.foo0.type).toBe('category');
-                       expect(chart.scales.foo1.type).toBe('category');
-                       expect(chart.scales.bar0.type).toBe('linear');
-                       expect(chart.scales.bar1.type).toBe('linear');
+                       expect(chart.scales.xFoo0.type).toBe('category');
+                       expect(chart.scales.xFoo1.type).toBe('category');
+                       expect(chart.scales.yBar0.type).toBe('linear');
+                       expect(chart.scales.yBar1.type).toBe('linear');
                });
 
                it('should correctly apply defaults on central scale', function() {
@@ -233,7 +231,7 @@ describe('Chart', function() {
                        // let's check a few values from the user options and defaults
 
                        expect(chart.scales.foo.type).toBe('logarithmic');
-                       expect(chart.scales.foo.options).toBe(chart.options.scale);
+                       expect(chart.scales.foo.options).toEqual(chart.options.scales.foo);
                        expect(chart.scales.foo.options).toEqual(
                                jasmine.objectContaining({
                                        _jasmineCheckA: 'a0',
@@ -248,25 +246,23 @@ describe('Chart', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'foo',
+                                               x: {
                                                        type: 'logarithmic',
                                                        _jasmineCheckC: 'c2',
                                                        _jasmineCheckD: 'd2'
-                                               }],
-                                               yAxes: [{
-                                                       id: 'bar',
+                                               },
+                                               y: {
                                                        type: 'time',
                                                        _jasmineCheckC: 'c2',
                                                        _jasmineCheckE: 'e2'
-                                               }]
+                                               }
                                        }
                                }
                        });
 
-                       expect(chart.scales.foo.type).toBe('logarithmic');
-                       expect(chart.scales.foo.options).toBe(chart.options.scales.xAxes[0]);
-                       expect(chart.scales.foo.options).toEqual(
+                       expect(chart.scales.x.type).toBe('logarithmic');
+                       expect(chart.scales.x.options).toBe(chart.options.scales.x);
+                       expect(chart.scales.x.options).toEqual(
                                jasmine.objectContaining({
                                        _jasmineCheckA: 'a0',
                                        _jasmineCheckB: 'b1',
@@ -274,9 +270,9 @@ describe('Chart', function() {
                                        _jasmineCheckD: 'd2'
                                }));
 
-                       expect(chart.scales.bar.type).toBe('time');
-                       expect(chart.scales.bar.options).toBe(chart.options.scales.yAxes[0]);
-                       expect(chart.scales.bar.options).toEqual(
+                       expect(chart.scales.y.type).toBe('time');
+                       expect(chart.scales.y.options).toBe(chart.options.scales.y);
+                       expect(chart.scales.y.options).toEqual(
                                jasmine.objectContaining({
                                        _jasmineCheckA: 'a0',
                                        _jasmineCheckB: 'b0',
@@ -291,23 +287,21 @@ describe('Chart', function() {
                                options: {
                                        _jasmineCheck: 42,
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'foo',
+                                               x: {
                                                        type: 'linear',
                                                        _jasmineCheck: 42,
-                                               }],
-                                               yAxes: [{
-                                                       id: 'bar',
+                                               },
+                                               y: {
                                                        type: 'category',
                                                        _jasmineCheck: 42,
-                                               }]
+                                               }
                                        }
                                }
                        });
 
                        expect(chart.options._jasmineCheck).toBeDefined();
-                       expect(chart.scales.foo.options._jasmineCheck).toBeDefined();
-                       expect(chart.scales.bar.options._jasmineCheck).toBeDefined();
+                       expect(chart.scales.x.options._jasmineCheck).toBeDefined();
+                       expect(chart.scales.y.options._jasmineCheck).toBeDefined();
 
                        expect(Chart.defaults.line._jasmineCheck).not.toBeDefined();
                        expect(Chart.defaults.global._jasmineCheck).not.toBeDefined();
@@ -989,15 +983,15 @@ describe('Chart', function() {
                        chart.options = {
                                responsive: false,
                                scales: {
-                                       yAxes: [{
+                                       y{
                                                min: 0,
                                                max: 10
-                                       }]
+                                       }
                                }
                        };
                        chart.update();
 
-                       var yScale = chart.scales['y-axis-0'];
+                       var yScale = chart.scales.y;
                        expect(yScale.options.min).toBe(0);
                        expect(yScale.options.max).toBe(10);
                });
@@ -1016,11 +1010,11 @@ describe('Chart', function() {
                                }
                        });
 
-                       chart.options.scales.yAxes[0].min = 0;
-                       chart.options.scales.yAxes[0].max = 10;
+                       chart.options.scales.y.min = 0;
+                       chart.options.scales.y.max = 10;
                        chart.update();
 
-                       var yScale = chart.scales['y-axis-0'];
+                       var yScale = chart.scales.y;
                        expect(yScale.options.min).toBe(0);
                        expect(yScale.options.max).toBe(10);
                });
@@ -1040,37 +1034,20 @@ describe('Chart', function() {
                        });
 
                        var newScalesConfig = {
-                               yAxes: [{
+                               y{
                                        min: 0,
                                        max: 10
-                               }]
+                               }
                        };
                        chart.options.scales = newScalesConfig;
 
                        chart.update();
 
-                       var yScale = chart.scales['y-axis-0'];
+                       var yScale = chart.scales.y;
                        expect(yScale.options.min).toBe(0);
                        expect(yScale.options.max).toBe(10);
                });
 
-               it ('should assign unique scale IDs', function() {
-                       var chart = acquireChart({
-                               type: 'line',
-                               options: {
-                                       scales: {
-                                               xAxes: [{id: 'x-axis-0'}, {}, {}],
-                                               yAxes: [{id: 'y-axis-1'}, {}, {}]
-                                       }
-                               }
-                       });
-
-                       expect(Object.keys(chart.scales).sort()).toEqual([
-                               'x-axis-0', 'x-axis-1', 'x-axis-2',
-                               'y-axis-1', 'y-axis-2', 'y-axis-3'
-                       ]);
-               });
-
                it ('should remove discarded scale', function() {
                        var chart = acquireChart({
                                type: 'line',
@@ -1083,20 +1060,19 @@ describe('Chart', function() {
                                options: {
                                        responsive: true,
                                        scales: {
-                                               yAxes: [{
-                                                       id: 'yAxis0',
+                                               y: {
                                                        min: 0,
                                                        max: 10
-                                               }]
+                                               }
                                        }
                                }
                        });
 
                        var newScalesConfig = {
-                               yAxes: [{
+                               y{
                                        min: 0,
                                        max: 10
-                               }]
+                               }
                        };
                        chart.options.scales = newScalesConfig;
 
@@ -1104,7 +1080,7 @@ describe('Chart', function() {
 
                        var yScale = chart.scales.yAxis0;
                        expect(yScale).toBeUndefined();
-                       var newyScale = chart.scales['y-axis-0'];
+                       var newyScale = chart.scales.y;
                        expect(newyScale.options.min).toBe(0);
                        expect(newyScale.options.max).toBe(10);
                });
@@ -1181,15 +1157,16 @@ describe('Chart', function() {
                                options: {
                                        responsive: true,
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        type: 'category'
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y: {
+                                                       type: 'linear',
                                                        scaleLabel: {
                                                                display: true,
                                                                labelString: 'Value'
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        };
index e2758182d45a65ccf6c84af8ab85103d645ee1dd..c03f6de94902a7cb0f734888da39857dce8bf816 100644 (file)
@@ -233,16 +233,22 @@ describe('Chart.DatasetController', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'firstXScaleID'
-                                       }, {
-                                               id: 'secondXScaleID'
-                                       }],
-                                       yAxes: [{
-                                               id: 'firstYScaleID'
-                                       }, {
-                                               id: 'secondYScaleID'
-                                       }]
+                                       firstXScaleID: {
+                                               type: 'category',
+                                               position: 'bottom'
+                                       },
+                                       secondXScaleID: {
+                                               type: 'category',
+                                               position: 'bottom'
+                                       },
+                                       firstYScaleID: {
+                                               type: 'linear',
+                                               position: 'left'
+                                       },
+                                       secondYScaleID: {
+                                               type: 'linear',
+                                               position: 'left'
+                                       },
                                }
                        }
                });
index 3c2b8e5b3484c1f48a157ddc528ce5c91abdf906..6c161b6c6b5419cbd37cd8137ed95ad35c1877d5 100644 (file)
@@ -21,18 +21,6 @@ describe('Chart.layouts', function() {
                                        {data: [10, 5, 0, 25, 78, -10]}
                                ],
                                labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick5', 'tick6']
-                       },
-                       options: {
-                               scales: {
-                                       xAxes: [{
-                                               id: 'xScale',
-                                               type: 'category'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale',
-                                               type: 'linear'
-                                       }]
-                               }
                        }
                }, {
                        canvas: {
@@ -47,18 +35,18 @@ describe('Chart.layouts', function() {
                expect(chart.chartArea.top).toBeCloseToPixel(32);
 
                // Is xScale at the right spot
-               expect(chart.scales.xScale.bottom).toBeCloseToPixel(150);
-               expect(chart.scales.xScale.left).toBeCloseToPixel(34);
-               expect(chart.scales.xScale.right).toBeCloseToPixel(247);
-               expect(chart.scales.xScale.top).toBeCloseToPixel(120);
-               expect(chart.scales.xScale.labelRotation).toBeCloseTo(0);
+               expect(chart.scales.x.bottom).toBeCloseToPixel(150);
+               expect(chart.scales.x.left).toBeCloseToPixel(34);
+               expect(chart.scales.x.right).toBeCloseToPixel(247);
+               expect(chart.scales.x.top).toBeCloseToPixel(120);
+               expect(chart.scales.x.labelRotation).toBeCloseTo(0);
 
                // Is yScale at the right spot
-               expect(chart.scales.yScale.bottom).toBeCloseToPixel(120);
-               expect(chart.scales.yScale.left).toBeCloseToPixel(0);
-               expect(chart.scales.yScale.right).toBeCloseToPixel(34);
-               expect(chart.scales.yScale.top).toBeCloseToPixel(32);
-               expect(chart.scales.yScale.labelRotation).toBeCloseTo(0);
+               expect(chart.scales.y.bottom).toBeCloseToPixel(120);
+               expect(chart.scales.y.left).toBeCloseToPixel(0);
+               expect(chart.scales.y.right).toBeCloseToPixel(34);
+               expect(chart.scales.y.top).toBeCloseToPixel(32);
+               expect(chart.scales.y.labelRotation).toBeCloseTo(0);
        });
 
        it('should fit scales that are in the top and right positions', function() {
@@ -72,16 +60,14 @@ describe('Chart.layouts', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale',
+                                       x: {
                                                type: 'category',
                                                position: 'top'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       },
+                                       y: {
                                                type: 'linear',
                                                position: 'right'
-                                       }]
+                                       }
                                }
                        }
                }, {
@@ -97,18 +83,18 @@ describe('Chart.layouts', function() {
                expect(chart.chartArea.top).toBeCloseToPixel(62);
 
                // Is xScale at the right spot
-               expect(chart.scales.xScale.bottom).toBeCloseToPixel(62);
-               expect(chart.scales.xScale.left).toBeCloseToPixel(3);
-               expect(chart.scales.xScale.right).toBeCloseToPixel(216);
-               expect(chart.scales.xScale.top).toBeCloseToPixel(32);
-               expect(chart.scales.xScale.labelRotation).toBeCloseTo(0);
+               expect(chart.scales.x.bottom).toBeCloseToPixel(62);
+               expect(chart.scales.x.left).toBeCloseToPixel(3);
+               expect(chart.scales.x.right).toBeCloseToPixel(216);
+               expect(chart.scales.x.top).toBeCloseToPixel(32);
+               expect(chart.scales.x.labelRotation).toBeCloseTo(0);
 
                // Is yScale at the right spot
-               expect(chart.scales.yScale.bottom).toBeCloseToPixel(142);
-               expect(chart.scales.yScale.left).toBeCloseToPixel(216);
-               expect(chart.scales.yScale.right).toBeCloseToPixel(250);
-               expect(chart.scales.yScale.top).toBeCloseToPixel(62);
-               expect(chart.scales.yScale.labelRotation).toBeCloseTo(0);
+               expect(chart.scales.y.bottom).toBeCloseToPixel(142);
+               expect(chart.scales.y.left).toBeCloseToPixel(216);
+               expect(chart.scales.y.right).toBeCloseToPixel(250);
+               expect(chart.scales.y.top).toBeCloseToPixel(62);
+               expect(chart.scales.y.labelRotation).toBeCloseTo(0);
        });
 
        it('should fit scales with long labels correctly', function() {
@@ -125,19 +111,17 @@ describe('Chart.layouts', function() {
                                        display: false
                                },
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale',
+                                       x: {
                                                type: 'category',
                                                ticks: {
                                                        maxRotation: 0,
                                                        autoSkip: false
                                                }
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       },
+                                       y: {
                                                type: 'linear',
                                                position: 'right'
-                                       }]
+                                       }
                                }
                        }
                }, {
@@ -153,30 +137,30 @@ describe('Chart.layouts', function() {
                expect(chart.chartArea.top).toBeCloseToPixel(7);
 
                // Is xScale at the right spot
-               expect(chart.scales.xScale.bottom).toBeCloseToPixel(150);
-               expect(chart.scales.xScale.left).toBeCloseToPixel(60);
-               expect(chart.scales.xScale.right).toBeCloseToPixel(452);
-               expect(chart.scales.xScale.top).toBeCloseToPixel(120);
-               expect(chart.scales.xScale.labelRotation).toBeCloseTo(0);
-
-               expect(chart.scales.xScale.height).toBeCloseToPixel(30);
-               expect(chart.scales.xScale.paddingLeft).toBeCloseToPixel(60);
-               expect(chart.scales.xScale.paddingTop).toBeCloseToPixel(0);
-               expect(chart.scales.xScale.paddingRight).toBeCloseToPixel(60);
-               expect(chart.scales.xScale.paddingBottom).toBeCloseToPixel(0);
+               expect(chart.scales.x.bottom).toBeCloseToPixel(150);
+               expect(chart.scales.x.left).toBeCloseToPixel(60);
+               expect(chart.scales.x.right).toBeCloseToPixel(452);
+               expect(chart.scales.x.top).toBeCloseToPixel(120);
+               expect(chart.scales.x.labelRotation).toBeCloseTo(0);
+
+               expect(chart.scales.x.height).toBeCloseToPixel(30);
+               expect(chart.scales.x.paddingLeft).toBeCloseToPixel(60);
+               expect(chart.scales.x.paddingTop).toBeCloseToPixel(0);
+               expect(chart.scales.x.paddingRight).toBeCloseToPixel(60);
+               expect(chart.scales.x.paddingBottom).toBeCloseToPixel(0);
 
                // Is yScale at the right spot
-               expect(chart.scales.yScale.bottom).toBeCloseToPixel(120);
-               expect(chart.scales.yScale.left).toBeCloseToPixel(452);
-               expect(chart.scales.yScale.right).toBeCloseToPixel(486);
-               expect(chart.scales.yScale.top).toBeCloseToPixel(7);
-               expect(chart.scales.yScale.labelRotation).toBeCloseTo(0);
-
-               expect(chart.scales.yScale.width).toBeCloseToPixel(34);
-               expect(chart.scales.yScale.paddingLeft).toBeCloseToPixel(0);
-               expect(chart.scales.yScale.paddingTop).toBeCloseToPixel(7);
-               expect(chart.scales.yScale.paddingRight).toBeCloseToPixel(0);
-               expect(chart.scales.yScale.paddingBottom).toBeCloseToPixel(7);
+               expect(chart.scales.y.bottom).toBeCloseToPixel(120);
+               expect(chart.scales.y.left).toBeCloseToPixel(452);
+               expect(chart.scales.y.right).toBeCloseToPixel(486);
+               expect(chart.scales.y.top).toBeCloseToPixel(7);
+               expect(chart.scales.y.labelRotation).toBeCloseTo(0);
+
+               expect(chart.scales.y.width).toBeCloseToPixel(34);
+               expect(chart.scales.y.paddingLeft).toBeCloseToPixel(0);
+               expect(chart.scales.y.paddingTop).toBeCloseToPixel(7);
+               expect(chart.scales.y.paddingRight).toBeCloseToPixel(0);
+               expect(chart.scales.y.paddingBottom).toBeCloseToPixel(7);
        });
 
        it('should fit scales that overlap the chart area', function() {
@@ -197,12 +181,13 @@ describe('Chart.layouts', function() {
                expect(chart.chartArea.right).toBeCloseToPixel(512);
                expect(chart.chartArea.top).toBeCloseToPixel(32);
 
-               expect(chart.scale.bottom).toBeCloseToPixel(512);
-               expect(chart.scale.left).toBeCloseToPixel(0);
-               expect(chart.scale.right).toBeCloseToPixel(512);
-               expect(chart.scale.top).toBeCloseToPixel(32);
-               expect(chart.scale.width).toBeCloseToPixel(512);
-               expect(chart.scale.height).toBeCloseToPixel(480);
+               var scale = chart.scales.r;
+               expect(scale.bottom).toBeCloseToPixel(512);
+               expect(scale.left).toBeCloseToPixel(0);
+               expect(scale.right).toBeCloseToPixel(512);
+               expect(scale.top).toBeCloseToPixel(32);
+               expect(scale.width).toBeCloseToPixel(512);
+               expect(scale.height).toBeCloseToPixel(480);
        });
 
        it('should fit multiple axes in the same position', function() {
@@ -210,27 +195,25 @@ describe('Chart.layouts', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y',
                                        data: [10, 5, 0, 25, 78, -10]
                                }, {
-                                       yAxisID: 'yScale2',
+                                       yAxisID: 'y2',
                                        data: [-19, -20, 0, -99, -50, 0]
                                }],
                                labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick5', 'tick6']
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale',
+                                       x: {
                                                type: 'category'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale1',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }, {
-                                               id: 'yScale2',
+                                       },
+                                       y2: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                }, {
@@ -246,24 +229,24 @@ describe('Chart.layouts', function() {
                expect(chart.chartArea.top).toBeCloseToPixel(32);
 
                // Is xScale at the right spot
-               expect(chart.scales.xScale.bottom).toBeCloseToPixel(150);
-               expect(chart.scales.xScale.left).toBeCloseToPixel(73);
-               expect(chart.scales.xScale.right).toBeCloseToPixel(247);
-               expect(chart.scales.xScale.top).toBeCloseToPixel(118);
-               expect(chart.scales.xScale.labelRotation).toBeCloseTo(40, -1);
+               expect(chart.scales.x.bottom).toBeCloseToPixel(150);
+               expect(chart.scales.x.left).toBeCloseToPixel(73);
+               expect(chart.scales.x.right).toBeCloseToPixel(247);
+               expect(chart.scales.x.top).toBeCloseToPixel(118);
+               expect(chart.scales.x.labelRotation).toBeCloseTo(40, -1);
 
                // Are yScales at the right spot
-               expect(chart.scales.yScale1.bottom).toBeCloseToPixel(118);
-               expect(chart.scales.yScale1.left).toBeCloseToPixel(41);
-               expect(chart.scales.yScale1.right).toBeCloseToPixel(73);
-               expect(chart.scales.yScale1.top).toBeCloseToPixel(32);
-               expect(chart.scales.yScale1.labelRotation).toBeCloseTo(0);
-
-               expect(chart.scales.yScale2.bottom).toBeCloseToPixel(118);
-               expect(chart.scales.yScale2.left).toBeCloseToPixel(0);
-               expect(chart.scales.yScale2.right).toBeCloseToPixel(41);
-               expect(chart.scales.yScale2.top).toBeCloseToPixel(32);
-               expect(chart.scales.yScale2.labelRotation).toBeCloseTo(0);
+               expect(chart.scales.y.bottom).toBeCloseToPixel(118);
+               expect(chart.scales.y.left).toBeCloseToPixel(41);
+               expect(chart.scales.y.right).toBeCloseToPixel(73);
+               expect(chart.scales.y.top).toBeCloseToPixel(32);
+               expect(chart.scales.y.labelRotation).toBeCloseTo(0);
+
+               expect(chart.scales.y2.bottom).toBeCloseToPixel(118);
+               expect(chart.scales.y2.left).toBeCloseToPixel(0);
+               expect(chart.scales.y2.right).toBeCloseToPixel(41);
+               expect(chart.scales.y2.top).toBeCloseToPixel(32);
+               expect(chart.scales.y2.labelRotation).toBeCloseTo(0);
        });
 
        it ('should fit a full width box correctly', function() {
@@ -271,29 +254,29 @@ describe('Chart.layouts', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale1',
+                                       xAxisID: 'x',
                                        data: [10, 5, 0, 25, 78, -10]
                                }, {
-                                       xAxisID: 'xScale2',
+                                       xAxisID: 'x2',
                                        data: [-19, -20, 0, -99, -50, 0]
                                }],
                                labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick5', 'tick6']
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale1',
-                                               type: 'category'
-                                       }, {
-                                               id: 'xScale2',
+                                       x{
+                                               type: 'category',
+                                               offset: false
+                                       },
+                                       x2: {
                                                type: 'category',
                                                position: 'top',
-                                               fullWidth: true
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale',
+                                               fullWidth: true,
+                                               offset: false
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
@@ -304,21 +287,21 @@ describe('Chart.layouts', function() {
                expect(chart.chartArea.top).toBeCloseToPixel(62);
 
                // Are xScales at the right spot
-               expect(chart.scales.xScale1.bottom).toBeCloseToPixel(512);
-               expect(chart.scales.xScale1.left).toBeCloseToPixel(40);
-               expect(chart.scales.xScale1.right).toBeCloseToPixel(496);
-               expect(chart.scales.xScale1.top).toBeCloseToPixel(484);
+               expect(chart.scales.x.bottom).toBeCloseToPixel(512);
+               expect(chart.scales.x.left).toBeCloseToPixel(40);
+               expect(chart.scales.x.right).toBeCloseToPixel(496);
+               expect(chart.scales.x.top).toBeCloseToPixel(484);
 
-               expect(chart.scales.xScale2.bottom).toBeCloseToPixel(62);
-               expect(chart.scales.xScale2.left).toBeCloseToPixel(0);
-               expect(chart.scales.xScale2.right).toBeCloseToPixel(512);
-               expect(chart.scales.xScale2.top).toBeCloseToPixel(32);
+               expect(chart.scales.x2.bottom).toBeCloseToPixel(62);
+               expect(chart.scales.x2.left).toBeCloseToPixel(0);
+               expect(chart.scales.x2.right).toBeCloseToPixel(512);
+               expect(chart.scales.x2.top).toBeCloseToPixel(32);
 
                // Is yScale at the right spot
-               expect(chart.scales.yScale.bottom).toBeCloseToPixel(484);
-               expect(chart.scales.yScale.left).toBeCloseToPixel(0);
-               expect(chart.scales.yScale.right).toBeCloseToPixel(40);
-               expect(chart.scales.yScale.top).toBeCloseToPixel(62);
+               expect(chart.scales.y.bottom).toBeCloseToPixel(484);
+               expect(chart.scales.y.left).toBeCloseToPixel(0);
+               expect(chart.scales.y.right).toBeCloseToPixel(40);
+               expect(chart.scales.y.top).toBeCloseToPixel(62);
        });
 
        describe('padding settings', function() {
@@ -335,16 +318,14 @@ describe('Chart.layouts', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'xScale',
+                                               x: {
                                                        type: 'category',
                                                        display: false
-                                               }],
-                                               yAxes: [{
-                                                       id: 'yScale',
+                                               },
+                                               y: {
                                                        type: 'linear',
                                                        display: false
-                                               }]
+                                               }
                                        },
                                        legend: {
                                                display: false
@@ -382,16 +363,14 @@ describe('Chart.layouts', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'xScale',
+                                               x: {
                                                        type: 'category',
                                                        display: false
-                                               }],
-                                               yAxes: [{
-                                                       id: 'yScale',
+                                               },
+                                               y: {
                                                        type: 'linear',
                                                        display: false
-                                               }]
+                                               }
                                        },
                                        legend: {
                                                display: false
@@ -434,16 +413,14 @@ describe('Chart.layouts', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'xScale',
+                                               x: {
                                                        type: 'category',
                                                        display: false
-                                               }],
-                                               yAxes: [{
-                                                       id: 'yScale',
+                                               },
+                                               y: {
                                                        type: 'linear',
                                                        display: false
-                                               }]
+                                               }
                                        },
                                        legend: {
                                                display: false
@@ -498,8 +475,8 @@ describe('Chart.layouts', function() {
                                }
                        });
 
-                       var xAxis = chart.scales['x-axis-0'];
-                       var yAxis = chart.scales['y-axis-0'];
+                       var xAxis = chart.scales.x;
+                       var yAxis = chart.scales.y;
                        var legend = chart.legend;
                        var title = chart.titleBlock;
 
@@ -520,60 +497,63 @@ describe('Chart.layouts', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'xScale0',
+                                               x: {
                                                        type: 'category',
+                                                       position: 'bottom',
                                                        display: true,
                                                        weight: 1
-                                               }, {
-                                                       id: 'xScale1',
+                                               },
+                                               x1: {
                                                        type: 'category',
+                                                       position: 'bottom',
                                                        display: true,
                                                        weight: 2
-                                               }, {
-                                                       id: 'xScale2',
+                                               },
+                                               x2: {
                                                        type: 'category',
+                                                       position: 'bottom',
                                                        display: true
-                                               }, {
-                                                       id: 'xScale3',
+                                               },
+                                               x3: {
                                                        type: 'category',
                                                        display: true,
                                                        position: 'top',
                                                        weight: 1
-                                               }, {
-                                                       id: 'xScale4',
+                                               },
+                                               x4: {
                                                        type: 'category',
                                                        display: true,
                                                        position: 'top',
                                                        weight: 2
-                                               }],
-                                               yAxes: [{
-                                                       id: 'yScale0',
+                                               },
+                                               y: {
                                                        type: 'linear',
                                                        display: true,
                                                        weight: 1
-                                               }, {
-                                                       id: 'yScale1',
+                                               },
+                                               y1: {
                                                        type: 'linear',
+                                                       position: 'left',
                                                        display: true,
                                                        weight: 2
-                                               }, {
-                                                       id: 'yScale2',
+                                               },
+                                               y2: {
                                                        type: 'linear',
+                                                       position: 'left',
                                                        display: true
-                                               }, {
-                                                       id: 'yScale3',
+                                               },
+                                               y3: {
                                                        type: 'linear',
                                                        display: true,
                                                        position: 'right',
                                                        weight: 1
-                                               }, {
-                                                       id: 'yScale4',
+                                               },
+                                               y4: {
                                                        type: 'linear',
                                                        display: true,
                                                        position: 'right',
                                                        weight: 2
-                                               }]
+                                               }
                                        }
                                }
                        }, {
@@ -583,17 +563,17 @@ describe('Chart.layouts', function() {
                                }
                        });
 
-                       var xScale0 = chart.scales.xScale0;
-                       var xScale1 = chart.scales.xScale1;
-                       var xScale2 = chart.scales.xScale2;
-                       var xScale3 = chart.scales.xScale3;
-                       var xScale4 = chart.scales.xScale4;
+                       var xScale0 = chart.scales.x;
+                       var xScale1 = chart.scales.x1;
+                       var xScale2 = chart.scales.x2;
+                       var xScale3 = chart.scales.x3;
+                       var xScale4 = chart.scales.x4;
 
-                       var yScale0 = chart.scales.yScale0;
-                       var yScale1 = chart.scales.yScale1;
-                       var yScale2 = chart.scales.yScale2;
-                       var yScale3 = chart.scales.yScale3;
-                       var yScale4 = chart.scales.yScale4;
+                       var yScale0 = chart.scales.y;
+                       var yScale1 = chart.scales.y1;
+                       var yScale2 = chart.scales.y2;
+                       var yScale3 = chart.scales.y3;
+                       var yScale4 = chart.scales.y4;
 
                        expect(xScale0.weight).toBe(1);
                        expect(xScale1.weight).toBe(2);
@@ -650,7 +630,7 @@ describe('Chart.layouts', function() {
                                        width: 256
                                }
                        });
-                       var yAxis = chart.scales['y-axis-0'];
+                       var yAxis = chart.scales.y;
 
                        // issue #4441: y-axis labels partially hidden.
                        // minimum horizontal space required to fit labels
index 23fd5da823dfdbd99ded3ca6b537ab0463c0cd15..0ab05671d252d38f09b4e8cab85aee13174fc51a 100644 (file)
@@ -28,18 +28,18 @@ describe('Core.scale', function() {
                                data: data,
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        ticks: {
                                                                autoSkip: true
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
                }
 
                function lastTick(chart) {
-                       var xAxis = chart.scales['x-axis-0'];
+                       var xAxis = chart.scales.x;
                        var ticks = xAxis.getTicks();
                        return ticks[ticks.length - 1];
                }
@@ -133,8 +133,7 @@ describe('Core.scale', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'xScale0',
+                                               x: {
                                                        gridLines: {
                                                                offsetGridLines: test.offsetGridLines,
                                                                drawTicks: false
@@ -143,10 +142,10 @@ describe('Core.scale', function() {
                                                                display: false
                                                        },
                                                        offset: test.offset
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        display: false
-                                               }]
+                                               }
                                        },
                                        legend: {
                                                display: false
@@ -154,7 +153,7 @@ describe('Core.scale', function() {
                                }
                        });
 
-                       var xScale = chart.scales.xScale0;
+                       var xScale = chart.scales.x;
                        xScale.ctx = window.createMockContext();
                        chart.draw();
 
@@ -178,12 +177,11 @@ describe('Core.scale', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        display: false
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        type: 'category',
-                                                       id: 'yScale0',
                                                        gridLines: {
                                                                offsetGridLines: test.offsetGridLines,
                                                                drawTicks: false
@@ -192,7 +190,7 @@ describe('Core.scale', function() {
                                                                display: false
                                                        },
                                                        offset: test.offset
-                                               }]
+                                               }
                                        },
                                        legend: {
                                                display: false
@@ -200,7 +198,7 @@ describe('Core.scale', function() {
                                }
                        });
 
-                       var yScale = chart.scales.yScale0;
+                       var yScale = chart.scales.y;
                        yScale.ctx = window.createMockContext();
                        chart.draw();
 
@@ -226,12 +224,9 @@ describe('Core.scale', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'foo'
-                                       }],
-                                       yAxes: [{
+                                       y: {
                                                display: false
-                                       }]
+                                       }
                                },
                                legend: {
                                        display: false
@@ -244,7 +239,7 @@ describe('Core.scale', function() {
                        }
                });
 
-               var scale = chart.scales.foo;
+               var scale = chart.scales.x;
                expect(scale.left).toBeGreaterThan(100);
                expect(scale.right).toBeGreaterThan(190);
        });
@@ -268,19 +263,17 @@ describe('Core.scale', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'foo',
+                                                       x: {
                                                                display: 'auto'
-                                                       }],
-                                                       yAxes: [{
+                                                       },
+                                                       y{
                                                                type: 'category',
-                                                               id: 'yScale0'
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
 
-                               var scale = chart.scales.foo;
+                               var scale = chart.scales.x;
                                scale.ctx = window.createMockContext();
                                chart.draw();
 
@@ -301,15 +294,14 @@ describe('Core.scale', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'foo',
+                                                       x: {
                                                                display: 'auto'
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
 
-                               var scale = chart.scales.foo;
+                               var scale = chart.scales.x;
                                scale.ctx = window.createMockContext();
                                chart.draw();
 
@@ -336,15 +328,14 @@ describe('Core.scale', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       yAxes: [{
-                                                               id: 'foo',
+                                                       y: {
                                                                display: 'auto'
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
 
-                               var scale = chart.scales.foo;
+                               var scale = chart.scales.y;
                                scale.ctx = window.createMockContext();
                                chart.draw();
 
@@ -365,15 +356,14 @@ describe('Core.scale', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       yAxes: [{
-                                                               id: 'foo',
+                                                       y: {
                                                                display: 'auto'
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
 
-                               var scale = chart.scales.foo;
+                               var scale = chart.scales.y;
                                scale.ctx = window.createMockContext();
                                chart.draw();
 
@@ -390,14 +380,13 @@ describe('Core.scale', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'x',
+                                               x: {
                                                        type: 'category',
                                                        labels: labels,
                                                        afterBuildTicks: function(scale) {
                                                                scale.ticks = scale.ticks.slice(1);
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -412,12 +401,11 @@ describe('Core.scale', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'x',
+                                               x: {
                                                        type: 'category',
                                                        labels: labels,
                                                        afterBuildTicks: function() { }
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -432,14 +420,13 @@ describe('Core.scale', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'x',
+                                               x: {
                                                        type: 'category',
                                                        labels: labels,
                                                        afterBuildTicks: function(scale) {
                                                                scale.ticks = [];
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -455,10 +442,9 @@ describe('Core.scale', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'x',
+                                               x: {
                                                        type: 'linear',
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -480,8 +466,7 @@ describe('Core.scale', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'x',
+                                               x: {
                                                        type: 'customScale',
                                                        gridLines: {
                                                                z: 10
@@ -489,7 +474,7 @@ describe('Core.scale', function() {
                                                        ticks: {
                                                                z: 20
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -504,8 +489,7 @@ describe('Core.scale', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'x',
+                                               x: {
                                                        type: 'linear',
                                                        ticks: {
                                                                z: 10
@@ -513,7 +497,7 @@ describe('Core.scale', function() {
                                                        gridLines: {
                                                                z: 10
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -528,13 +512,12 @@ describe('Core.scale', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'x',
+                                               x: {
                                                        type: 'linear',
                                                        ticks: {
                                                                z: 10
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -545,13 +528,12 @@ describe('Core.scale', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'x',
+                                               x: {
                                                        type: 'linear',
                                                        gridLines: {
                                                                z: 11
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -562,8 +544,7 @@ describe('Core.scale', function() {
                                type: 'line',
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'x',
+                                               x: {
                                                        type: 'linear',
                                                        ticks: {
                                                                z: 10
@@ -571,7 +552,7 @@ describe('Core.scale', function() {
                                                        gridLines: {
                                                                z: 11
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -595,16 +576,16 @@ describe('Core.scale', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
+                                               x{
                                                        id: 'x',
                                                        type: 'linear',
                                                        min: -20,
                                                        max: 20
-                                               }],
-                                               yAxes: [{
+                                               },
+                                               y{
                                                        id: 'y',
                                                        type: 'linear'
-                                               }]
+                                               }
                                        }
                                }
                        });
index 459a9869b0c428505612d037412a1563e136bda4..26b260d0cfbadaacd2bb10f89879d50f1b9d0b26 100644 (file)
@@ -25,7 +25,7 @@ describe('Test tick generators', function() {
                                        display: false,
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'linear',
                                                position: 'bottom',
                                                ticks: {
@@ -33,21 +33,21 @@ describe('Test tick generators', function() {
                                                                return value.toString();
                                                        }
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'linear',
                                                ticks: {
                                                        callback: function(value) {
                                                                return value.toString();
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var xLabels = getLabels(chart.scales['x-axis-0']);
-               var yLabels = getLabels(chart.scales['y-axis-0']);
+               var xLabels = getLabels(chart.scales.x);
+               var yLabels = getLabels(chart.scales.y);
 
                expect(xLabels).toEqual(['0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1']);
                expect(yLabels).toEqual(['1', '0.9', '0.8', '0.7', '0.6', '0.5', '0.4', '0.3', '0.2', '0.1', '0']);
@@ -66,7 +66,7 @@ describe('Test tick generators', function() {
                                        display: false,
                                },
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'logarithmic',
                                                position: 'bottom',
                                                min: 0.1,
@@ -76,8 +76,8 @@ describe('Test tick generators', function() {
                                                                return value.toString();
                                                        }
                                                }
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                type: 'logarithmic',
                                                min: 0.1,
                                                max: 1,
@@ -86,13 +86,13 @@ describe('Test tick generators', function() {
                                                                return value.toString();
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var xLabels = getLabels(chart.scales['x-axis-0']);
-               var yLabels = getLabels(chart.scales['y-axis-0']);
+               var xLabels = getLabels(chart.scales.x);
+               var yLabels = getLabels(chart.scales.y);
 
                expect(xLabels).toEqual(['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1']);
                expect(yLabels).toEqual(['1', '0.9', '0.8', '0.7', '0.6', '0.5', '0.4', '0.3', '0.2', '0.1']);
index ca7c9e8e92537763d5ecd6b7d6b720818adce30a..5485f137e016241f7999352ac5ee57fe42ecc5a1 100644 (file)
@@ -147,11 +147,10 @@ describe('Category scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'x',
+                                       x: {
                                                type: 'category',
                                                labels: labels
-                                       }]
+                                       }
                                }
                        }
                });
@@ -165,28 +164,26 @@ describe('Category scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [10, 5, 0, 25, 78]
                                }],
                                labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick5']
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'category',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var scale = chart.scales.xScale0;
+               var scale = chart.scales.x;
 
                expect(scale.getLabelForValue(1)).toBe('tick2');
        });
@@ -196,28 +193,26 @@ describe('Category scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [10, 5, 0, 25, 78]
                                }],
                                labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick_last']
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'category',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
+               var xScale = chart.scales.x;
                expect(xScale.getPixelForValue(0)).toBeCloseToPixel(23 + 6); // plus lineHeight
                expect(xScale.getValueForPixel(23)).toBe(0);
 
@@ -239,28 +234,26 @@ describe('Category scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [10, 5, 0, 25, 78]
                                }],
                                labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick_last']
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'category',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
+               var xScale = chart.scales.x;
                expect(xScale.getPixelForValue('tick1')).toBeCloseToPixel(23 + 6); // plus lineHeight
        });
 
@@ -269,30 +262,28 @@ describe('Category scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [10, 5, 0, 25, 78]
                                }],
                                labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick_last']
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'category',
                                                position: 'bottom',
                                                min: 'tick2',
                                                max: 'tick4'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
+               var xScale = chart.scales.x;
                expect(xScale.getPixelForValue(1)).toBeCloseToPixel(23 + 6); // plus lineHeight
                expect(xScale.getPixelForValue(3)).toBeCloseToPixel(496);
 
@@ -308,8 +299,8 @@ describe('Category scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: ['3', '5', '1', '4', '2']
                                }],
                                labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick5'],
@@ -317,21 +308,19 @@ describe('Category scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'category',
                                                position: 'bottom',
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'category',
                                                position: 'left'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var yScale = chart.scales.yScale0;
+               var yScale = chart.scales.y;
                expect(yScale.getPixelForValue(0)).toBeCloseToPixel(32);
                expect(yScale.getValueForPixel(257)).toBe(2);
 
@@ -353,8 +342,8 @@ describe('Category scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: ['3', '5', '1', '4', '2']
                                }],
                                labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick5'],
@@ -362,23 +351,21 @@ describe('Category scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'category',
                                                position: 'bottom',
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'category',
                                                position: 'left',
                                                min: '2',
                                                max: '4'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var yScale = chart.scales.yScale0;
+               var yScale = chart.scales.y;
 
                expect(yScale.getPixelForValue(1)).toBeCloseToPixel(32);
                expect(yScale.getPixelForValue(3)).toBeCloseToPixel(482);
@@ -395,8 +382,8 @@ describe('Category scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [
                                                {x: 0, y: 10},
                                                {x: 1, y: 5},
@@ -409,20 +396,18 @@ describe('Category scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'category',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
+               var xScale = chart.scales.x;
                expect(xScale.getPixelForValue(0)).toBeCloseToPixel(29);
                expect(xScale.getPixelForValue(3)).toBeCloseToPixel(506);
                expect(xScale.getPixelForValue(4)).toBeCloseToPixel(664);
@@ -433,8 +418,8 @@ describe('Category scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [
                                                {x: 0, y: 2},
                                                {x: 1, y: 4},
@@ -448,21 +433,19 @@ describe('Category scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'category',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'category',
                                                position: 'left'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var yScale = chart.scales.yScale0;
+               var yScale = chart.scales.y;
                expect(yScale.getPixelForValue(0)).toBeCloseToPixel(32);
                expect(yScale.getPixelForValue(4)).toBeCloseToPixel(481);
        });
@@ -472,8 +455,8 @@ describe('Category scale tests', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [
                                                {x: 0, y: 10},
                                                {x: 1, y: 5},
@@ -486,20 +469,18 @@ describe('Category scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'category',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
+               var xScale = chart.scales.x;
                expect(xScale.getPixelForValue(0)).toBeCloseToPixel(89);
                expect(xScale.getPixelForValue(3)).toBeCloseToPixel(449);
                expect(xScale.getPixelForValue(4)).toBeCloseToPixel(569);
@@ -510,8 +491,8 @@ describe('Category scale tests', function() {
                        type: 'horizontalBar',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [
                                                {x: 10, y: 0},
                                                {x: 5, y: 1},
@@ -524,20 +505,18 @@ describe('Category scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'linear',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'category'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var yScale = chart.scales.yScale0;
+               var yScale = chart.scales.y;
                expect(yScale.getPixelForValue(0)).toBeCloseToPixel(88);
                expect(yScale.getPixelForValue(3)).toBeCloseToPixel(426);
                expect(yScale.getPixelForValue(4)).toBeCloseToPixel(538);
index 9a7c44fbadd414707d850aef24a57687da6d56b9..459db671c5777214252180900111959c73d9f548 100644 (file)
@@ -53,33 +53,33 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 5, 0, -5, 78, -100]
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y2',
                                        data: [-1000, 1000],
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [150]
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e', 'f']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear'
-                                       }, {
-                                               id: 'yScale1',
-                                               type: 'linear'
-                                       }]
+                                       },
+                                       y2: {
+                                               type: 'linear',
+                                               position: 'right',
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(-100);
-               expect(chart.scales.yScale0.max).toBe(150);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(-100);
+               expect(chart.scales.y.max).toBe(150);
        });
 
        it('Should correctly determine the max & min of string data values', function() {
@@ -87,33 +87,33 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: ['10', '5', '0', '-5', '78', '-100']
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y2',
                                        data: ['-1000', '1000'],
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: ['150']
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e', 'f']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear'
-                                       }, {
-                                               id: 'yScale1',
-                                               type: 'linear'
-                                       }]
+                                       },
+                                       y2: {
+                                               type: 'linear',
+                                               position: 'right'
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(-100);
-               expect(chart.scales.yScale0.max).toBe(150);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(-100);
+               expect(chart.scales.y.max).toBe(150);
        });
 
        it('Should correctly determine the max & min when no values provided and suggested minimum and maximum are set', function() {
@@ -121,26 +121,25 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: []
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e', 'f']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                suggestedMin: -10,
                                                suggestedMax: 15
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(-10);
-               expect(chart.scales.yScale0.max).toBe(15);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(-10);
+               expect(chart.scales.y.max).toBe(15);
        });
 
        it('Should correctly determine the max & min data values ignoring hidden datasets', function() {
@@ -148,13 +147,13 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: ['10', '5', '0', '-5', '78', '-100']
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y2',
                                        data: ['-1000', '1000'],
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: ['150'],
                                        hidden: true
                                }],
@@ -162,20 +161,20 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear'
-                                       }, {
-                                               id: 'yScale1',
+                                       },
+                                       y2: {
+                                               position: 'right',
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(-100);
-               expect(chart.scales.yScale0.max).toBe(80);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(-100);
+               expect(chart.scales.y.max).toBe(80);
        });
 
        it('Should correctly determine the max & min data values ignoring data that is NaN', function() {
@@ -183,30 +182,29 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [null, 90, NaN, undefined, 45, 30, Infinity, -Infinity]
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0.min).toBe(30);
-               expect(chart.scales.yScale0.max).toBe(90);
+               expect(chart.scales.y.min).toBe(30);
+               expect(chart.scales.y.max).toBe(90);
 
                // Scale is now stacked
-               chart.scales.yScale0.options.stacked = true;
+               chart.scales.y.options.stacked = true;
                chart.update();
 
-               expect(chart.scales.yScale0.min).toBe(0);
-               expect(chart.scales.yScale0.max).toBe(90);
+               expect(chart.scales.y.min).toBe(0);
+               expect(chart.scales.y.max).toBe(90);
        });
 
        it('Should correctly determine the max & min data values for small numbers', function() {
@@ -214,24 +212,23 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [-1e-8, 3e-8, -4e-8, 6e-8]
                                }],
                                labels: ['a', 'b', 'c', 'd']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min * 1e8).toBeCloseTo(-4);
-               expect(chart.scales.yScale0.max * 1e8).toBeCloseTo(6);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min * 1e8).toBeCloseTo(-4);
+               expect(chart.scales.y.max * 1e8).toBeCloseTo(6);
        });
 
        it('Should correctly determine the max & min for scatter data', function() {
@@ -239,8 +236,8 @@ describe('Linear Scale', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [{
                                                x: 10,
                                                y: 100
@@ -258,24 +255,22 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'linear',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
                chart.update();
 
-               expect(chart.scales.xScale0.min).toBe(-20);
-               expect(chart.scales.xScale0.max).toBe(100);
-               expect(chart.scales.yScale0.min).toBe(0);
-               expect(chart.scales.yScale0.max).toBe(100);
+               expect(chart.scales.x.min).toBe(-20);
+               expect(chart.scales.x.max).toBe(100);
+               expect(chart.scales.y.min).toBe(0);
+               expect(chart.scales.y.max).toBe(100);
        });
 
        it('Should correctly get the label for the given index', function() {
@@ -283,8 +278,8 @@ describe('Linear Scale', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [{
                                                x: 10,
                                                y: 100
@@ -302,21 +297,19 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'linear',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
                chart.update();
 
-               expect(chart.scales.yScale0.getLabelForValue(7)).toBe(7);
+               expect(chart.scales.y.getLabelForValue(7)).toBe(7);
        });
 
        it('Should correctly determine the min and max data values when stacked mode is turned on', function() {
@@ -324,18 +317,18 @@ describe('Linear Scale', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 5, 0, -5, 78, -100],
                                        type: 'bar'
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y2',
                                        data: [-1000, 1000],
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [150, 0, 0, -100, -10, 9],
                                        type: 'bar'
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 10, 10, 10, 10, 10],
                                        type: 'line'
                                }],
@@ -343,21 +336,21 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                stacked: true
-                                       }, {
-                                               id: 'yScale1',
+                                       },
+                                       y2: {
+                                               position: 'right',
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
                chart.update();
 
-               expect(chart.scales.yScale0.min).toBe(-150);
-               expect(chart.scales.yScale0.max).toBe(200);
+               expect(chart.scales.y.min).toBe(-150);
+               expect(chart.scales.y.max).toBe(200);
        });
 
        it('Should correctly determine the min and max data values when stacked mode is turned on and there are hidden datasets', function() {
@@ -365,16 +358,16 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 5, 0, -5, 78, -100],
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y2',
                                        data: [-1000, 1000],
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [150, 0, 0, -100, -10, 9],
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 20, 30, 40, 50, 60],
                                        hidden: true
                                }],
@@ -382,21 +375,21 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                stacked: true
-                                       }, {
-                                               id: 'yScale1',
+                                       },
+                                       y2: {
+                                               position: 'right',
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
                chart.update();
 
-               expect(chart.scales.yScale0.min).toBe(-150);
-               expect(chart.scales.yScale0.max).toBe(200);
+               expect(chart.scales.y.min).toBe(-150);
+               expect(chart.scales.y.max).toBe(200);
        });
 
        it('Should correctly determine the min and max data values when stacked mode is turned on there are multiple types of datasets', function() {
@@ -404,7 +397,7 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        type: 'bar',
                                        data: [10, 5, 0, -5, 78, -100]
                                }, {
@@ -418,18 +411,17 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
 
-               chart.scales.yScale0.determineDataLimits();
-               expect(chart.scales.yScale0.min).toBe(-105);
-               expect(chart.scales.yScale0.max).toBe(160);
+               chart.scales.y.determineDataLimits();
+               expect(chart.scales.y.min).toBe(-105);
+               expect(chart.scales.y.max).toBe(160);
        });
 
        it('Should ensure that the scale has a max and min that are not equal', function() {
@@ -441,17 +433,16 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(0);
-               expect(chart.scales.yScale0.max).toBe(1);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(0);
+               expect(chart.scales.y.max).toBe(1);
        });
 
        it('Should ensure that the scale has a max and min that are not equal when beginAtZero is set', function() {
@@ -463,18 +454,17 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                beginAtZero: true
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(0);
-               expect(chart.scales.yScale0.max).toBe(1);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(0);
+               expect(chart.scales.y.max).toBe(1);
        });
 
        it('Should use the suggestedMin and suggestedMax options', function() {
@@ -482,26 +472,25 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [1, 1, 1, 2, 1, 0]
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e', 'f']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                suggestedMax: 10,
                                                suggestedMin: -10
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(-10);
-               expect(chart.scales.yScale0.max).toBe(10);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(-10);
+               expect(chart.scales.y.max).toBe(10);
        });
 
        it('Should use the min and max options', function() {
@@ -509,27 +498,26 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [1, 1, 1, 2, 1, 0]
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e', 'f']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                max: 1010,
                                                min: -1010
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(-1010);
-               expect(chart.scales.yScale0.max).toBe(1010);
-               var labels = getLabels(chart.scales.yScale0);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(-1010);
+               expect(chart.scales.y.max).toBe(1010);
+               var labels = getLabels(chart.scales.y);
                expect(labels[0]).toBe('1010');
                expect(labels[labels.length - 1]).toBe('-1010');
        });
@@ -539,30 +527,29 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 3, 6, 8, 3, 1]
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e', 'f']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                min: 1,
                                                max: 11,
                                                ticks: {
                                                        stepSize: 2
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(1);
-               expect(chart.scales.yScale0.max).toBe(11);
-               expect(getLabels(chart.scales.yScale0)).toEqual(['11', '10', '8', '6', '4', '2', '1']);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(1);
+               expect(chart.scales.y.max).toBe(11);
+               expect(getLabels(chart.scales.y)).toEqual(['11', '10', '8', '6', '4', '2', '1']);
        });
 
        it('Should create decimal steps if stepSize is a decimal number', function() {
@@ -570,28 +557,27 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 3, 6, 8, 3, 1]
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e', 'f']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                ticks: {
                                                        stepSize: 2.5
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(0);
-               expect(chart.scales.yScale0.max).toBe(10);
-               expect(getLabels(chart.scales.yScale0)).toEqual(['10', '7.5', '5', '2.5', '0']);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(0);
+               expect(chart.scales.y.max).toBe(10);
+               expect(getLabels(chart.scales.y)).toEqual(['10', '7.5', '5', '2.5', '0']);
        });
 
        describe('precision', function() {
@@ -600,28 +586,27 @@ describe('Linear Scale', function() {
                                type: 'bar',
                                data: {
                                        datasets: [{
-                                               yAxisID: 'yScale0',
+                                               yAxisID: 'y',
                                                data: [0, 1, 2, 1, 0, 1]
                                        }],
                                        labels: ['a', 'b', 'c', 'd', 'e', 'f']
                                },
                                options: {
                                        scales: {
-                                               yAxes: [{
-                                                       id: 'yScale0',
+                                               y: {
                                                        type: 'linear',
                                                        ticks: {
                                                                precision: 0
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
 
-                       expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-                       expect(chart.scales.yScale0.min).toBe(0);
-                       expect(chart.scales.yScale0.max).toBe(2);
-                       expect(getLabels(chart.scales.yScale0)).toEqual(['2', '1', '0']);
+                       expect(chart.scales.y).not.toEqual(undefined); // must construct
+                       expect(chart.scales.y.min).toBe(0);
+                       expect(chart.scales.y.max).toBe(2);
+                       expect(getLabels(chart.scales.y)).toEqual(['2', '1', '0']);
                });
 
                it('Should round the step size to the given number of decimal places', function() {
@@ -629,28 +614,27 @@ describe('Linear Scale', function() {
                                type: 'bar',
                                data: {
                                        datasets: [{
-                                               yAxisID: 'yScale0',
+                                               yAxisID: 'y',
                                                data: [0, 0.001, 0.002, 0.003, 0, 0.001]
                                        }],
                                        labels: ['a', 'b', 'c', 'd', 'e', 'f']
                                },
                                options: {
                                        scales: {
-                                               yAxes: [{
-                                                       id: 'yScale0',
+                                               y: {
                                                        type: 'linear',
                                                        ticks: {
                                                                precision: 2
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
 
-                       expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-                       expect(chart.scales.yScale0.min).toBe(0);
-                       expect(chart.scales.yScale0.max).toBe(0.01);
-                       expect(getLabels(chart.scales.yScale0)).toEqual(['0.01', '0']);
+                       expect(chart.scales.y).not.toEqual(undefined); // must construct
+                       expect(chart.scales.y.min).toBe(0);
+                       expect(chart.scales.y.max).toBe(0.01);
+                       expect(getLabels(chart.scales.y)).toEqual(['0.01', '0']);
                });
        });
 
@@ -660,35 +644,34 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [20, 30, 40, 50]
                                }],
                                labels: ['a', 'b', 'c', 'd']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(getLabels(chart.scales.yScale0)).toEqual(['50', '45', '40', '35', '30', '25', '20']);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(getLabels(chart.scales.y)).toEqual(['50', '45', '40', '35', '30', '25', '20']);
 
-               chart.scales.yScale0.options.beginAtZero = true;
+               chart.scales.y.options.beginAtZero = true;
                chart.update();
-               expect(getLabels(chart.scales.yScale0)).toEqual(['50', '45', '40', '35', '30', '25', '20', '15', '10', '5', '0']);
+               expect(getLabels(chart.scales.y)).toEqual(['50', '45', '40', '35', '30', '25', '20', '15', '10', '5', '0']);
 
                chart.data.datasets[0].data = [-20, -30, -40, -50];
                chart.update();
-               expect(getLabels(chart.scales.yScale0)).toEqual(['0', '-5', '-10', '-15', '-20', '-25', '-30', '-35', '-40', '-45', '-50']);
+               expect(getLabels(chart.scales.y)).toEqual(['0', '-5', '-10', '-15', '-20', '-25', '-30', '-35', '-40', '-45', '-50']);
 
-               chart.scales.yScale0.options.beginAtZero = false;
+               chart.scales.y.options.beginAtZero = false;
                chart.update();
-               expect(getLabels(chart.scales.yScale0)).toEqual(['-20', '-25', '-30', '-35', '-40', '-45', '-50']);
+               expect(getLabels(chart.scales.y)).toEqual(['-20', '-25', '-30', '-35', '-40', '-45', '-50']);
        });
 
        it('Should generate tick marks in the correct order in reversed mode', function() {
@@ -696,25 +679,24 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 5, 0, 25, 78]
                                }],
                                labels: ['a', 'b', 'c', 'd']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                reverse: true
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(getLabels(chart.scales.yScale0)).toEqual(['0', '10', '20', '30', '40', '50', '60', '70', '80']);
-               expect(chart.scales.yScale0.start).toBe(80);
-               expect(chart.scales.yScale0.end).toBe(0);
+               expect(getLabels(chart.scales.y)).toEqual(['0', '10', '20', '30', '40', '50', '60', '70', '80']);
+               expect(chart.scales.y.start).toBe(80);
+               expect(chart.scales.y.end).toBe(0);
        });
 
        it('should use the correct number of decimal places in the default format function', function() {
@@ -722,21 +704,20 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [0.06, 0.005, 0, 0.025, 0.0078]
                                }],
                                labels: ['a', 'b', 'c', 'd']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
-                                       }]
+                                       }
                                }
                        }
                });
-               expect(getLabels(chart.scales.yScale0)).toEqual(['0.06', '0.05', '0.04', '0.03', '0.02', '0.01', '0']);
+               expect(getLabels(chart.scales.y)).toEqual(['0.06', '0.05', '0.04', '0.03', '0.02', '0.01', '0']);
        });
 
        it('Should correctly limit the maximum number of ticks', function() {
@@ -750,40 +731,38 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale'
-                                       }]
+                                       y: {}
                                }
                        }
                });
 
-               expect(getLabels(chart.scales.yScale)).toEqual(['2.5', '2.0', '1.5', '1.0', '0.5']);
+               expect(getLabels(chart.scales.y)).toEqual(['2.5', '2.0', '1.5', '1.0', '0.5']);
 
-               chart.options.scales.yAxes[0].ticks.maxTicksLimit = 11;
+               chart.options.scales.y.ticks.maxTicksLimit = 11;
                chart.update();
 
-               expect(getLabels(chart.scales.yScale)).toEqual(['2.5', '2.0', '1.5', '1.0', '0.5']);
+               expect(getLabels(chart.scales.y)).toEqual(['2.5', '2.0', '1.5', '1.0', '0.5']);
 
-               chart.options.scales.yAxes[0].ticks.maxTicksLimit = 21;
+               chart.options.scales.y.ticks.maxTicksLimit = 21;
                chart.update();
 
-               expect(getLabels(chart.scales.yScale)).toEqual([
+               expect(getLabels(chart.scales.y)).toEqual([
                        '2.5', '2.4', '2.3', '2.2', '2.1', '2.0', '1.9', '1.8', '1.7', '1.6',
                        '1.5', '1.4', '1.3', '1.2', '1.1', '1.0', '0.9', '0.8', '0.7', '0.6',
                        '0.5'
                ]);
 
-               chart.options.scales.yAxes[0].ticks.maxTicksLimit = 11;
-               chart.options.scales.yAxes[0].ticks.stepSize = 0.01;
+               chart.options.scales.y.ticks.maxTicksLimit = 11;
+               chart.options.scales.y.ticks.stepSize = 0.01;
                chart.update();
 
-               expect(getLabels(chart.scales.yScale)).toEqual(['2.5', '2.0', '1.5', '1.0', '0.5']);
+               expect(getLabels(chart.scales.y)).toEqual(['2.5', '2.0', '1.5', '1.0', '0.5']);
 
-               chart.options.scales.yAxes[0].min = 0.3;
-               chart.options.scales.yAxes[0].max = 2.8;
+               chart.options.scales.y.min = 0.3;
+               chart.options.scales.y.max = 2.8;
                chart.update();
 
-               expect(getLabels(chart.scales.yScale)).toEqual(['2.8', '2.5', '2.0', '1.5', '1.0', '0.5', '0.3']);
+               expect(getLabels(chart.scales.y)).toEqual(['2.8', '2.5', '2.0', '1.5', '1.0', '0.5', '0.3']);
        });
 
        it('Should build labels using the user supplied callback', function() {
@@ -791,28 +770,27 @@ describe('Linear Scale', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 5, 0, 25, 78]
                                }],
                                labels: ['a', 'b', 'c', 'd']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
                                                ticks: {
                                                        callback: function(value, index) {
                                                                return index.toString();
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
                // Just the index
-               expect(getLabels(chart.scales.yScale0)).toEqual(['0', '1', '2', '3', '4', '5', '6', '7', '8']);
+               expect(getLabels(chart.scales.y)).toEqual(['0', '1', '2', '3', '4', '5', '6', '7', '8']);
        });
 
        it('Should get the correct pixel value for a point', function() {
@@ -821,27 +799,25 @@ describe('Linear Scale', function() {
                        data: {
                                labels: [-1, 1],
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [-1, 1]
                                }],
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'linear',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
+               var xScale = chart.scales.x;
                expect(xScale.getPixelForValue(1)).toBeCloseToPixel(501); // right - paddingRight
                expect(xScale.getPixelForValue(-1)).toBeCloseToPixel(31 + 6); // left + paddingLeft + lineSpace
                expect(xScale.getPixelForValue(0)).toBeCloseToPixel(266 + 6 / 2); // halfway*/
@@ -850,7 +826,7 @@ describe('Linear Scale', function() {
                expect(xScale.getValueForPixel(31)).toBeCloseTo(-1, 1e-2);
                expect(xScale.getValueForPixel(266)).toBeCloseTo(0, 1e-2);
 
-               var yScale = chart.scales.yScale0;
+               var yScale = chart.scales.y;
                expect(yScale.getPixelForValue(1)).toBeCloseToPixel(32); // right - paddingRight
                expect(yScale.getPixelForValue(-1)).toBeCloseToPixel(484); // left + paddingLeft
                expect(yScale.getPixelForValue(0)).toBeCloseToPixel(258); // halfway*/
@@ -865,8 +841,8 @@ describe('Linear Scale', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [{
                                                x: 10,
                                                y: 100
@@ -884,21 +860,19 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'linear',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
-               var yScale = chart.scales.yScale0;
+               var xScale = chart.scales.x;
+               var yScale = chart.scales.y;
                expect(xScale.paddingTop).toBeCloseToPixel(0);
                expect(xScale.paddingBottom).toBeCloseToPixel(0);
                expect(xScale.paddingLeft).toBeCloseToPixel(12);
@@ -938,8 +912,8 @@ describe('Linear Scale', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
-                                       yAxisID: 'yScale0',
+                                       xAxisID: 'x',
+                                       yAxisID: 'y',
                                        data: [{
                                                x: 10,
                                                y: 100
@@ -957,13 +931,11 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'linear',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       },
+                                       y: {
                                                type: 'linear',
                                                gridLines: {
                                                        drawTicks: false,
@@ -977,12 +949,12 @@ describe('Linear Scale', function() {
                                                        display: false,
                                                        padding: 0
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var yScale = chart.scales.yScale0;
+               var yScale = chart.scales.y;
                expect(yScale.width).toBeCloseToPixel(0);
        });
 
@@ -1009,12 +981,12 @@ describe('Linear Scale', function() {
                        data: barData,
                        options: {
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                stacked: true
-                                       }],
-                                       yAxes: [{
+                                       },
+                                       y{
                                                stacked: true
-                                       }]
+                                       }
                                }
                        }
                });
@@ -1025,8 +997,8 @@ describe('Linear Scale', function() {
                        chart.update();
                });
 
-               expect(chart.scales['x-axis-0'].min).toEqual(0);
-               expect(chart.scales['x-axis-0'].max).toEqual(1);
+               expect(chart.scales.x.min).toEqual(0);
+               expect(chart.scales.x.max).toEqual(1);
        });
 
        it('max and min value should be valid when min is set and all datasets are hidden', function() {
@@ -1045,15 +1017,15 @@ describe('Linear Scale', function() {
                        data: barData,
                        options: {
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                min: 20
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales['x-axis-0'].min).toEqual(20);
-               expect(chart.scales['x-axis-0'].max).toEqual(21);
+               expect(chart.scales.x.min).toEqual(20);
+               expect(chart.scales.x.max).toEqual(21);
        });
 
        it('min settings should be used if set to zero', function() {
@@ -1071,15 +1043,15 @@ describe('Linear Scale', function() {
                        data: barData,
                        options: {
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                min: 0,
                                                max: 3000
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales['x-axis-0'].min).toEqual(0);
+               expect(chart.scales.x.min).toEqual(0);
        });
 
        it('max settings should be used if set to zero', function() {
@@ -1097,15 +1069,15 @@ describe('Linear Scale', function() {
                        data: barData,
                        options: {
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                min: -3000,
                                                max: 0
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales['x-axis-0'].max).toEqual(0);
+               expect(chart.scales.x.max).toEqual(0);
        });
 
        it('Should generate max and min that are not equal when data contains values that are very close to each other', function() {
@@ -1121,16 +1093,15 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'linear',
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.max).toBeGreaterThan(chart.scales.yScale0.min);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.max).toBeGreaterThan(chart.scales.y.min);
        });
 
        it('Should get correct pixel values when horizontal', function() {
@@ -1143,10 +1114,9 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'x',
+                                       x: {
                                                type: 'linear',
-                                       }]
+                                       }
                                }
                        }
                });
@@ -1184,10 +1154,9 @@ describe('Linear Scale', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'y',
+                                       y: {
                                                type: 'linear',
-                                       }]
+                                       }
                                }
                        }
                });
index 878ea545fdd3abde34e99b6b928f6bf782372cb7..599dfd38e5e3f25d31c5b31ae57e1766649e3ea2 100644 (file)
@@ -54,57 +54,60 @@ describe('Logarithmic Scale tests', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [42, 1000, 64, 100],
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: [10, 5, 5000, 78, 450]
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: [150]
                                }, {
-                                       yAxisID: 'yScale2',
+                                       yAxisID: 'y2',
                                        data: [20, 0, 150, 1800, 3040]
                                }, {
-                                       yAxisID: 'yScale3',
+                                       yAxisID: 'y3',
                                        data: [67, 0.0004, 0, 820, 0.001]
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y{
+                                               id: 'y',
                                                type: 'logarithmic'
-                                       }, {
-                                               id: 'yScale1',
-                                               type: 'logarithmic'
-                                       }, {
-                                               id: 'yScale2',
-                                               type: 'logarithmic'
-                                       }, {
-                                               id: 'yScale3',
+                                       },
+                                       y1: {
+                                               type: 'logarithmic',
+                                               position: 'right'
+                                       },
+                                       y2: {
+                                               type: 'logarithmic',
+                                               position: 'right'
+                                       },
+                                       y3: {
+                                               position: 'right',
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(10);
-               expect(chart.scales.yScale0.max).toBe(1000);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(10);
+               expect(chart.scales.y.max).toBe(1000);
 
-               expect(chart.scales.yScale1).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale1.min).toBe(1);
-               expect(chart.scales.yScale1.max).toBe(5000);
+               expect(chart.scales.y1).not.toEqual(undefined); // must construct
+               expect(chart.scales.y1.min).toBe(1);
+               expect(chart.scales.y1.max).toBe(5000);
 
-               expect(chart.scales.yScale2).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale2.min).toBe(0);
-               expect(chart.scales.yScale2.max).toBe(4000);
+               expect(chart.scales.y2).not.toEqual(undefined); // must construct
+               expect(chart.scales.y2.min).toBe(0);
+               expect(chart.scales.y2.max).toBe(4000);
 
-               expect(chart.scales.yScale3).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale3.min).toBe(0);
-               expect(chart.scales.yScale3.max).toBe(900);
+               expect(chart.scales.y3).not.toEqual(undefined); // must construct
+               expect(chart.scales.y3.min).toBe(0);
+               expect(chart.scales.y3.max).toBe(900);
        });
 
        it('should correctly determine the max & min of string data values', function() {
@@ -112,57 +115,59 @@ describe('Logarithmic Scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: ['42', '1000', '64', '100'],
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: ['10', '5', '5000', '78', '450']
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: ['150']
                                }, {
-                                       yAxisID: 'yScale2',
+                                       yAxisID: 'y2',
                                        data: ['20', '0', '150', '1800', '3040']
                                }, {
-                                       yAxisID: 'yScale3',
+                                       yAxisID: 'y3',
                                        data: ['67', '0.0004', '0', '820', '0.001']
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'logarithmic'
-                                       }, {
-                                               id: 'yScale1',
+                                       },
+                                       y1: {
+                                               position: 'right',
                                                type: 'logarithmic'
-                                       }, {
-                                               id: 'yScale2',
+                                       },
+                                       y2: {
+                                               position: 'right',
                                                type: 'logarithmic'
-                                       }, {
-                                               id: 'yScale3',
+                                       },
+                                       y3: {
+                                               position: 'right',
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(10);
-               expect(chart.scales.yScale0.max).toBe(1000);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(10);
+               expect(chart.scales.y.max).toBe(1000);
 
-               expect(chart.scales.yScale1).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale1.min).toBe(1);
-               expect(chart.scales.yScale1.max).toBe(5000);
+               expect(chart.scales.y1).not.toEqual(undefined); // must construct
+               expect(chart.scales.y1.min).toBe(1);
+               expect(chart.scales.y1.max).toBe(5000);
 
-               expect(chart.scales.yScale2).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale2.min).toBe(0);
-               expect(chart.scales.yScale2.max).toBe(4000);
+               expect(chart.scales.y2).not.toEqual(undefined); // must construct
+               expect(chart.scales.y2.min).toBe(0);
+               expect(chart.scales.y2.max).toBe(4000);
 
-               expect(chart.scales.yScale3).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale3.min).toBe(0);
-               expect(chart.scales.yScale3.max).toBe(900);
+               expect(chart.scales.y3).not.toEqual(undefined); // must construct
+               expect(chart.scales.y3.min).toBe(0);
+               expect(chart.scales.y3.max).toBe(900);
        });
 
        it('should correctly determine the max & min data values when there are hidden datasets', function() {
@@ -170,20 +175,20 @@ describe('Logarithmic Scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: [10, 5, 5000, 78, 450]
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [42, 1000, 64, 100],
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: [50000],
                                        hidden: true
                                }, {
-                                       yAxisID: 'yScale2',
+                                       yAxisID: 'y2',
                                        data: [20, 0, 7400, 14, 291]
                                }, {
-                                       yAxisID: 'yScale2',
+                                       yAxisID: 'y2',
                                        data: [6, 0.0007, 9, 890, 60000],
                                        hidden: true
                                }],
@@ -191,27 +196,28 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'logarithmic'
-                                       }, {
-                                               id: 'yScale1',
+                                       },
+                                       y1: {
+                                               position: 'right',
                                                type: 'logarithmic'
-                                       }, {
-                                               id: 'yScale2',
+                                       },
+                                       y2: {
+                                               position: 'right',
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale1).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale1.min).toBe(1);
-               expect(chart.scales.yScale1.max).toBe(5000);
+               expect(chart.scales.y1).not.toEqual(undefined); // must construct
+               expect(chart.scales.y1.min).toBe(1);
+               expect(chart.scales.y1.max).toBe(5000);
 
-               expect(chart.scales.yScale2).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale2.min).toBe(0);
-               expect(chart.scales.yScale2.max).toBe(8000);
+               expect(chart.scales.y2).not.toEqual(undefined); // must construct
+               expect(chart.scales.y2.min).toBe(0);
+               expect(chart.scales.y2.max).toBe(8000);
        });
 
        it('should correctly determine the max & min data values when there is NaN data', function() {
@@ -219,47 +225,47 @@ describe('Logarithmic Scale tests', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [undefined, 10, null, 5, 5000, NaN, 78, 450]
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [undefined, 28, null, 1000, 500, NaN, 50, 42, Infinity, -Infinity]
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: [undefined, 30, null, 9400, 0, NaN, 54, 836]
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: [undefined, 0, null, 800, 9, NaN, 894, 21]
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'logarithmic'
-                                       }, {
-                                               id: 'yScale1',
+                                       },
+                                       y1: {
+                                               position: 'right',
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale0.min).toBe(1);
-               expect(chart.scales.yScale0.max).toBe(5000);
+               expect(chart.scales.y).not.toEqual(undefined); // must construct
+               expect(chart.scales.y.min).toBe(1);
+               expect(chart.scales.y.max).toBe(5000);
 
                // Turn on stacked mode since it uses it's own
-               chart.options.scales.yAxes[0].stacked = true;
+               chart.options.scales.y.stacked = true;
                chart.update();
 
-               expect(chart.scales.yScale0.min).toBe(10);
-               expect(chart.scales.yScale0.max).toBe(6000);
+               expect(chart.scales.y.min).toBe(10);
+               expect(chart.scales.y.max).toBe(6000);
 
-               expect(chart.scales.yScale1).not.toEqual(undefined); // must construct
-               expect(chart.scales.yScale1.min).toBe(0);
-               expect(chart.scales.yScale1.max).toBe(10000);
+               expect(chart.scales.y1).not.toEqual(undefined); // must construct
+               expect(chart.scales.y1.min).toBe(0);
+               expect(chart.scales.y1.max).toBe(10000);
        });
 
        it('should correctly determine the max & min for scatter data', function() {
@@ -277,24 +283,22 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale',
+                                       x: {
                                                type: 'logarithmic',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       },
+                                       y: {
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.xScale.min).toBe(1);
-               expect(chart.scales.xScale.max).toBe(100);
+               expect(chart.scales.x.min).toBe(1);
+               expect(chart.scales.x.max).toBe(100);
 
-               expect(chart.scales.yScale.min).toBe(1);
-               expect(chart.scales.yScale.max).toBe(200);
+               expect(chart.scales.y.min).toBe(1);
+               expect(chart.scales.y.max).toBe(200);
        });
 
        it('should correctly determine the max & min for scatter data when 0 values are present', function() {
@@ -312,24 +316,22 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale',
+                                       x: {
                                                type: 'logarithmic',
                                                position: 'bottom'
-                                       }],
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       },
+                                       y: {
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.xScale.min).toBe(0);
-               expect(chart.scales.xScale.max).toBe(300);
+               expect(chart.scales.x.min).toBe(0);
+               expect(chart.scales.x.max).toBe(300);
 
-               expect(chart.scales.yScale.min).toBe(0);
-               expect(chart.scales.yScale.max).toBe(1000);
+               expect(chart.scales.y.min).toBe(0);
+               expect(chart.scales.y.max).toBe(1000);
        });
 
        it('should correctly determine the min and max data values when stacked mode is turned on', function() {
@@ -338,38 +340,38 @@ describe('Logarithmic Scale tests', function() {
                        data: {
                                datasets: [{
                                        type: 'bar',
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 5, 1, 5, 78, 100]
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: [0, 1000],
                                }, {
                                        type: 'bar',
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [150, 10, 10, 100, 10, 9]
                                }, {
                                        type: 'line',
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [100, 100, 100, 100, 100, 100]
                                }],
                                labels: ['a', 'b', 'c', 'd', 'e', 'f']
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'logarithmic',
                                                stacked: true
-                                       }, {
-                                               id: 'yScale1',
+                                       },
+                                       y1: {
+                                               position: 'right',
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0.min).toBe(10);
-               expect(chart.scales.yScale0.max).toBe(200);
+               expect(chart.scales.y.min).toBe(10);
+               expect(chart.scales.y.max).toBe(200);
        });
 
        it('should correctly determine the min and max data values when stacked mode is turned on ignoring hidden datasets', function() {
@@ -377,19 +379,19 @@ describe('Logarithmic Scale tests', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 5, 1, 5, 78, 100],
                                        type: 'bar'
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: [0, 1000],
                                        type: 'bar'
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [150, 10, 10, 100, 10, 9],
                                        type: 'bar'
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10000, 10000, 10000, 10000, 10000, 10000],
                                        hidden: true,
                                        type: 'bar'
@@ -398,20 +400,20 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'logarithmic',
                                                stacked: true
-                                       }, {
-                                               id: 'yScale1',
+                                       },
+                                       y1: {
+                                               position: 'right',
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0.min).toBe(10);
-               expect(chart.scales.yScale0.max).toBe(200);
+               expect(chart.scales.y.min).toBe(10);
+               expect(chart.scales.y.max).toBe(200);
        });
 
        it('should ensure that the scale has a max and min that are not equal', function() {
@@ -425,22 +427,21 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       y: {
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale.min).toBe(1);
-               expect(chart.scales.yScale.max).toBe(10);
+               expect(chart.scales.y.min).toBe(1);
+               expect(chart.scales.y.max).toBe(10);
 
                chart.data.datasets[0].data = [0.15, 0.15];
                chart.update();
 
-               expect(chart.scales.yScale.min).toBe(0.01);
-               expect(chart.scales.yScale.max).toBe(1);
+               expect(chart.scales.y.min).toBe(0.01);
+               expect(chart.scales.y.max).toBe(1);
        });
 
        it('should use the min and max options', function() {
@@ -454,8 +455,7 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       y: {
                                                type: 'logarithmic',
                                                min: 10,
                                                max: 1010,
@@ -464,12 +464,12 @@ describe('Logarithmic Scale tests', function() {
                                                                return value;
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var yScale = chart.scales.yScale;
+               var yScale = chart.scales.y;
                var tickCount = yScale.ticks.length;
                expect(yScale.min).toBe(10);
                expect(yScale.max).toBe(1010);
@@ -488,8 +488,7 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       y: {
                                                type: 'logarithmic',
                                                min: -10,
                                                max: -1010,
@@ -498,14 +497,14 @@ describe('Logarithmic Scale tests', function() {
                                                                return value;
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var yScale = chart.scales.yScale;
-               expect(yScale.min).toBe(0);
-               expect(yScale.max).toBe(2);
+               var y = chart.scales.y;
+               expect(y.min).toBe(0);
+               expect(y.max).toBe(2);
        });
 
        it('should ignore invalid min and max options', function() {
@@ -519,8 +518,7 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       y: {
                                                type: 'logarithmic',
                                                min: 'zero',
                                                max: null,
@@ -529,14 +527,14 @@ describe('Logarithmic Scale tests', function() {
                                                                return value;
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var yScale = chart.scales.yScale;
-               expect(yScale.min).toBe(0);
-               expect(yScale.max).toBe(2);
+               var y = chart.scales.y;
+               expect(y.min).toBe(0);
+               expect(y.max).toBe(2);
        });
 
        it('should generate tick marks', function() {
@@ -550,21 +548,20 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       y: {
                                                type: 'logarithmic',
                                                ticks: {
                                                        callback: function(value) {
                                                                return value;
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
                // Counts down because the lines are drawn top to bottom
-               var scale = chart.scales.yScale;
+               var scale = chart.scales.y;
                expect(getLabels(scale)).toEqual([80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]);
                expect(scale.start).toEqual(1);
                expect(scale.end).toEqual(80);
@@ -581,20 +578,19 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       y: {
                                                type: 'logarithmic',
                                                ticks: {
                                                        callback: function(value) {
                                                                return value;
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var scale = chart.scales.yScale;
+               var scale = chart.scales.y;
                // Counts down because the lines are drawn top to bottom
                expect(getLabels(scale)).toEqual([30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0.9, 0.8, 0]);
                expect(scale.start).toEqual(0);
@@ -613,8 +609,7 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       y: {
                                                type: 'logarithmic',
                                                reverse: true,
                                                ticks: {
@@ -622,12 +617,12 @@ describe('Logarithmic Scale tests', function() {
                                                                return value;
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var scale = chart.scales.yScale;
+               var scale = chart.scales.y;
                expect(getLabels(scale)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80]);
                expect(scale.start).toEqual(80);
                expect(scale.end).toEqual(1);
@@ -644,8 +639,7 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       y: {
                                                type: 'logarithmic',
                                                reverse: true,
                                                ticks: {
@@ -653,12 +647,12 @@ describe('Logarithmic Scale tests', function() {
                                                                return value;
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var scale = chart.scales.yScale;
+               var scale = chart.scales.y;
                expect(getLabels(scale)).toEqual([0, 9, 10, 20, 30]);
                expect(scale.start).toEqual(30);
                expect(scale.end).toEqual(0);
@@ -675,15 +669,14 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       y: {
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(getLabels(chart.scales.yScale)).toEqual(['8e+1', '', '', '5e+1', '', '', '2e+1', '1e+1', '', '', '', '', '5e+0', '', '', '2e+0', '1e+0', '0']);
+               expect(getLabels(chart.scales.y)).toEqual(['8e+1', '', '', '5e+1', '', '', '2e+1', '1e+1', '', '', '', '', '5e+0', '', '', '2e+0', '1e+0', '0']);
        });
 
        it('should build labels using the user supplied callback', function() {
@@ -697,21 +690,20 @@ describe('Logarithmic Scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale',
+                                       y: {
                                                type: 'logarithmic',
                                                ticks: {
                                                        callback: function(value, index) {
                                                                return index.toString();
                                                        }
                                                }
-                                       }]
+                                       }
                                }
                        }
                });
 
                // Just the index
-               expect(getLabels(chart.scales.yScale)).toEqual(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16']);
+               expect(getLabels(chart.scales.y)).toEqual(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16']);
        });
 
        it('should correctly get the correct label for a data item', function() {
@@ -719,31 +711,31 @@ describe('Logarithmic Scale tests', function() {
                        type: 'bar',
                        data: {
                                datasets: [{
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [10, 5, 5000, 78, 450]
                                }, {
-                                       yAxisID: 'yScale1',
+                                       yAxisID: 'y1',
                                        data: [1, 1000, 10, 100],
                                }, {
-                                       yAxisID: 'yScale0',
+                                       yAxisID: 'y',
                                        data: [150]
                                }],
                                labels: []
                        },
                        options: {
                                scales: {
-                                       yAxes: [{
-                                               id: 'yScale0',
+                                       y: {
                                                type: 'logarithmic'
-                                       }, {
-                                               id: 'yScale1',
+                                       },
+                                       y1: {
+                                               position: 'right',
                                                type: 'logarithmic'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               expect(chart.scales.yScale0.getLabelForValue(150)).toBe(150);
+               expect(chart.scales.y.getLabelForValue(150)).toBe(150);
        });
 
        describe('when', function() {
@@ -780,9 +772,9 @@ describe('Logarithmic Scale tests', function() {
                        {
                                axis: 'y',
                                scale: {
-                                       yAxes: [{
+                                       y{
                                                min: 0
-                                       }]
+                                       }
                                },
                                firstTick: 0,
                                describe: 'all stacks are defined and min: 0'
@@ -791,9 +783,9 @@ describe('Logarithmic Scale tests', function() {
                                axis: 'y',
                                data: dataWithEmptyStacks,
                                scale: {
-                                       yAxes: [{
+                                       y{
                                                min: 0
-                                       }]
+                                       }
                                },
                                firstTick: 0,
                                describe: 'not stacks are defined and min: 0'
@@ -812,9 +804,9 @@ describe('Logarithmic Scale tests', function() {
                        {
                                axis: 'x',
                                scale: {
-                                       xAxes: [{
+                                       x{
                                                min: 0
-                                       }]
+                                       }
                                },
                                firstTick: 0,
                                describe: 'all stacks are defined and min: 0'
@@ -823,9 +815,9 @@ describe('Logarithmic Scale tests', function() {
                                axis: 'x',
                                data: dataWithEmptyStacks,
                                scale: {
-                                       xAxes: [{
+                                       x{
                                                min: 0
-                                       }]
+                                       }
                                },
                                firstTick: 0,
                                describe: 'not all stacks are defined and min: 0'
@@ -844,11 +836,11 @@ describe('Logarithmic Scale tests', function() {
                                chartStart = 'bottom';
                                chartEnd = 'top';
                        }
-                       scaleConfig[setup.axis + 'Axes'] = [{
+                       scaleConfig[setup.axis] = {
                                type: 'logarithmic'
-                       }];
+                       };
                        Chart.helpers.extend(scaleConfig, setup.scale);
-                       scaleConfig[setup.axis + 'Axes'][0].type = 'logarithmic';
+                       scaleConfig[setup.axis].type = 'logarithmic';
 
                        var description = 'dataset has stack option and ' + setup.describe
                                + ' and axis is "' + setup.axis + '";';
@@ -865,7 +857,7 @@ describe('Logarithmic Scale tests', function() {
                                                }
                                        });
 
-                                       var axisID = setup.axis + '-axis-0';
+                                       var axisID = setup.axis;
                                        var scale = chart.scales[axisID];
                                        var firstTick = setup.firstTick;
                                        var lastTick = 80; // last tick (should be first available tick after: 2 * 39)
@@ -979,27 +971,29 @@ describe('Logarithmic Scale tests', function() {
                                var expectation = 'min = ' + setup.firstTick + ', max = ' + setup.lastTick;
                                describe(setup.describe + ' and axis is "' + axis.id + '"; expect: ' + expectation + ';', function() {
                                        beforeEach(function() {
-                                               var xScaleConfig = {
+                                               var xConfig = {
                                                        type: 'logarithmic',
+                                                       position: 'bottom'
                                                };
-                                               var yScaleConfig = {
+                                               var yConfig = {
                                                        type: 'logarithmic',
+                                                       position: 'left'
                                                };
                                                var data = setup.data || {
                                                        datasets: [{
                                                                data: setup.dataset
                                                        }],
                                                };
-                                               Chart.helpers.extend(xScaleConfig, setup.scale);
-                                               Chart.helpers.extend(yScaleConfig, setup.scale);
+                                               Chart.helpers.extend(xConfig, setup.scale);
+                                               Chart.helpers.extend(yConfig, setup.scale);
                                                Chart.helpers.extend(data, setup.data || {});
                                                this.chart = window.acquireChart({
                                                        type: 'line',
                                                        data: data,
                                                        options: {
                                                                scales: {
-                                                                       xAxes: [xScaleConfig],
-                                                                       yAxes: [yScaleConfig]
+                                                                       x: xConfig,
+                                                                       y: yConfig
                                                                }
                                                        }
                                                });
@@ -1007,7 +1001,7 @@ describe('Logarithmic Scale tests', function() {
 
                                        it('should get the correct pixel value for a point', function() {
                                                var chart = this.chart;
-                                               var axisID = axis.id + '-axis-0';
+                                               var axisID = axis.id;
                                                var scale = chart.scales[axisID];
                                                var firstTick = setup.firstTick;
                                                var lastTick = setup.lastTick;
@@ -1106,27 +1100,29 @@ describe('Logarithmic Scale tests', function() {
                                var expectation = 'min = 0, max = ' + setup.lastTick + ', first tick = ' + setup.firstTick;
                                describe(setup.describe + ' and axis is "' + axis.id + '"; expect: ' + expectation + ';', function() {
                                        beforeEach(function() {
-                                               var xScaleConfig = {
+                                               var xConfig = {
                                                        type: 'logarithmic',
+                                                       position: 'bottom'
                                                };
-                                               var yScaleConfig = {
+                                               var yConfig = {
                                                        type: 'logarithmic',
+                                                       position: 'left'
                                                };
                                                var data = setup.data || {
                                                        datasets: [{
                                                                data: setup.dataset
                                                        }],
                                                };
-                                               Chart.helpers.extend(xScaleConfig, setup.scale);
-                                               Chart.helpers.extend(yScaleConfig, setup.scale);
+                                               Chart.helpers.extend(xConfig, setup.scale);
+                                               Chart.helpers.extend(yConfig, setup.scale);
                                                Chart.helpers.extend(data, setup.data || {});
                                                this.chart = window.acquireChart({
                                                        type: 'line',
                                                        data: data,
                                                        options: {
                                                                scales: {
-                                                                       xAxes: [xScaleConfig],
-                                                                       yAxes: [yScaleConfig]
+                                                                       x: xConfig,
+                                                                       y: yConfig
                                                                }
                                                        }
                                                });
@@ -1134,7 +1130,7 @@ describe('Logarithmic Scale tests', function() {
 
                                        it('should get the correct pixel value for a point', function() {
                                                var chart = this.chart;
-                                               var axisID = axis.id + '-axis-0';
+                                               var axisID = axis.id;
                                                var scale = chart.scales[axisID];
                                                var firstTick = setup.firstTick;
                                                var lastTick = setup.lastTick;
index c25dc18d7abc83f383a109bfdd38aaa62fa8d836..a64157a7e69e6bd868902327ef3c96903040921d 100644 (file)
@@ -87,8 +87,8 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(chart.scale.min).toBe(-100);
-               expect(chart.scale.max).toBe(150);
+               expect(chart.scales.r.min).toBe(-100);
+               expect(chart.scales.r.max).toBe(150);
        });
 
        it('Should correctly determine the max & min of string data values', function() {
@@ -107,8 +107,8 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(chart.scale.min).toBe(-100);
-               expect(chart.scale.max).toBe(150);
+               expect(chart.scales.r.min).toBe(-100);
+               expect(chart.scales.r.max).toBe(150);
        });
 
        it('Should correctly determine the max & min data values when there are hidden datasets', function() {
@@ -130,8 +130,8 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(chart.scale.min).toBe(-100);
-               expect(chart.scale.max).toBe(150);
+               expect(chart.scales.r.min).toBe(-100);
+               expect(chart.scales.r.max).toBe(150);
        });
 
        it('Should correctly determine the max & min data values when there is NaN data', function() {
@@ -148,8 +148,8 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(chart.scale.min).toBe(50);
-               expect(chart.scale.max).toBe(70);
+               expect(chart.scales.r.min).toBe(50);
+               expect(chart.scales.r.max).toBe(70);
        });
 
        it('Should ensure that the scale has a max and min that are not equal', function() {
@@ -160,13 +160,13 @@ describe('Test the radial linear scale', function() {
                                labels: []
                        },
                        options: {
-                               scale: {
-                                       id: 'myScale'
+                               scales: {
+                                       rScale: {}
                                }
                        }
                });
 
-               var scale = chart.scales.myScale;
+               var scale = chart.scales.rScale;
 
                expect(scale.min).toBe(-1);
                expect(scale.max).toBe(1);
@@ -189,8 +189,8 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(chart.scale.min).toBe(-10);
-               expect(chart.scale.max).toBe(10);
+               expect(chart.scales.r.min).toBe(-10);
+               expect(chart.scales.r.max).toBe(10);
        });
 
        it('Should use the min and max options', function() {
@@ -210,9 +210,9 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(chart.scale.min).toBe(-1010);
-               expect(chart.scale.max).toBe(1010);
-               expect(getLabels(chart.scale)).toEqual(['-1010', '-1000', '-500', '0', '500', '1000', '1010']);
+               expect(chart.scales.r.min).toBe(-1010);
+               expect(chart.scales.r.max).toBe(1010);
+               expect(getLabels(chart.scales.r)).toEqual(['-1010', '-1000', '-500', '0', '500', '1000', '1010']);
        });
 
        it('should forcibly include 0 in the range if the beginAtZero option is used', function() {
@@ -231,22 +231,22 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(getLabels(chart.scale)).toEqual(['20', '25', '30', '35', '40', '45', '50']);
+               expect(getLabels(chart.scales.r)).toEqual(['20', '25', '30', '35', '40', '45', '50']);
 
-               chart.scale.options.beginAtZero = true;
+               chart.scales.r.options.beginAtZero = true;
                chart.update();
 
-               expect(getLabels(chart.scale)).toEqual(['0', '5', '10', '15', '20', '25', '30', '35', '40', '45', '50']);
+               expect(getLabels(chart.scales.r)).toEqual(['0', '5', '10', '15', '20', '25', '30', '35', '40', '45', '50']);
 
                chart.data.datasets[0].data = [-20, -30, -40, -50];
                chart.update();
 
-               expect(getLabels(chart.scale)).toEqual(['-50', '-45', '-40', '-35', '-30', '-25', '-20', '-15', '-10', '-5', '0']);
+               expect(getLabels(chart.scales.r)).toEqual(['-50', '-45', '-40', '-35', '-30', '-25', '-20', '-15', '-10', '-5', '0']);
 
-               chart.scale.options.beginAtZero = false;
+               chart.scales.r.options.beginAtZero = false;
                chart.update();
 
-               expect(getLabels(chart.scale)).toEqual(['-50', '-45', '-40', '-35', '-30', '-25', '-20']);
+               expect(getLabels(chart.scales.r)).toEqual(['-50', '-45', '-40', '-35', '-30', '-25', '-20']);
        });
 
        it('Should generate tick marks in the correct order in reversed mode', function() {
@@ -265,9 +265,9 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(getLabels(chart.scale)).toEqual(['80', '70', '60', '50', '40', '30', '20', '10', '0']);
-               expect(chart.scale.start).toBe(80);
-               expect(chart.scale.end).toBe(0);
+               expect(getLabels(chart.scales.r)).toEqual(['80', '70', '60', '50', '40', '30', '20', '10', '0']);
+               expect(chart.scales.r.start).toBe(80);
+               expect(chart.scales.r.end).toBe(0);
        });
 
        it('Should correctly limit the maximum number of ticks', function() {
@@ -288,23 +288,23 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(getLabels(chart.scale)).toEqual(['0.5', '1.0', '1.5', '2.0', '2.5']);
+               expect(getLabels(chart.scales.r)).toEqual(['0.5', '1.0', '1.5', '2.0', '2.5']);
 
-               chart.options.scale.ticks.maxTicksLimit = 11;
+               chart.options.scales.r.ticks.maxTicksLimit = 11;
                chart.update();
 
-               expect(getLabels(chart.scale)).toEqual(['0.5', '1.0', '1.5', '2.0', '2.5']);
+               expect(getLabels(chart.scales.r)).toEqual(['0.5', '1.0', '1.5', '2.0', '2.5']);
 
-               chart.options.scale.ticks.stepSize = 0.01;
+               chart.options.scales.r.ticks.stepSize = 0.01;
                chart.update();
 
-               expect(getLabels(chart.scale)).toEqual(['0.5', '1.0', '1.5', '2.0', '2.5']);
+               expect(getLabels(chart.scales.r)).toEqual(['0.5', '1.0', '1.5', '2.0', '2.5']);
 
-               chart.options.scale.min = 0.3;
-               chart.options.scale.max = 2.8;
+               chart.options.scales.r.min = 0.3;
+               chart.options.scales.r.max = 2.8;
                chart.update();
 
-               expect(getLabels(chart.scale)).toEqual(['0.3', '0.5', '1.0', '1.5', '2.0', '2.5', '2.8']);
+               expect(getLabels(chart.scales.r)).toEqual(['0.3', '0.5', '1.0', '1.5', '2.0', '2.5', '2.8']);
        });
 
        it('Should build labels using the user supplied callback', function() {
@@ -327,8 +327,8 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(getLabels(chart.scale)).toEqual(['0', '1', '2', '3', '4', '5', '6', '7', '8']);
-               expect(chart.scale.pointLabels).toEqual(['label1', 'label2', 'label3', 'label4', 'label5']);
+               expect(getLabels(chart.scales.r)).toEqual(['0', '1', '2', '3', '4', '5', '6', '7', '8']);
+               expect(chart.scales.r.pointLabels).toEqual(['label1', 'label2', 'label3', 'label4', 'label5']);
        });
 
        it('Should build point labels using the user supplied callback', function() {
@@ -351,7 +351,7 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(chart.scale.pointLabels).toEqual(['0', '1', '2', '3', '4']);
+               expect(chart.scales.r.pointLabels).toEqual(['0', '1', '2', '3', '4']);
        });
 
        it('Should build point labels from falsy values', function() {
@@ -365,7 +365,7 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(chart.scale.pointLabels).toEqual([0, '', '', '', '', '']);
+               expect(chart.scales.r.pointLabels).toEqual([0, '', '', '', '', '']);
        });
 
        it('should correctly set the center point', function() {
@@ -388,9 +388,9 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(chart.scale.drawingArea).toBe(227);
-               expect(chart.scale.xCenter).toBe(256);
-               expect(chart.scale.yCenter).toBe(284);
+               expect(chart.scales.r.drawingArea).toBe(227);
+               expect(chart.scales.r.xCenter).toBe(256);
+               expect(chart.scales.r.yCenter).toBe(284);
        });
 
        it('should correctly get the label for a given data index', function() {
@@ -412,7 +412,7 @@ describe('Test the radial linear scale', function() {
                                }
                        }
                });
-               expect(chart.scale.getLabelForValue(5)).toBe(5);
+               expect(chart.scales.r.getLabelForValue(5)).toBe(5);
        });
 
        it('should get the correct distance from the center point', function() {
@@ -435,18 +435,18 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               expect(chart.scale.getDistanceFromCenterForValue(chart.scale.min)).toBe(0);
-               expect(chart.scale.getDistanceFromCenterForValue(chart.scale.max)).toBe(227);
+               expect(chart.scales.r.getDistanceFromCenterForValue(chart.scales.r.min)).toBe(0);
+               expect(chart.scales.r.getDistanceFromCenterForValue(chart.scales.r.max)).toBe(227);
 
-               var position = chart.scale.getPointPositionForValue(1, 5);
+               var position = chart.scales.r.getPointPositionForValue(1, 5);
                expect(position.x).toBeCloseToPixel(270);
                expect(position.y).toBeCloseToPixel(278);
 
-               chart.scale.options.reverse = true;
+               chart.scales.r.options.reverse = true;
                chart.update();
 
-               expect(chart.scale.getDistanceFromCenterForValue(chart.scale.min)).toBe(227);
-               expect(chart.scale.getDistanceFromCenterForValue(chart.scale.max)).toBe(0);
+               expect(chart.scales.r.getDistanceFromCenterForValue(chart.scales.r.min)).toBe(227);
+               expect(chart.scales.r.getDistanceFromCenterForValue(chart.scales.r.max)).toBe(0);
        });
 
        it('should correctly get angles for all points', function() {
@@ -477,14 +477,14 @@ describe('Test the radial linear scale', function() {
                var slice = 72; // (360 / 5)
 
                for (var i = 0; i < 5; i++) {
-                       expect(radToNearestDegree(chart.scale.getIndexAngle(i))).toBe(15 + (slice * i));
+                       expect(radToNearestDegree(chart.scales.r.getIndexAngle(i))).toBe(15 + (slice * i));
                }
 
                chart.options.startAngle = 0;
                chart.update();
 
                for (var x = 0; x < 5; x++) {
-                       expect(radToNearestDegree(chart.scale.getIndexAngle(x))).toBe((slice * x));
+                       expect(radToNearestDegree(chart.scales.r.getIndexAngle(x))).toBe((slice * x));
                }
        });
 
@@ -511,7 +511,7 @@ describe('Test the radial linear scale', function() {
                        }
                });
 
-               var scale = chart.scale;
+               var scale = chart.scales.r;
 
                [{
                        startAngle: 30,
index 345fefa1a2952ecb0c41bbc486b32b0e74e46522..09fc2ff0204aeb9b744bce58c57c90f8d6c3f877 100755 (executable)
@@ -13,13 +13,13 @@ describe('Time scale tests', function() {
                        data: data,
                        options: {
                                scales: {
-                                       xAxes: [options]
+                                       x: options
                                }
                        }
                }, {canvas: {width: width, height: height}});
 
 
-               return chart.scales.xScale0;
+               return chart.scales.x;
        }
 
        function getLabels(scale) {
@@ -145,7 +145,7 @@ describe('Time scale tests', function() {
                                type: 'line',
                                data: {
                                        datasets: [{
-                                               xAxisID: 'xScale0',
+                                               xAxisID: 'x',
                                                data: [{
                                                        x: newDateFromRef(0),
                                                        y: 1
@@ -172,16 +172,15 @@ describe('Time scale tests', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'xScale0',
+                                               x: {
                                                        type: 'time',
                                                        position: 'bottom'
-                                               }],
+                                               },
                                        }
                                }
                        }, {canvas: {width: 800, height: 200}});
 
-                       var xScale = chart.scales.xScale0;
+                       var xScale = chart.scales.x;
                        var ticks = getLabels(xScale);
 
                        // `bounds === 'data'`: first and last ticks removed since outside the data range
@@ -193,7 +192,7 @@ describe('Time scale tests', function() {
                                type: 'line',
                                data: {
                                        datasets: [{
-                                               xAxisID: 'tScale0',
+                                               xAxisID: 'x',
                                                data: [{
                                                        t: newDateFromRef(0),
                                                        y: 1
@@ -220,16 +219,15 @@ describe('Time scale tests', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'tScale0',
+                                               x: {
                                                        type: 'time',
                                                        position: 'bottom'
-                                               }],
+                                               },
                                        }
                                }
                        }, {canvas: {width: 800, height: 200}});
 
-                       var tScale = chart.scales.tScale0;
+                       var tScale = chart.scales.x;
                        var ticks = getLabels(tScale);
 
                        // `bounds === 'data'`: first and last ticks removed since outside the data range
@@ -243,14 +241,13 @@ describe('Time scale tests', function() {
                        data: {
                                labels: ['foo', 'bar'],
                                datasets: [{
-                                       xAxisID: 'xScale0',
+                                       xAxisID: 'x',
                                        data: [0, 1]
                                }],
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'time',
                                                position: 'bottom',
                                                time: {
@@ -265,13 +262,13 @@ describe('Time scale tests', function() {
                                                ticks: {
                                                        source: 'labels'
                                                }
-                                       }],
+                                       },
                                }
                        }
                });
 
                // Counts down because the lines are drawn top to bottom
-               var labels = getLabels(chart.scales.xScale0);
+               var labels = getLabels(chart.scales.x);
 
                // Counts down because the lines are drawn top to bottom
                expect(labels[0]).toBe('Jan 2');
@@ -322,25 +319,24 @@ describe('Time scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
+                                       xAxisID: 'x',
                                        data: data
                                }],
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'time',
                                                ticks: {
                                                        source: 'data',
                                                        autoSkip: true
                                                }
-                                       }],
+                                       },
                                }
                        }
                });
 
-               var scale = chart.scales.xScale0;
+               var scale = chart.scales.x;
 
                expect(scale._unit).toEqual('month');
        });
@@ -517,7 +513,7 @@ describe('Time scale tests', function() {
                                type: 'line',
                                data: {
                                        datasets: [{
-                                               xAxisID: 'xScale0',
+                                               xAxisID: 'x',
                                                data: []
                                        }],
                                        labels: [
@@ -532,16 +528,15 @@ describe('Time scale tests', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'xScale0',
+                                               x: {
                                                        type: 'time',
-                                                       position: 'bottom',
-                                               }],
+                                                       position: 'bottom'
+                                               },
                                        }
                                }
                        });
 
-                       this.scale = this.chart.scales.xScale0;
+                       this.scale = this.chart.scales.x;
                });
 
                it('should be bounded by the nearest week beginnings', function() {
@@ -585,17 +580,16 @@ describe('Time scale tests', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'xScale0',
+                                               x: {
                                                        type: 'time',
                                                        bounds: 'ticks',
                                                        position: 'bottom'
-                                               }],
+                                               },
                                        }
                                }
                        }, {canvas: {width: 800, height: 200}});
 
-                       this.scale = this.chart.scales.xScale0;
+                       this.scale = this.chart.scales.x;
                });
 
                it('should be bounded by nearest step\'s year start and end', function() {
@@ -641,27 +635,26 @@ describe('Time scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
+                                       xAxisID: 'x',
                                        data: [null, 10, 3]
                                }],
                                labels: ['2015-01-01T20:00:00', '2015-01-02T21:00:00', '2015-01-03T22:00:00', '2015-01-05T23:00:00', '2015-01-07T03:00', '2015-01-08T10:00', '2015-01-10T12:00'], // days
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'time',
                                                position: 'bottom',
                                                ticks: {
                                                        source: 'labels',
                                                        autoSkip: false
                                                }
-                                       }],
+                                       }
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
+               var xScale = chart.scales.x;
                var controller = chart.getDatasetMeta(0).controller;
                expect(xScale.getLabelForValue(controller._getParsed(0)[xScale.id])).toBeTruthy();
                expect(xScale.getLabelForValue(controller._getParsed(0)[xScale.id])).toBe('Jan 1, 2015, 8:00:00 pm');
@@ -674,15 +667,14 @@ describe('Time scale tests', function() {
                                type: 'line',
                                data: {
                                        datasets: [{
-                                               xAxisID: 'xScale0',
+                                               xAxisID: 'x',
                                                data: [0, 0]
                                        }],
                                        labels: ['2015-01-01T20:00:00', '2015-01-01T20:01:00']
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'xScale0',
+                                               x: {
                                                        type: 'time',
                                                        time: {
                                                                displayFormats: {
@@ -694,11 +686,11 @@ describe('Time scale tests', function() {
                                                                        return '<' + value + '>';
                                                                }
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
-                       this.scale = this.chart.scales.xScale0;
+                       this.scale = this.chart.scales.x;
                });
 
                it('should get the correct labels for ticks', function() {
@@ -711,7 +703,7 @@ describe('Time scale tests', function() {
 
                it('should update ticks.callback correctly', function() {
                        var chart = this.chart;
-                       chart.options.scales.xAxes[0].ticks.callback = function(value) {
+                       chart.options.scales.x.ticks.callback = function(value) {
                                return '{' + value + '}';
                        };
                        chart.update();
@@ -729,15 +721,14 @@ describe('Time scale tests', function() {
                                type: 'line',
                                data: {
                                        datasets: [{
-                                               xAxisID: 'xScale0',
+                                               xAxisID: 'x',
                                                data: [0, 0]
                                        }],
                                        labels: ['2015-01-01T20:00:00', '2015-01-01T20:01:00']
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'xScale0',
+                                               x: {
                                                        type: 'time',
                                                        ticks: {
                                                                callback: function(value) {
@@ -755,11 +746,11 @@ describe('Time scale tests', function() {
                                                                        }
                                                                }
                                                        }
-                                               }]
+                                               }
                                        }
                                }
                        });
-                       this.scale = this.chart.scales.xScale0;
+                       this.scale = this.chart.scales.x;
                });
 
                it('should get the correct labels for major and minor ticks', function() {
@@ -773,7 +764,7 @@ describe('Time scale tests', function() {
 
                it('should only use ticks.minor callback if ticks.major.enabled is false', function() {
                        var chart = this.chart;
-                       chart.options.scales.xAxes[0].ticks.major.enabled = false;
+                       chart.options.scales.x.ticks.major.enabled = false;
                        chart.update();
 
                        var labels = getLabels(this.scale);
@@ -784,7 +775,7 @@ describe('Time scale tests', function() {
 
                it('should use ticks.callback if ticks.major.callback is omitted', function() {
                        var chart = this.chart;
-                       chart.options.scales.xAxes[0].ticks.major.callback = undefined;
+                       chart.options.scales.x.ticks.major.callback = undefined;
                        chart.update();
 
                        var labels = getLabels(this.scale);
@@ -795,7 +786,7 @@ describe('Time scale tests', function() {
 
                it('should use ticks.callback if ticks.minor.callback is omitted', function() {
                        var chart = this.chart;
-                       chart.options.scales.xAxes[0].ticks.minor.callback = undefined;
+                       chart.options.scales.x.ticks.minor.callback = undefined;
                        chart.update();
 
                        var labels = getLabels(this.scale);
@@ -811,22 +802,21 @@ describe('Time scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
+                                       xAxisID: 'x',
                                        data: [{t: '2015-01-01T20:00:00', y: 10}, {t: '2015-01-02T21:00:00', y: 3}]
                                }],
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'time',
                                                position: 'bottom'
-                                       }],
+                                       },
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
+               var xScale = chart.scales.x;
                var controller = chart.getDatasetMeta(0).controller;
                var value = controller._getParsed(0)[xScale.id];
                expect(xScale.getLabelForValue(value)).toBeTruthy();
@@ -838,7 +828,7 @@ describe('Time scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
+                                       xAxisID: 'x',
                                        data: [
                                                {t: +new Date('2018-01-08 05:14:23.234'), y: 10},
                                                {t: +new Date('2018-01-09 06:17:43.426'), y: 3}
@@ -847,16 +837,15 @@ describe('Time scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'time',
                                                position: 'bottom'
-                                       }],
+                                       },
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
+               var xScale = chart.scales.x;
                var controller = chart.getDatasetMeta(0).controller;
                var label = xScale.getLabelForValue(controller._getParsed(0)[xScale.id]);
                expect(label).toEqual('Jan 8, 2018, 5:14:23 am');
@@ -868,22 +857,21 @@ describe('Time scale tests', function() {
                        data: {
                                labels: ['2016-05-27'],
                                datasets: [{
-                                       xAxisID: 'xScale0',
+                                       xAxisID: 'x',
                                        data: [5]
                                }]
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                display: true,
                                                type: 'time'
-                                       }]
+                                       }
                                }
                        }
                });
 
-               var xScale = chart.scales.xScale0;
+               var xScale = chart.scales.x;
                var pixel = xScale.getPixelForValue(moment('2016-05-27').valueOf());
 
                expect(xScale.getValueForPixel(pixel)).toEqual(moment(chart.data.labels[0]).valueOf());
@@ -899,13 +887,13 @@ describe('Time scale tests', function() {
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
+                                       x{
                                                type: 'time',
                                                ticks: {
                                                        min: moment().subtract(1, 'months'),
                                                        max: moment(),
                                                }
-                                       }],
+                                       },
                                },
                                responsive: true,
                        },
@@ -914,8 +902,8 @@ describe('Time scale tests', function() {
                                style: 'display: none',
                        },
                });
-               expect(chart.scales['y-axis-0'].width).toEqual(0);
-               expect(chart.scales['y-axis-0'].maxWidth).toEqual(0);
+               expect(chart.scales.y.width).toEqual(0);
+               expect(chart.scales.y.maxWidth).toEqual(0);
                expect(chart.width).toEqual(0);
        });
 
@@ -930,8 +918,7 @@ describe('Time scale tests', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time',
                                                                time: {
                                                                        parser: 'YYYY'
@@ -939,7 +926,7 @@ describe('Time scale tests', function() {
                                                                ticks: {
                                                                        source: 'labels'
                                                                }
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -956,7 +943,7 @@ describe('Time scale tests', function() {
                        it ('should not add ticks for min and max if they extend the labels range', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.min = '2012';
                                options.max = '2051';
@@ -970,7 +957,7 @@ describe('Time scale tests', function() {
                        it ('should not duplicate ticks if min and max are the labels limits', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.min = '2017';
                                options.max = '2042';
@@ -995,7 +982,7 @@ describe('Time scale tests', function() {
                        it ('should correctly handle empty `data.labels` using `time.unit`', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.time.unit = 'year';
                                chart.data.labels = [];
@@ -1024,8 +1011,7 @@ describe('Time scale tests', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time',
                                                                time: {
                                                                        parser: 'YYYY'
@@ -1033,7 +1019,7 @@ describe('Time scale tests', function() {
                                                                ticks: {
                                                                        source: 'data'
                                                                }
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -1050,7 +1036,7 @@ describe('Time scale tests', function() {
                        it ('should not add ticks for min and max if they extend the labels range', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.min = '2012';
                                options.max = '2051';
@@ -1064,7 +1050,7 @@ describe('Time scale tests', function() {
                        it ('should not duplicate ticks if min and max are the labels limits', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.min = '2017';
                                options.max = '2043';
@@ -1090,7 +1076,7 @@ describe('Time scale tests', function() {
                        it ('should correctly handle empty `data.labels` and hidden datasets using `time.unit`', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.time.unit = 'year';
                                chart.data.labels = [];
@@ -1116,8 +1102,7 @@ describe('Time scale tests', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time',
                                                                time: {
                                                                        parser: 'YYYY'
@@ -1126,10 +1111,10 @@ describe('Time scale tests', function() {
                                                                ticks: {
                                                                        source: 'labels'
                                                                }
-                                                       }],
-                                                       yAxes: [{
+                                                       },
+                                                       y{
                                                                display: false
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -1149,7 +1134,7 @@ describe('Time scale tests', function() {
                        it ('should add a step before if scale.min is before the first data', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.min = '2012';
                                chart.update();
@@ -1163,7 +1148,7 @@ describe('Time scale tests', function() {
                        it ('should add a step after if scale.max is after the last data', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.max = '2050';
                                chart.update();
@@ -1177,7 +1162,7 @@ describe('Time scale tests', function() {
                        it ('should add steps before and after if scale.min/max are outside the data range', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.min = '2012';
                                options.max = '2050';
@@ -1200,8 +1185,7 @@ describe('Time scale tests', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time',
                                                                time: {
                                                                        parser: 'YYYY'
@@ -1210,10 +1194,10 @@ describe('Time scale tests', function() {
                                                                ticks: {
                                                                        source: 'labels'
                                                                }
-                                                       }],
-                                                       yAxes: [{
+                                                       },
+                                                       y{
                                                                display: false
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -1233,7 +1217,7 @@ describe('Time scale tests', function() {
                        it ('should take in account scale min and max if outside the ticks range', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.min = '2012';
                                options.max = '2050';
@@ -1262,18 +1246,17 @@ describe('Time scale tests', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time',
                                                                bounds: 'data',
                                                                time: {
                                                                        parser: 'MM/DD HH:mm',
                                                                        unit: 'day'
                                                                }
-                                                       }],
-                                                       yAxes: [{
+                                                       },
+                                                       y{
                                                                display: false
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -1299,18 +1282,17 @@ describe('Time scale tests', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time',
                                                                bounds: 'ticks',
                                                                time: {
                                                                        parser: 'MM/DD HH:mm',
                                                                        unit: 'day'
                                                                }
-                                                       }],
-                                                       yAxes: [{
+                                                       },
+                                                       y{
                                                                display: false
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -1341,8 +1323,7 @@ describe('Time scale tests', function() {
                                                        },
                                                        options: {
                                                                scales: {
-                                                                       xAxes: [{
-                                                                               id: 'x',
+                                                                       x: {
                                                                                type: 'time',
                                                                                bounds: bounds,
                                                                                time: {
@@ -1352,10 +1333,10 @@ describe('Time scale tests', function() {
                                                                                ticks: {
                                                                                        source: source
                                                                                }
-                                                                       }],
-                                                                       yAxes: [{
+                                                                       },
+                                                                       y{
                                                                                display: false
-                                                                       }]
+                                                                       }
                                                                }
                                                        }
                                                });
@@ -1364,7 +1345,7 @@ describe('Time scale tests', function() {
                                        it ('should expand scale to the min/max range', function() {
                                                var chart = this.chart;
                                                var scale = chart.scales.x;
-                                               var options = chart.options.scales.xAxes[0];
+                                               var options = chart.options.scales.x;
                                                var min = '02/19 07:00';
                                                var max = '02/24 08:00';
                                                var minMillis = +moment(min, 'MM/DD HH:mm');
@@ -1386,7 +1367,7 @@ describe('Time scale tests', function() {
                                        it ('should shrink scale to the min/max range', function() {
                                                var chart = this.chart;
                                                var scale = chart.scales.x;
-                                               var options = chart.options.scales.xAxes[0];
+                                               var options = chart.options.scales.x;
                                                var min = '02/21 07:00';
                                                var max = '02/22 20:00';
                                                var minMillis = +moment(min, 'MM/DD HH:mm');
@@ -1422,8 +1403,7 @@ describe('Time scale tests', function() {
                                                },
                                                options: {
                                                        scales: {
-                                                               xAxes: [{
-                                                                       id: 'x',
+                                                               x: {
                                                                        type: 'time',
                                                                        time: {
                                                                                parser: 'YYYY'
@@ -1432,7 +1412,7 @@ describe('Time scale tests', function() {
                                                                                source: source
                                                                        },
                                                                        distribution: distribution
-                                                               }]
+                                                               }
                                                        }
                                                }
                                        });
@@ -1448,7 +1428,7 @@ describe('Time scale tests', function() {
                                it ('should add offset from the edges if offset is true', function() {
                                        var chart = this.chart;
                                        var scale = chart.scales.x;
-                                       var options = chart.options.scales.xAxes[0];
+                                       var options = chart.options.scales.x;
 
                                        options.offset = true;
                                        chart.update();
@@ -1464,7 +1444,7 @@ describe('Time scale tests', function() {
                                it ('should not add offset if min and max extend the labels range', function() {
                                        var chart = this.chart;
                                        var scale = chart.scales.x;
-                                       var options = chart.options.scales.xAxes[0];
+                                       var options = chart.options.scales.x;
 
                                        options.min = '2012';
                                        options.max = '2051';
@@ -1489,7 +1469,7 @@ describe('Time scale tests', function() {
                                                },
                                                options: {
                                                        scales: {
-                                                               xAxes: [{
+                                                               x{
                                                                        id: 'x',
                                                                        type: 'time',
                                                                        time: {
@@ -1499,7 +1479,7 @@ describe('Time scale tests', function() {
                                                                                source: source
                                                                        },
                                                                        distribution: distribution
-                                                               }]
+                                                               }
                                                        }
                                                }
                                        });
@@ -1508,7 +1488,7 @@ describe('Time scale tests', function() {
                                it ('should add offset if min and max extend the labels range and offset is true', function() {
                                        var chart = this.chart;
                                        var scale = chart.scales.x;
-                                       var options = chart.options.scales.xAxes[0];
+                                       var options = chart.options.scales.x;
 
                                        options.min = '2012';
                                        options.max = '2051';
@@ -1536,8 +1516,7 @@ describe('Time scale tests', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time',
                                                                reverse: true,
                                                                time: {
@@ -1546,10 +1525,10 @@ describe('Time scale tests', function() {
                                                                ticks: {
                                                                        source: 'labels',
                                                                }
-                                                       }],
-                                                       yAxes: [{
+                                                       },
+                                                       y{
                                                                display: false
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -1576,7 +1555,7 @@ describe('Time scale tests', function() {
                        it ('should reverse the bars and add offsets if offset is true', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.offset = true;
                                chart.update();
@@ -1592,7 +1571,7 @@ describe('Time scale tests', function() {
                        it ('should reverse the values for pixels if offset is true', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.offset = true;
                                chart.update();
@@ -1624,8 +1603,7 @@ describe('Time scale tests', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time',
                                                                time: {
                                                                        parser: 'YYYY'
@@ -1635,10 +1613,10 @@ describe('Time scale tests', function() {
                                                                ticks: {
                                                                        source: 'labels'
                                                                }
-                                                       }],
-                                                       yAxes: [{
+                                                       },
+                                                       y{
                                                                display: false
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -1659,7 +1637,7 @@ describe('Time scale tests', function() {
                        it ('should reverse the labels and should add a step before if scale.min is before the first data', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.min = '2012';
                                chart.update();
@@ -1674,7 +1652,7 @@ describe('Time scale tests', function() {
                        it ('should reverse the labels and should add a step after if scale.max is after the last data', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.max = '2050';
                                chart.update();
@@ -1689,7 +1667,7 @@ describe('Time scale tests', function() {
                        it ('should reverse the labels and should add steps before and after if scale.min/max are outside the data range', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.min = '2012';
                                options.max = '2050';
@@ -1712,8 +1690,7 @@ describe('Time scale tests', function() {
                                        },
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time',
                                                                time: {
                                                                        parser: 'YYYY'
@@ -1723,10 +1700,10 @@ describe('Time scale tests', function() {
                                                                ticks: {
                                                                        source: 'labels'
                                                                }
-                                                       }],
-                                                       yAxes: [{
+                                                       },
+                                                       y{
                                                                display: false
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -1747,7 +1724,7 @@ describe('Time scale tests', function() {
                        it ('should reverse the labels and should take in account scale min and max if outside the ticks range', function() {
                                var chart = this.chart;
                                var scale = chart.scales.x;
-                               var options = chart.options.scales.xAxes[0];
+                               var options = chart.options.scales.x;
 
                                options.min = '2012';
                                options.max = '2050';
@@ -1783,28 +1760,26 @@ describe('Time scale tests', function() {
                                },
                                options: {
                                        scales: {
-                                               xAxes: [{
-                                                       id: 'x',
+                                               x: {
                                                        type: 'time',
                                                        labels: ['2015', '2016', '2017'],
                                                        time: timeOpts
                                                },
-                                               {
-                                                       id: 'x2',
+                                               x2: {
                                                        type: 'time',
+                                                       position: 'bottom',
                                                        time: timeOpts
-                                               }],
-                                               yAxes: [{
-                                                       id: 'y',
+                                               },
+                                               y: {
                                                        type: 'time',
                                                        time: timeOpts
                                                },
-                                               {
-                                                       id: 'y2',
+                                               y2: {
+                                                       position: 'left',
                                                        type: 'time',
                                                        labels: ['2005', '2006', '2007'],
                                                        time: timeOpts
-                                               }]
+                                               }
                                        }
                                }
                        });
@@ -1828,14 +1803,13 @@ describe('Time scale tests', function() {
                        type: 'line',
                        data: {
                                datasets: [{
-                                       xAxisID: 'xScale0',
+                                       xAxisID: 'x',
                                        data: data
                                }],
                        },
                        options: {
                                scales: {
-                                       xAxes: [{
-                                               id: 'xScale0',
+                                       x: {
                                                type: 'time',
                                                ticks: {
                                                        major: {
@@ -1844,12 +1818,12 @@ describe('Time scale tests', function() {
                                                        source: 'data',
                                                        autoSkip: true
                                                }
-                                       }],
+                                       },
                                }
                        }
                });
 
-               var scale = chart.scales.xScale0;
+               var scale = chart.scales.x;
 
                var labels = scale.ticks.map(function(t) {
                        return t.label;
@@ -1870,10 +1844,9 @@ describe('Time scale tests', function() {
                                        data: {},
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time'
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -1893,7 +1866,7 @@ describe('Time scale tests', function() {
                                };
 
                                expect(chart.scales.x.options.time.displayFormats).toEqual(expected);
-                               expect(chart.options.scales.xAxes[0].time.displayFormats).toEqual(expected);
+                               expect(chart.options.scales.x.time.displayFormats).toEqual(expected);
                        });
 
                        it('should merge user formats with adapter presets', function() {
@@ -1902,8 +1875,7 @@ describe('Time scale tests', function() {
                                        data: {},
                                        options: {
                                                scales: {
-                                                       xAxes: [{
-                                                               id: 'x',
+                                                       x: {
                                                                type: 'time',
                                                                time: {
                                                                        displayFormats: {
@@ -1912,7 +1884,7 @@ describe('Time scale tests', function() {
                                                                                month: 'bla'
                                                                        }
                                                                }
-                                                       }]
+                                                       }
                                                }
                                        }
                                });
@@ -1932,7 +1904,7 @@ describe('Time scale tests', function() {
                                };
 
                                expect(chart.scales.x.options.time.displayFormats).toEqual(expected);
-                               expect(chart.options.scales.xAxes[0].time.displayFormats).toEqual(expected);
+                               expect(chart.options.scales.x.time.displayFormats).toEqual(expected);
                        });
                });
        });