diff --git a/docs/axes/cartesian/linear.md b/docs/axes/cartesian/linear.md index bf82fc30509..2aaf9c53205 100644 --- a/docs/axes/cartesian/linear.md +++ b/docs/axes/cartesian/linear.md @@ -23,13 +23,13 @@ Namespace: `options.scales[scaleId]` Namespace: `options.scales[scaleId].ticks` -| Name | Type | Default | Description -| ---- | ---- | ------- | ----------- -| `count` | `number` | `undefined` | The number of ticks to generate. If specified, this overrides the automatic generation. -| `format` | `object` | | The [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) options used by the default label formatter -| `maxTicksLimit` | `number` | `11` | Maximum number of ticks and gridlines to show. -| `precision` | `number` | | if defined and `stepSize` is not specified, the step size will be rounded to this many decimal places. -| `stepSize` | `number` | | User-defined fixed step size for the scale. [more...](#step-size) +| Name | Type | Scriptable | Default | Description +| ---- | ---- | ------- | ------- | ----------- +| `count` | `number` | Yes | `undefined` | The number of ticks to generate. If specified, this overrides the automatic generation. +| `format` | `object` | Yes | | The [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) options used by the default label formatter +| `maxTicksLimit` | `number` | Yes | `11` | Maximum number of ticks and gridlines to show. +| `precision` | `number` | Yes | | if defined and `stepSize` is not specified, the step size will be rounded to this many decimal places. +| `stepSize` | `number` | Yes | | User-defined fixed step size for the scale. [more...](#step-size) !!!include(axes/cartesian/_common_ticks.md)!!! diff --git a/src/core/core.scale.js b/src/core/core.scale.js index bdefea4a747..dbdbb18c32a 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -237,7 +237,7 @@ export default class Scale extends Element { */ init(options) { const me = this; - me.options = options; + me.options = options.setContext(me.getContext()); me.axis = options.axis; diff --git a/test/specs/core.controller.tests.js b/test/specs/core.controller.tests.js index fee6832d62c..9d4e7aa96e3 100644 --- a/test/specs/core.controller.tests.js +++ b/test/specs/core.controller.tests.js @@ -413,7 +413,7 @@ describe('Chart', function() { }); expect(chart.scales.x.type).toBe('logarithmic'); - expect(chart.scales.x.options).toBe(chart.options.scales.x); + expect(chart.scales.x.options).toEqual(chart.options.scales.x); expect(chart.scales.x.options).toEqual( jasmine.objectContaining({ _jasmineCheckA: 'a0', @@ -423,7 +423,7 @@ describe('Chart', function() { })); expect(chart.scales.y.type).toBe('time'); - expect(chart.scales.y.options).toBe(chart.options.scales.y); + expect(chart.scales.y.options).toEqual(chart.options.scales.y); expect(chart.scales.y.options).toEqual( jasmine.objectContaining({ _jasmineCheckA: 'a0',