diff --git a/docs/guide/migrationV2.md b/docs/guide/migrationV2.md index 53e0d30e7..3ecb25a2c 100644 --- a/docs/guide/migrationV2.md +++ b/docs/guide/migrationV2.md @@ -11,6 +11,7 @@ A number of changes were made to the configuration options passed to the plugin * When [stacked scales](https://www.chartjs.org/docs/latest/axes/cartesian/#common-options-to-all-cartesian-axes) are used, instead of the whole chart area, the designated scale area is used as fallback for `xMin`, `xMax`, `yMin`, `yMax`, `xValue` or `yValue` options. * `cornerRadius` option was replaced by `borderRadius` in the box annotation configuration and in the label configuration of line annotation to align with Chart.js options. * `xPadding` and `yPadding` options were merged into a single `padding` object in the label configuration of line annotation to align with Chart.js options. + * `enabled` option was replaced by `display` in the callout configuration of label annotation, in the label configuration of line and box annotations and in the arrow heads configuration of line annotation to have the same option on all elements. ## Events diff --git a/docs/guide/types/box.md b/docs/guide/types/box.md index 5e8c0502b..17ec716a3 100644 --- a/docs/guide/types/box.md +++ b/docs/guide/types/box.md @@ -125,8 +125,8 @@ All of these options can be [Scriptable](../options#scriptable-options) | ---- | ---- | :----: | ---- | `color` | [`Color`](../options#color) | `'black'` | Text color. | `content` | `string`\|`string[]`\|[`Image`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image)\|[`HTMLCanvasElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) | `null` | The content to show in the label. +| `display` | `boolean` | `false` | Whether or not the label is shown. | `drawTime` | `string` | `options.drawTime` | See [drawTime](../options#draw-time). Defaults to the box annotation draw time if unset -| `enabled` | `boolean` | `false` | Whether or not the label is shown. | `font` | [`Font`](../options#font) | `{ weight: 'bold' }` | Label font | `height` | `number`\|`string` | `undefined` | Overrides the height of the image or canvas element. Could be set in pixel by a number, or in percentage of current height of image or canvas element by a string. If undefined, uses the height of the image or canvas element. It is used only when the content is an image or canvas element. | `padding` | [`Padding`](../options#padding) | `6` | The padding to add around the text label. diff --git a/docs/guide/types/label.md b/docs/guide/types/label.md index d015fb033..19febdeb2 100644 --- a/docs/guide/types/label.md +++ b/docs/guide/types/label.md @@ -182,7 +182,7 @@ const options = { size: 18 }, callout: { - enabled: true, + display: true, side: 10 } } @@ -224,7 +224,7 @@ All of these options can be [Scriptable](../options#scriptable-options). | `borderDashOffset` | `number` | `0` | Offset for line dashes of callout. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset). | `borderJoinStyle` | `string` | `'miter'` | Border line join style of the callout. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin). | `borderWidth` | `number` | `1` | Stroke width of the pointer of the callout. -| `enabled` | `boolean` | `false` | If true, the callout is drawn. +| `display` | `boolean` | `false` | If true, the callout is drawn. | `margin` | `number` | `5` | Amount of pixels between the label and the callout separator. | `position` | `string` | `'auto'` | The position of callout, with respect to the label. Could be `left`, `top`, `right`, `bottom` or `auto`. | `side` | `number` | `5` | Width of the starter line of callout pointer. diff --git a/docs/guide/types/line.md b/docs/guide/types/line.md index 9b39a1ad7..07037feeb 100644 --- a/docs/guide/types/line.md +++ b/docs/guide/types/line.md @@ -141,8 +141,8 @@ All of these options can be [Scriptable](../options#scriptable-options) | `borderWidth` | `number` | `0` | The border line width (in pixels). | `color` | [`Color`](../options#color) | `'#fff'` | Text color. | `content` | `string`\|`string[]`\|[`Image`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image)\|[`HTMLCanvasElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) | `null` | The content to show in the label. +| `display` | `boolean` | `false` | Whether or not the label is shown. | `drawTime` | `string` | `options.drawTime` | See [drawTime](../options#draw-time). Defaults to the line annotation draw time if unset. -| `enabled` | `boolean` | `false` | Whether or not the label is shown. | `font` | [`Font`](../options#font) | `{ weight: 'bold' }` | Label font. | `height` | `number`\|`string` | `undefined` | Overrides the height of the image or canvas element. Could be set in pixel by a number, or in percentage of current height of image or canvas element by a string. If undefined, uses the height of the image or canvas element. It is used only when the content is an image or canvas element. | `padding` | [`Padding`](../options#padding) | `6` | The padding to add around the text label. @@ -190,7 +190,7 @@ All of these options can be [Scriptable](../options#scriptable-options) | `borderDashOffset` | `number` | `lineAnnotation.borderDashOffset` | Offset for border arrow head dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset). | `borderShadowColor` | [`Color`](../options#color) | `lineAnnotation.borderShadowColor` | The color of border shadow of the arrow head. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowColor). | `borderWidth` | `number` | `lineAnnotation.borderWidth` | The border line width (in pixels). -| `enabled` | `boolean` | `false` | Whether or not the arrow head is shown. +| `display` | `boolean` | `false` | Whether or not the arrow head is shown. | `fill` | `boolean` | `false` | Whether or not the arrow head is filled. | `length` | `number` | `12` | The length of the arrow head in pixels. | `shadowBlur` | `number` | `lineAnnotation.shadowBlur` | The amount of blur applied to shadow of the arrow head. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowBlur). diff --git a/docs/samples/box/canvas.md b/docs/samples/box/canvas.md index 59b8c0a71..326288965 100644 --- a/docs/samples/box/canvas.md +++ b/docs/samples/box/canvas.md @@ -24,7 +24,7 @@ const annotation1 = { xMax: 2, xMin: 5, label: { - enabled: true, + display: true, content: Utils.getSpiral(), position: { x: 'center', @@ -42,7 +42,7 @@ const annotation2 = { xMax: 6, xMin: 10, label: { - enabled: true, + display: true, content: Utils.getHouse(), position: { x: 'center', diff --git a/docs/samples/box/disclosure.md b/docs/samples/box/disclosure.md index d9d659278..da6254183 100644 --- a/docs/samples/box/disclosure.md +++ b/docs/samples/box/disclosure.md @@ -23,7 +23,7 @@ const annotation = { borderWidth: 0, label: { drawTime: 'afterDatasetsDraw', - enabled: true, + display: true, color: 'rgba(208, 208, 208, 0.2)', content: 'Draft', font: { diff --git a/docs/samples/box/image.md b/docs/samples/box/image.md index 99fe0f3bc..a67124bbd 100644 --- a/docs/samples/box/image.md +++ b/docs/samples/box/image.md @@ -27,7 +27,7 @@ const annotation = { xMax: 2, xMin: 5, label: { - enabled: true, + display: true, content: Utils.getImage(), width: 150, height: 150, diff --git a/docs/samples/box/quarters.md b/docs/samples/box/quarters.md index 2cf9e8eb7..563f82121 100644 --- a/docs/samples/box/quarters.md +++ b/docs/samples/box/quarters.md @@ -25,7 +25,7 @@ const annotation1 = { xMin: -0.5, label: { drawTime: 'afterDraw', - enabled: true, + display: true, content: 'First quarter', position: { x: 'center', @@ -44,7 +44,7 @@ const annotation2 = { xMin: 2.5, label: { drawTime: 'afterDraw', - enabled: true, + display: true, content: 'Second quarter', position: { x: 'center', @@ -63,7 +63,7 @@ const annotation3 = { xMin: 5.5, label: { drawTime: 'afterDraw', - enabled: true, + display: true, content: 'Third quarter', position: { x: 'center', @@ -81,7 +81,7 @@ const annotation4 = { xMin: 8.5, label: { drawTime: 'afterDraw', - enabled: true, + display: true, content: 'Fourth quarter', position: { x: 'center', diff --git a/docs/samples/charts/bar.md b/docs/samples/charts/bar.md index 07fe60523..4e5924b83 100644 --- a/docs/samples/charts/bar.md +++ b/docs/samples/charts/bar.md @@ -36,7 +36,7 @@ const annotation1 = { value: 0.5, label: { content: 'Line annotation at x=0.5', - enabled: true + display: true }, }; // @@ -53,7 +53,7 @@ const annotation2 = { position: 'start', backgroundColor: 'black', content: 'Line at x=Label 5', - enabled: true + display: true } }; // diff --git a/docs/samples/charts/line.md b/docs/samples/charts/line.md index 050b4660c..431e7c3d0 100644 --- a/docs/samples/charts/line.md +++ b/docs/samples/charts/line.md @@ -32,7 +32,7 @@ const annotation1 = { label: { rotation: 'auto', content: 'Line at x=5', - enabled: true + display: true }, }; // @@ -49,7 +49,7 @@ const annotation2 = { position: 'start', backgroundColor: 'black', content: 'Line at x=90', - enabled: true + display: true } }; // diff --git a/docs/samples/intro.md b/docs/samples/intro.md index 4ffee719f..20d75caa8 100644 --- a/docs/samples/intro.md +++ b/docs/samples/intro.md @@ -40,7 +40,7 @@ const annotation1 = { label: { backgroundColor: 'red', content: 'Test Label', - enabled: true + display: true }, scaleID: 'y', value: Utils.rand(-100, 100) diff --git a/docs/samples/label/callout.md b/docs/samples/label/callout.md index b6c81bf3f..99312c999 100644 --- a/docs/samples/label/callout.md +++ b/docs/samples/label/callout.md @@ -21,7 +21,7 @@ const annotation = { type: 'label', backgroundColor: 'rgba(245, 245, 245)', callout: { - enabled: true, + display: true, borderColor: (ctx) => ctx.chart.data.datasets[0].borderColor }, content: (ctx) => 'Maximum value is ' + maxValue(ctx).toFixed(2), diff --git a/docs/samples/label/image.md b/docs/samples/label/image.md index 3994ee4d2..2e2ef5411 100644 --- a/docs/samples/label/image.md +++ b/docs/samples/label/image.md @@ -30,7 +30,7 @@ const annotation1 = { borderWidth: 1, borderDash: [6, 6], callout: { - enabled: true, + display: true, position: 'left' } }; diff --git a/docs/samples/label/innerChart.md b/docs/samples/label/innerChart.md index 2e9c26e36..95e4505cf 100644 --- a/docs/samples/label/innerChart.md +++ b/docs/samples/label/innerChart.md @@ -49,7 +49,7 @@ const annotation2 = { content: (ctx) => [innerChart.data.labels[getVisibleDatasetIndex(ctx)], 'items trend'], callout: { - enabled: true, + display: true, position: 'bottom', margin: 0 }, diff --git a/docs/samples/line/animation.md b/docs/samples/line/animation.md index 66e37d39f..35699fb58 100644 --- a/docs/samples/line/animation.md +++ b/docs/samples/line/animation.md @@ -30,7 +30,7 @@ const line = { borderColor: 'red', borderWidth: 3, label: { - enabled: true, + display: true, content: 'Limit', rotation: 90 }, diff --git a/docs/samples/line/average.md b/docs/samples/line/average.md index dbbd777da..327bb52ab 100644 --- a/docs/samples/line/average.md +++ b/docs/samples/line/average.md @@ -31,7 +31,7 @@ const annotation = { borderDashOffset: 0, borderWidth: 3, label: { - enabled: true, + display: true, content: (ctx) => 'Average: ' + average(ctx).toFixed(2), position: 'end' }, diff --git a/docs/samples/line/canvas.md b/docs/samples/line/canvas.md index 56041b28d..39037f8c5 100644 --- a/docs/samples/line/canvas.md +++ b/docs/samples/line/canvas.md @@ -31,7 +31,7 @@ const annotation = { scaleID: 'y', value: 50, label: { - enabled: true, + display: true, content: Utils.getHouse(), backgroundColor: 'white', borderWidth: 3, diff --git a/docs/samples/line/datasetBars.md b/docs/samples/line/datasetBars.md index 5a9401fbb..01017f15d 100644 --- a/docs/samples/line/datasetBars.md +++ b/docs/samples/line/datasetBars.md @@ -24,7 +24,7 @@ const annotation1 = { borderColor: 'green', borderWidth: 3, label: { - enabled: true, + display: true, backgroundColor: 'green', borderRadius: 0, color: 'white', @@ -45,7 +45,7 @@ const annotation2 = { borderColor: 'green', borderWidth: 3, label: { - enabled: true, + display: true, backgroundColor: 'green', borderRadius: 0, color: 'white', @@ -66,7 +66,7 @@ const annotation3 = { borderColor: 'green', borderWidth: 3, label: { - enabled: true, + display: true, backgroundColor: 'green', borderRadius: 0, color: 'white', @@ -87,7 +87,7 @@ const annotation4 = { borderColor: 'green', borderWidth: 3, label: { - enabled: true, + display: true, backgroundColor: 'green', borderRadius: 0, color: 'white', diff --git a/docs/samples/line/image.md b/docs/samples/line/image.md index 787f8e3cd..11381c81c 100644 --- a/docs/samples/line/image.md +++ b/docs/samples/line/image.md @@ -31,7 +31,7 @@ const annotation = { scaleID: 'y', value: 50, label: { - enabled: true, + display: true, content: Utils.getImage(), backgroundColor: 'white', borderWidth: 3, diff --git a/docs/samples/line/labelVisibility.md b/docs/samples/line/labelVisibility.md index a2ed727fb..247192fc6 100644 --- a/docs/samples/line/labelVisibility.md +++ b/docs/samples/line/labelVisibility.md @@ -29,7 +29,7 @@ const annotation1 = { borderColor: 'lightGreen', borderWidth: 10, label: { - enabled: false, + display: false, backgroundColor: 'green', drawTime: 'afterDatasetsDraw', content: (ctx) => ['Average of dataset', 'is: ' + average(ctx).toFixed(3)] @@ -39,11 +39,11 @@ const annotation1 = { // For simple property changes, you can directly modify the annotation // element's properties then call chart.draw(). This is faster. enter({chart, element}, event) { - element.options.label.enabled = true; + element.options.label.display = true; chart.draw(); }, leave({chart, element}, event) { - element.options.label.enabled = false; + element.options.label.display = false; chart.draw(); } }; @@ -55,7 +55,7 @@ const annotation2 = { borderColor: 'lightBlue', borderWidth: 10, label: { - enabled: (ctx) => ctx.hovered, + display: (ctx) => ctx.hovered, backgroundColor: 'blue', drawTime: 'afterDatasetsDraw', content: (ctx) => ['Min of dataset', 'is: ' + min(ctx).toFixed(3)], @@ -85,7 +85,7 @@ const config = { options: { plugins: { tooltip: { - enabled: false, + display: false, }, annotation: { drawTime: 'beforeDatasetsDraw', diff --git a/docs/samples/line/limited.md b/docs/samples/line/limited.md index ae1f176a7..cad8c0df9 100644 --- a/docs/samples/line/limited.md +++ b/docs/samples/line/limited.md @@ -26,7 +26,7 @@ const annotation1 = { borderColor: 'green', borderWidth: 3, label: { - enabled: true, + display: true, backgroundColor: 'lightGreen', borderRadius: 0, color: 'green', @@ -34,11 +34,11 @@ const annotation1 = { }, arrowHeads: { start: { - enabled: true, + display: true, borderColor: 'green' }, end: { - enabled: true, + display: true, borderColor: 'green' } }, diff --git a/docs/samples/line/lowerUpper.md b/docs/samples/line/lowerUpper.md index e78b8f4cb..26389c785 100644 --- a/docs/samples/line/lowerUpper.md +++ b/docs/samples/line/lowerUpper.md @@ -33,7 +33,7 @@ const annotation1 = { borderColor: 'black', borderWidth: 3, label: { - enabled: true, + display: true, backgroundColor: 'black', borderColor: 'black', borderRadius: 10, @@ -52,7 +52,7 @@ const annotation2 = { borderWidth: 3, borderColor: 'black', label: { - enabled: true, + display: true, backgroundColor: 'black', borderColor: 'black', borderRadius: 10, diff --git a/docs/samples/line/standardDeviation.md b/docs/samples/line/standardDeviation.md index d24c6fbf0..cac766f16 100644 --- a/docs/samples/line/standardDeviation.md +++ b/docs/samples/line/standardDeviation.md @@ -31,7 +31,7 @@ const annotation1 = { borderDashOffset: 0, borderWidth: 3, label: { - enabled: true, + display: true, backgroundColor: 'rgb(100, 149, 237)', content: (ctx) => 'Average: ' + average(ctx).toFixed(2) }, @@ -48,7 +48,7 @@ const annotation2 = { borderDashOffset: 0, borderWidth: 3, label: { - enabled: true, + display: true, backgroundColor: 'rgba(102, 102, 102, 0.5)', color: 'black', content: (ctx) => (average(ctx) + standardDeviation(ctx)).toFixed(2), @@ -69,7 +69,7 @@ const annotation3 = { borderDashOffset: 0, borderWidth: 3, label: { - enabled: true, + display: true, backgroundColor: 'rgba(102, 102, 102, 0.5)', color: 'black', content: (ctx) => (average(ctx) - standardDeviation(ctx)).toFixed(2), diff --git a/docs/samples/line/visibility.md b/docs/samples/line/visibility.md index 81c54b4ad..4d1c0a15d 100644 --- a/docs/samples/line/visibility.md +++ b/docs/samples/line/visibility.md @@ -33,7 +33,7 @@ const annotation = { borderWidth: 1, display: (ctx) => ctx.chart.isDatasetVisible(1), label: { - enabled: true, + display: true, content: 'Now', position: 'start' }, diff --git a/docs/samples/point/combined.md b/docs/samples/point/combined.md index 4b0588e6e..5d7b37fd8 100644 --- a/docs/samples/point/combined.md +++ b/docs/samples/point/combined.md @@ -27,7 +27,7 @@ const annotation1 = { borderDash: [6, 6], borderWidth: 3, label: { - enabled: true, + display: true, backgroundColor: 'lightGreen', borderRadius: 0, color: 'green', @@ -35,7 +35,7 @@ const annotation1 = { }, arrowHeads: { end: { - enabled: true, + display: true, fill: true, borderDash: [], borderColor: 'green' diff --git a/package-lock.json b/package-lock.json index 1de5a1ce5..e7b7958d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11230,9 +11230,9 @@ "dev": true }, "node_modules/karma-rollup-preprocessor": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/karma-rollup-preprocessor/-/karma-rollup-preprocessor-7.0.8.tgz", - "integrity": "sha512-WiuBCS9qsatJuR17dghiTARBZ7LF+ml+eb7qJXhw7IbsdY0lTWELDRQC/93J9i6636CsAXVBL3VJF4WtaFLZzA==", + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/karma-rollup-preprocessor/-/karma-rollup-preprocessor-7.0.7.tgz", + "integrity": "sha512-Y1QwsTCiCBp8sSALZdqmqry/mWIWIy0V6zonUIpy+0/D/Kpb2XZvR+JZrWfacQvcvKQdZFJvg6EwlnKtjepu3Q==", "dev": true, "dependencies": { "chokidar": "^3.3.1", @@ -28162,9 +28162,9 @@ "requires": {} }, "karma-rollup-preprocessor": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/karma-rollup-preprocessor/-/karma-rollup-preprocessor-7.0.8.tgz", - "integrity": "sha512-WiuBCS9qsatJuR17dghiTARBZ7LF+ml+eb7qJXhw7IbsdY0lTWELDRQC/93J9i6636CsAXVBL3VJF4WtaFLZzA==", + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/karma-rollup-preprocessor/-/karma-rollup-preprocessor-7.0.7.tgz", + "integrity": "sha512-Y1QwsTCiCBp8sSALZdqmqry/mWIWIy0V6zonUIpy+0/D/Kpb2XZvR+JZrWfacQvcvKQdZFJvg6EwlnKtjepu3Q==", "dev": true, "requires": { "chokidar": "^3.3.1", diff --git a/src/annotation.js b/src/annotation.js index e935eba76..d03b9c318 100644 --- a/src/annotation.js +++ b/src/annotation.js @@ -167,7 +167,7 @@ function draw(chart, caller, clip) { return; } const label = el.options.label; - if (label && label.enabled && label.content && (label.drawTime || el.options.drawTime) === caller) { + if (label && label.display && label.content && (label.drawTime || el.options.drawTime) === caller) { el.drawLabel(ctx, chartArea); } }); diff --git a/src/types/box.js b/src/types/box.js index aeea28257..555d1e1ca 100644 --- a/src/types/box.js +++ b/src/types/box.js @@ -66,8 +66,8 @@ BoxAnnotation.defaults = { borderWidth: undefined, color: 'black', content: null, + display: false, drawTime: undefined, - enabled: false, font: { family: undefined, lineHeight: undefined, diff --git a/src/types/label.js b/src/types/label.js index 112e26465..728f62609 100644 --- a/src/types/label.js +++ b/src/types/label.js @@ -42,7 +42,7 @@ export default class LabelAnnotation extends Element { labelWidth: labelSize.width, labelHeight: labelSize.height }; - properties.calloutPosition = options.callout.enabled && resolveCalloutPosition(properties, options.callout, options.rotation); + properties.calloutPosition = options.callout.display && resolveCalloutPosition(properties, options.callout, options.rotation); return properties; } } @@ -67,7 +67,7 @@ LabelAnnotation.defaults = { borderDashOffset: 0, borderJoinStyle: 'miter', borderWidth: 1, - enabled: false, + display: false, margin: 5, position: 'auto', side: 5, diff --git a/src/types/line.js b/src/types/line.js index 9e96343e4..3b7fbd840 100644 --- a/src/types/line.js +++ b/src/types/line.js @@ -74,7 +74,7 @@ export default class LineAnnotation extends Element { */ labelIsVisible(useFinalPosition, chartArea) { const labelOpts = this.options.label; - if (!labelOpts || !labelOpts.enabled) { + if (!labelOpts || !labelOpts.display) { return false; } return !chartArea || isLineInArea(this.getProps(['x', 'y', 'x2', 'y2'], useFinalPosition), chartArea); @@ -222,7 +222,7 @@ const arrowHeadsDefaults = { borderDashOffset: undefined, borderShadowColor: undefined, borderWidth: undefined, - enabled: undefined, + display: undefined, fill: undefined, length: undefined, shadowBlur: undefined, @@ -234,7 +234,7 @@ const arrowHeadsDefaults = { LineAnnotation.defaults = { adjustScaleRange: true, arrowHeads: { - enabled: false, + display: false, end: Object.assign({}, arrowHeadsDefaults), fill: false, length: 12, @@ -260,8 +260,8 @@ LineAnnotation.defaults = { borderWidth: 0, color: '#fff', content: null, + display: false, drawTime: undefined, - enabled: false, font: { family: undefined, lineHeight: undefined, @@ -447,7 +447,7 @@ function getArrowHeads(line) { } function getLineAdjust(line, arrowOpts) { - if (!arrowOpts || !arrowOpts.enabled) { + if (!arrowOpts || !arrowOpts.display) { return 0; } const {length, width} = arrowOpts; @@ -458,7 +458,7 @@ function getLineAdjust(line, arrowOpts) { } function drawArrowHead(ctx, offset, adjust, arrowOpts) { - if (!arrowOpts || !arrowOpts.enabled) { + if (!arrowOpts || !arrowOpts.display) { return; } const {length, width, fill, backgroundColor, borderColor} = arrowOpts; diff --git a/test/fixtures/box/label-dynamic.js b/test/fixtures/box/label-dynamic.js index 0d21a3270..dc64702f3 100644 --- a/test/fixtures/box/label-dynamic.js +++ b/test/fixtures/box/label-dynamic.js @@ -27,11 +27,11 @@ module.exports = { borderColor: 'rgba(255, 99, 132)', borderWidth: 5, label: { - enabled: false, + display: false, content: 'This is dynamic!', }, enter({chart, element}) { - element.options.label.enabled = true; + element.options.label.display = true; chart.draw(); } }, diff --git a/test/fixtures/box/label.js b/test/fixtures/box/label.js index 612d2d1a2..662a0f3f2 100644 --- a/test/fixtures/box/label.js +++ b/test/fixtures/box/label.js @@ -27,7 +27,7 @@ module.exports = { borderDash: [6, 6], borderWidth: 5, label: { - enabled: true, + display: true, content: 'This is a label', } }, @@ -41,7 +41,7 @@ module.exports = { borderColor: 'black', borderWidth: 15, label: { - enabled: true, + display: true, borderColor: 'green', content: 'This label tests clipping', position: 'start' @@ -58,7 +58,7 @@ module.exports = { borderDash: [6, 6], borderWidth: 5, label: { - enabled: true, + display: true, content: 'This is a label with different length', position: 'end' } @@ -74,7 +74,7 @@ module.exports = { borderDash: [6, 6], borderWidth: 5, label: { - enabled: true, + display: true, content: 'This is the label', color: 'red', position: { diff --git a/test/fixtures/box/labelCanvas.js b/test/fixtures/box/labelCanvas.js index a4eb8de98..84d61749c 100644 --- a/test/fixtures/box/labelCanvas.js +++ b/test/fixtures/box/labelCanvas.js @@ -29,7 +29,7 @@ module.exports = { borderColor: 'rgba(255, 99, 132)', borderWidth: 2, label: { - enabled: true, + display: true, position: 'start', content: window.createCanvas, width: '25%', @@ -46,7 +46,7 @@ module.exports = { borderColor: 'rgba(255, 99, 132)', borderWidth: 2, label: { - enabled: true, + display: true, position: 'end', content: window.createCanvas, width: '25%', @@ -63,7 +63,7 @@ module.exports = { borderColor: 'rgba(255, 99, 132)', borderWidth: 2, label: { - enabled: true, + display: true, position: { x: 'start', y: 'center' @@ -83,7 +83,7 @@ module.exports = { borderColor: 'rgba(255, 99, 132)', borderWidth: 2, label: { - enabled: true, + display: true, position: { x: 'center', y: 'end' diff --git a/test/fixtures/box/labelDecoration.js b/test/fixtures/box/labelDecoration.js index 87eabd697..6603baffa 100644 --- a/test/fixtures/box/labelDecoration.js +++ b/test/fixtures/box/labelDecoration.js @@ -28,7 +28,7 @@ module.exports = { borderColor: 'black', borderWidth: 1, label: { - enabled: true, + display: true, content: ['text stroke width 5', 'text stroke color red'], textStrokeWidth: 5, textStrokeColor: 'red', @@ -47,7 +47,7 @@ module.exports = { borderColor: 'black', borderWidth: 1, label: { - enabled: true, + display: true, textStrokeWidth: 3, color: 'white', content: 'text stroke width 3', @@ -66,7 +66,7 @@ module.exports = { borderColor: 'black', borderWidth: 1, label: { - enabled: true, + display: true, color: '#40E0D0', content: ['text stroke width 10', 'text stroke color turq'], textStrokeWidth: 10, diff --git a/test/fixtures/box/labelMultiline.js b/test/fixtures/box/labelMultiline.js index ef112c088..c7f6fa967 100644 --- a/test/fixtures/box/labelMultiline.js +++ b/test/fixtures/box/labelMultiline.js @@ -25,7 +25,7 @@ module.exports = { borderColor: 'red', borderWidth: 5, label: { - enabled: true, + display: true, content: ['This is a label', 'but this is multiline'], } }, @@ -39,7 +39,7 @@ module.exports = { borderColor: 'red', borderWidth: 5, label: { - enabled: true, + display: true, content: ['This is a label', 'but this is multiline'], position: 'start' } @@ -54,7 +54,7 @@ module.exports = { borderColor: 'red', borderWidth: 5, label: { - enabled: true, + display: true, content: ['This is a label', 'but this is multiline'], position: 'end' } @@ -69,7 +69,7 @@ module.exports = { borderColor: 'red', borderWidth: 5, label: { - enabled: true, + display: true, content: (ctx) => ['This is a label', 'type:' + ctx.type], color: 'red', position: { diff --git a/test/fixtures/box/labelPadding.js b/test/fixtures/box/labelPadding.js index 393f1280a..075dea589 100644 --- a/test/fixtures/box/labelPadding.js +++ b/test/fixtures/box/labelPadding.js @@ -25,7 +25,7 @@ module.exports = { borderColor: 'rgba(255, 99, 132)', borderWidth: 5, label: { - enabled: true, + display: true, content: 'box1: This is a label', position: 'start', padding: 15 @@ -41,7 +41,7 @@ module.exports = { borderColor: 'rgba(255, 99, 132)', borderWidth: 5, label: { - enabled: true, + display: true, content: 'box2: This is a label', position: 'start', padding: {x: 20} @@ -57,7 +57,7 @@ module.exports = { borderColor: 'rgba(255, 99, 132)', borderWidth: 5, label: { - enabled: true, + display: true, content: 'box3: This is a label with different length', position: 'end', padding: {y: 10} @@ -73,7 +73,7 @@ module.exports = { borderColor: 'rgba(255, 99, 132)', borderWidth: 5, label: { - enabled: true, + display: true, content: 'box4: This is the label', color: 'red', position: { diff --git a/test/fixtures/box/labelPosition.js b/test/fixtures/box/labelPosition.js index a6284394e..c0cba068e 100644 --- a/test/fixtures/box/labelPosition.js +++ b/test/fixtures/box/labelPosition.js @@ -29,7 +29,7 @@ module.exports = { borderColor: 'red', borderWidth: 2, label: { - enabled: true, + display: true, content: 'p: 0%,100%', position: { x: '0%', @@ -47,7 +47,7 @@ module.exports = { borderColor: 'red', borderWidth: 2, label: { - enabled: true, + display: true, content: 'p: 25%,75%', position: { x: '25%', @@ -65,7 +65,7 @@ module.exports = { borderColor: 'red', borderWidth: 2, label: { - enabled: true, + display: true, content: 'p: 50%,50%', position: { x: '50%', @@ -83,7 +83,7 @@ module.exports = { borderColor: 'red', borderWidth: 2, label: { - enabled: true, + display: true, content: 'p: 100%,0%', position: { x: '100%', diff --git a/test/fixtures/box/labelRotation.js b/test/fixtures/box/labelRotation.js index aedfb4fac..f3c9a21aa 100644 --- a/test/fixtures/box/labelRotation.js +++ b/test/fixtures/box/labelRotation.js @@ -26,7 +26,7 @@ module.exports = { backgroundColor: 'rgba(255, 99, 132, 0.5)', borderColor: 'rgba(255, 99, 132)', label: { - enabled: true, + display: true, rotation: 45, content: 'rotation: 45', } @@ -40,7 +40,7 @@ module.exports = { backgroundColor: 'rgba(255, 99, 132, 0.5)', borderColor: 'rgba(255, 99, 132)', label: { - enabled: true, + display: true, rotation: 90, content: 'rotation: 90', } @@ -54,7 +54,7 @@ module.exports = { backgroundColor: 'rgba(255, 99, 132, 0.5)', borderColor: 'rgba(255, 99, 132)', label: { - enabled: true, + display: true, rotation: 135, content: 'rotation: 135', } @@ -68,7 +68,7 @@ module.exports = { backgroundColor: 'rgba(255, 99, 132, 0.5)', borderColor: 'rgba(255, 99, 132)', label: { - enabled: true, + display: true, rotation: 180, content: 'rotation: 180', } @@ -82,7 +82,7 @@ module.exports = { backgroundColor: 'rgba(255, 99, 132, 0.5)', borderColor: 'rgba(255, 99, 132)', label: { - enabled: true, + display: true, rotation: 225, content: 'rotation: 225', } @@ -96,7 +96,7 @@ module.exports = { backgroundColor: 'rgba(255, 99, 132, 0.5)', borderColor: 'rgba(255, 99, 132)', label: { - enabled: true, + display: true, rotation: 270, content: 'rotation: 270', } @@ -110,7 +110,7 @@ module.exports = { backgroundColor: 'rgba(255, 99, 132, 0.5)', borderColor: 'rgba(255, 99, 132)', label: { - enabled: true, + display: true, rotation: 315, content: 'rotation: 315', } @@ -125,7 +125,7 @@ module.exports = { borderColor: 'rgba(255, 99, 132)', rotation: 45, label: { - enabled: true, + display: true, rotation: 0, content: ['box rot: 45', 'label rot: 0'] } diff --git a/test/fixtures/box/rotation.js b/test/fixtures/box/rotation.js index 024dfc5df..e5e271c33 100644 --- a/test/fixtures/box/rotation.js +++ b/test/fixtures/box/rotation.js @@ -29,7 +29,7 @@ module.exports = { borderWidth: 1, rotation: 45, label: { - enabled: true, + display: true, content: 'rot: 45' } }, @@ -44,7 +44,7 @@ module.exports = { borderWidth: 1, rotation: 90, label: { - enabled: true, + display: true, content: 'rot: 90' } }, @@ -59,7 +59,7 @@ module.exports = { borderWidth: 1, rotation: 135, label: { - enabled: true, + display: true, content: 'rot: 135' } }, @@ -74,7 +74,7 @@ module.exports = { borderWidth: 1, rotation: 180, label: { - enabled: true, + display: true, content: 'rot: 180' } }, @@ -89,7 +89,7 @@ module.exports = { borderWidth: 1, rotation: 225, label: { - enabled: true, + display: true, content: 'rot: 225' } }, @@ -104,7 +104,7 @@ module.exports = { borderWidth: 1, rotation: 270, label: { - enabled: true, + display: true, content: 'rot: 270' } }, @@ -119,7 +119,7 @@ module.exports = { borderWidth: 1, rotation: 315, label: { - enabled: true, + display: true, content: 'rot: 315' } } diff --git a/test/fixtures/box/shadow.js b/test/fixtures/box/shadow.js index 65489659a..26b321cb4 100644 --- a/test/fixtures/box/shadow.js +++ b/test/fixtures/box/shadow.js @@ -28,7 +28,7 @@ module.exports = { backgroundShadowColor: 'black', shadowBlur: 3, label: { - enabled: true, + display: true, content: 'no offset' } }, @@ -45,7 +45,7 @@ module.exports = { shadowBlur: 3, shadowOffsetX: 10, label: { - enabled: true, + display: true, content: 'offset x:10' } }, @@ -62,7 +62,7 @@ module.exports = { shadowBlur: 3, shadowOffsetY: 10, label: { - enabled: true, + display: true, content: 'offset y:10' } }, @@ -80,7 +80,7 @@ module.exports = { shadowOffsetX: 10, shadowOffsetY: 10, label: { - enabled: true, + display: true, content: ['offset', 'x:10', 'y:10'] } } diff --git a/test/fixtures/box/shadowColors.js b/test/fixtures/box/shadowColors.js index 3428e5dc1..5e64979cd 100644 --- a/test/fixtures/box/shadowColors.js +++ b/test/fixtures/box/shadowColors.js @@ -29,7 +29,7 @@ module.exports = { borderShadowColor: 'green', shadowBlur: 3, label: { - enabled: true, + display: true, content: 'no offset' } }, @@ -47,7 +47,7 @@ module.exports = { shadowBlur: 3, shadowOffsetX: 10, label: { - enabled: true, + display: true, content: 'offset x:10' } }, @@ -65,7 +65,7 @@ module.exports = { shadowBlur: 3, shadowOffsetY: 10, label: { - enabled: true, + display: true, content: 'offset y:10' } }, @@ -84,7 +84,7 @@ module.exports = { shadowOffsetX: 10, shadowOffsetY: 10, label: { - enabled: true, + display: true, content: ['offset', 'x:10', 'y:10'] } } diff --git a/test/fixtures/label/calloutBasic.js b/test/fixtures/label/calloutBasic.js index 528114e13..0ce0cecf0 100644 --- a/test/fixtures/label/calloutBasic.js +++ b/test/fixtures/label/calloutBasic.js @@ -27,7 +27,7 @@ module.exports = { xAdjust: 150, yAdjust: -70, callout: { - enabled: true, + display: true, } }, overlap: { @@ -41,7 +41,7 @@ module.exports = { xAdjust: 1, yAdjust: 1, callout: { - enabled: true, + display: true, } }, crossLabel: { @@ -55,7 +55,7 @@ module.exports = { xAdjust: 100, yAdjust: -50, callout: { - enabled: true, + display: true, position: 'right', side: 10 } @@ -71,7 +71,7 @@ module.exports = { xAdjust: 150, yAdjust: -100, callout: { - enabled: true, + display: true, side: 10, borderColor: 'red', borderWidth: 2, diff --git a/test/fixtures/label/calloutCanvas.js b/test/fixtures/label/calloutCanvas.js index 44ddc99fb..64829a36b 100644 --- a/test/fixtures/label/calloutCanvas.js +++ b/test/fixtures/label/calloutCanvas.js @@ -31,7 +31,7 @@ module.exports = { xAdjust: -150, yAdjust: -230, callout: { - enabled: true, + display: true, position: 'bottom' } } diff --git a/test/fixtures/label/calloutHorizontalPosition.js b/test/fixtures/label/calloutHorizontalPosition.js index c6f15e02e..0014f723d 100644 --- a/test/fixtures/label/calloutHorizontalPosition.js +++ b/test/fixtures/label/calloutHorizontalPosition.js @@ -30,7 +30,7 @@ module.exports = { xAdjust: -50, yAdjust: -50, callout: { - enabled: true, + display: true, position: 'right' } }, @@ -54,7 +54,7 @@ module.exports = { xAdjust: 50, yAdjust: 50, callout: { - enabled: true, + display: true, position: 'left', }, }, @@ -77,7 +77,7 @@ module.exports = { }, xAdjust: -50, callout: { - enabled: true, + display: true, position: 'auto', }, }, @@ -100,7 +100,7 @@ module.exports = { }, xAdjust: 50, callout: { - enabled: true, + display: true, position: 'auto', }, }, @@ -123,7 +123,7 @@ module.exports = { }, xAdjust: 50, callout: { - enabled: true, + display: true, position: 'left', borderWidth: 0 }, @@ -147,7 +147,7 @@ module.exports = { }, xAdjust: 50, callout: { - enabled: true, + display: true, position: 'wrong' }, }, diff --git a/test/fixtures/label/calloutRotation.js b/test/fixtures/label/calloutRotation.js index 23d835626..db2b6de1d 100644 --- a/test/fixtures/label/calloutRotation.js +++ b/test/fixtures/label/calloutRotation.js @@ -28,7 +28,7 @@ module.exports = { yAdjust: -70, rotation: 101, callout: { - enabled: true, + display: true, } }, overlap: { @@ -43,7 +43,7 @@ module.exports = { yAdjust: 1, rotation: 199, callout: { - enabled: true, + display: true, } }, crossLabel: { @@ -58,7 +58,7 @@ module.exports = { yAdjust: -50, rotation: 32, callout: { - enabled: true, + display: true, position: 'right', side: 10 } @@ -75,7 +75,7 @@ module.exports = { yAdjust: -100, rotation: 310, callout: { - enabled: true, + display: true, side: 10, borderColor: 'red', borderWidth: 2, diff --git a/test/fixtures/label/calloutScriptableOptions.js b/test/fixtures/label/calloutScriptableOptions.js index 66e23d200..a10952e5d 100644 --- a/test/fixtures/label/calloutScriptableOptions.js +++ b/test/fixtures/label/calloutScriptableOptions.js @@ -31,7 +31,7 @@ module.exports = { xAdjust: 150, yAdjust: -100, callout: { - enabled: true, + display: true, margin: () => 10, side: () => 10, start: () => '80%', diff --git a/test/fixtures/label/calloutSizing.js b/test/fixtures/label/calloutSizing.js index 684d5086c..b86bb38b4 100644 --- a/test/fixtures/label/calloutSizing.js +++ b/test/fixtures/label/calloutSizing.js @@ -31,7 +31,7 @@ module.exports = { xAdjust: -50, yAdjust: -50, callout: { - enabled: true, + display: true, margin: 10, position: 'right', } @@ -57,7 +57,7 @@ module.exports = { xAdjust: 50, yAdjust: 50, callout: { - enabled: true, + display: true, margin: 0, position: 'left', } @@ -83,7 +83,7 @@ module.exports = { xAdjust: -50, yAdjust: -50, callout: { - enabled: true, + display: true, start: '10%', side: 20, position: 'bottom', @@ -110,7 +110,7 @@ module.exports = { xAdjust: 50, yAdjust: 50, callout: { - enabled: true, + display: true, start: 80, side: 20, position: 'top', @@ -137,7 +137,7 @@ module.exports = { xAdjust: -20, yAdjust: -40, callout: { - enabled: true, + display: true, start: '10%', position: 'bottom' } @@ -163,7 +163,7 @@ module.exports = { xAdjust: 20, yAdjust: 50, callout: { - enabled: true, + display: true, start: 40, position: 'top' } @@ -186,7 +186,7 @@ module.exports = { xAdjust: -70, yAdjust: 70, callout: { - enabled: true, + display: true, start: 'invalid' } }, diff --git a/test/fixtures/label/calloutVerticalPosition.js b/test/fixtures/label/calloutVerticalPosition.js index fc53c52a7..970bf57c5 100644 --- a/test/fixtures/label/calloutVerticalPosition.js +++ b/test/fixtures/label/calloutVerticalPosition.js @@ -30,7 +30,7 @@ module.exports = { xAdjust: -50, yAdjust: -50, callout: { - enabled: true, + display: true, position: 'bottom', } }, @@ -55,7 +55,7 @@ module.exports = { xAdjust: 50, yAdjust: 50, callout: { - enabled: true, + display: true, position: 'top', } }, @@ -76,7 +76,7 @@ module.exports = { position: 'center', yAdjust: 50, callout: { - enabled: true, + display: true, position: 'auto', } }, @@ -97,7 +97,7 @@ module.exports = { position: 'center', yAdjust: -50, callout: { - enabled: true, + display: true, position: 'auto', } }, @@ -118,7 +118,7 @@ module.exports = { position: 'center', yAdjust: -50, callout: { - enabled: true, + display: true, position: 'auto', borderWidth: 0 } @@ -140,7 +140,7 @@ module.exports = { position: 'center', yAdjust: 50, callout: { - enabled: true, + display: true, position: 'wrong' } }, diff --git a/test/fixtures/label/contentMultiline.js b/test/fixtures/label/contentMultiline.js index 855a6473d..005145e2b 100644 --- a/test/fixtures/label/contentMultiline.js +++ b/test/fixtures/label/contentMultiline.js @@ -52,7 +52,7 @@ module.exports = { xValue: 'March', yValue: 5, callout: { - enabled: true + display: true } }, emptyContent: { @@ -67,7 +67,7 @@ module.exports = { yValue: 5, content: '', callout: { - enabled: true + display: true } } } diff --git a/test/fixtures/label/noCalloutIfAdjusted.js b/test/fixtures/label/noCalloutIfAdjusted.js index bfdc33c38..31721f9da 100644 --- a/test/fixtures/label/noCalloutIfAdjusted.js +++ b/test/fixtures/label/noCalloutIfAdjusted.js @@ -27,7 +27,7 @@ module.exports = { xAdjust: 50, yAdjust: -100 }, - enabled: { + display: { type: 'label', xValue: 'May', yValue: 12.5, @@ -38,7 +38,7 @@ module.exports = { xAdjust: 50, yAdjust: -100, callout: { - enabled: true + display: true } } } diff --git a/test/fixtures/line/arrowHeads.js b/test/fixtures/line/arrowHeads.js index 3788e13f8..2e9402dde 100644 --- a/test/fixtures/line/arrowHeads.js +++ b/test/fixtures/line/arrowHeads.js @@ -27,16 +27,16 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'start: true, end: true', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, length: 30, width: 15 }, end: { - enabled: true, + display: true, length: 30, width: 15 } @@ -53,11 +53,11 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'start: true', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, length: 30, width: 15 }, @@ -74,11 +74,11 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'end: true', - enabled: true + display: true }, arrowHeads: { end: { - enabled: true, + display: true, length: 30, width: 15 }, @@ -95,11 +95,11 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'start: dash', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, borderDash: [3, 6], borderDashOffset: 0, length: 30, @@ -119,11 +119,11 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'end: width 30', - enabled: true + display: true }, arrowHeads: { end: { - enabled: true, + display: true, length: 40, width: 30 }, @@ -140,16 +140,16 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'borderWidth 0', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, length: 15, width: 5 }, end: { - enabled: true, + display: true, length: 15, width: 5 } @@ -166,16 +166,16 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'horizontal', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, length: 15, width: 5 }, end: { - enabled: true, + display: true, length: 15, width: 5 } @@ -192,16 +192,16 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'vertical', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, length: 15, width: 5 }, end: { - enabled: true, + display: true, length: 15, width: 5 } diff --git a/test/fixtures/line/arrowHeadsDeleteAtRuntime.js b/test/fixtures/line/arrowHeadsDeleteAtRuntime.js index 3475e3b9b..10bf9f99f 100644 --- a/test/fixtures/line/arrowHeadsDeleteAtRuntime.js +++ b/test/fixtures/line/arrowHeadsDeleteAtRuntime.js @@ -26,7 +26,7 @@ module.exports = { borderColor: 'blue', borderWidth: 4, label: { - enabled: true, + display: true, backgroundColor: 'white', content: 'remove start' }, @@ -34,10 +34,10 @@ module.exports = { length: 30, width: 15, start: { - enabled: true, + display: true, }, end: { - enabled: true, + display: true, } }, click({chart, element}) { @@ -54,7 +54,7 @@ module.exports = { borderColor: 'purple', borderWidth: 4, label: { - enabled: true, + display: true, backgroundColor: 'white', content: 'remove end' }, @@ -62,10 +62,10 @@ module.exports = { length: 30, width: 15, start: { - enabled: true, + display: true, }, end: { - enabled: true, + display: true, } }, click({chart, element}) { @@ -82,7 +82,7 @@ module.exports = { borderColor: 'red', borderWidth: 4, label: { - enabled: true, + display: true, backgroundColor: 'white', content: 'remove start and end' }, @@ -90,10 +90,10 @@ module.exports = { length: 30, width: 15, start: { - enabled: true, + display: true, }, end: { - enabled: true, + display: true, } }, click({chart, element}) { diff --git a/test/fixtures/line/arrowHeadsFallback.js b/test/fixtures/line/arrowHeadsFallback.js index 853787b90..51dbf0383 100644 --- a/test/fixtures/line/arrowHeadsFallback.js +++ b/test/fixtures/line/arrowHeadsFallback.js @@ -1,4 +1,5 @@ module.exports = { + tolerance: 0.0020, config: { type: 'line', options: { @@ -17,11 +18,11 @@ module.exports = { borderColor: 'blue', borderWidth: 4, label: { - enabled: true, - content: ['start and end are enabled', 'without options'] + display: true, + content: ['start and end are displayed', 'without options'] }, arrowHeads: { - enabled: true, + display: true, fill: true, borderColor: 'blue', length: 30, @@ -35,8 +36,8 @@ module.exports = { borderColor: 'purple', borderWidth: 4, label: { - enabled: true, - content: ['only start has options', 'and is enabled'] + display: true, + content: ['only start has options', 'and is displayed'] }, arrowHeads: { fill: true, @@ -44,7 +45,7 @@ module.exports = { length: 30, width: 15, start: { - enabled: true, + display: true, } } }, @@ -55,17 +56,17 @@ module.exports = { borderColor: 'red', borderWidth: 4, label: { - enabled: true, + display: true, content: ['only start has options', 'and is not filled'] }, arrowHeads: { - enabled: true, + display: true, fill: true, borderColor: 'red', length: 30, width: 15, start: { - enabled: true, + display: true, fill: false } } diff --git a/test/fixtures/line/arrowHeadsFallback.png b/test/fixtures/line/arrowHeadsFallback.png index 8dd003737..425a6b6eb 100644 Binary files a/test/fixtures/line/arrowHeadsFallback.png and b/test/fixtures/line/arrowHeadsFallback.png differ diff --git a/test/fixtures/line/arrowHeadsFill.js b/test/fixtures/line/arrowHeadsFill.js index 2f422bd85..2cb178dfb 100644 --- a/test/fixtures/line/arrowHeadsFill.js +++ b/test/fixtures/line/arrowHeadsFill.js @@ -27,17 +27,17 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'start: true, end: true', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, fill: true, length: 30, width: 15 }, end: { - enabled: true, + display: true, fill: true, length: 30, width: 15 @@ -55,11 +55,11 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'start: true', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, fill: true, backgroundColor: 'orange', length: 30, @@ -78,11 +78,11 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'end: true', - enabled: true + display: true }, arrowHeads: { end: { - enabled: true, + display: true, fill: true, backgroundColor: 'orange', borderColor: 'orange', @@ -103,11 +103,11 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'start: dash', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, borderDash: [3, 6], borderDashOffset: 0, fill: true, @@ -129,11 +129,11 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'end: width 30', - enabled: true + display: true }, arrowHeads: { end: { - enabled: true, + display: true, fill: true, backgroundColor: 'transparent', length: 40, @@ -152,17 +152,17 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'borderWidth 0', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, length: 15, width: 5, fill: true, }, end: { - enabled: true, + display: true, length: 15, width: 5, fill: true, @@ -181,18 +181,18 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'horizontal', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, length: 15, width: 5, fill: true, backgroundColor: 'lightGreen', }, end: { - enabled: true, + display: true, length: 15, width: 5, fill: true, @@ -211,18 +211,18 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'vertical', - enabled: true + display: true }, arrowHeads: { start: { - enabled: true, + display: true, length: 15, width: 5, fill: true, backgroundColor: 'lightGreen', }, end: { - enabled: true, + display: true, length: 15, width: 5, fill: true, diff --git a/test/fixtures/line/arrowHeadsFillScriptableOptions.js b/test/fixtures/line/arrowHeadsFillScriptableOptions.js index 8e38b088c..65aaade48 100644 --- a/test/fixtures/line/arrowHeadsFillScriptableOptions.js +++ b/test/fixtures/line/arrowHeadsFillScriptableOptions.js @@ -27,17 +27,17 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'start: true, end: true', - enabled: true + display: true }, arrowHeads: { start: { - enabled: () => true, + display: () => true, fill: () => true, length: () => 30, width: () => 15 }, end: { - enabled: () => true, + display: () => true, fill: () => true, length: () => 30, width: () => 15 @@ -55,12 +55,12 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'start: true', - enabled: true + display: true }, arrowHeads: { start() { return { - enabled: true, + display: true, fill: true, backgroundColor: 'orange', length: 30, @@ -81,12 +81,12 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'end: true', - enabled: true + display: true }, arrowHeads: { end() { return { - enabled: true, + display: true, fill: true, backgroundColor: 'orange', borderColor: 'orange', diff --git a/test/fixtures/line/label-border.js b/test/fixtures/line/label-border.js index a80621b03..ce5c4817f 100644 --- a/test/fixtures/line/label-border.js +++ b/test/fixtures/line/label-border.js @@ -32,7 +32,7 @@ module.exports = { borderWidth: 3, borderDash: [6, 6], content: 'dashed 3px black border', - enabled: true + display: true }, }, } diff --git a/test/fixtures/line/label-dynamic-hide.js b/test/fixtures/line/label-dynamic-hide.js index 3e45a98fc..e59816636 100644 --- a/test/fixtures/line/label-dynamic-hide.js +++ b/test/fixtures/line/label-dynamic-hide.js @@ -33,14 +33,14 @@ module.exports = { borderWidth: 3, borderDash: [6, 6], content: 'dynamic label', - enabled: false + display: false }, enter({chart, element}) { - element.options.label.enabled = true; + element.options.label.display = true; chart.draw(); }, leave({chart, element}) { - element.options.label.enabled = false; + element.options.label.display = false; chart.draw(); } }, diff --git a/test/fixtures/line/label-dynamic-show.js b/test/fixtures/line/label-dynamic-show.js index 4f26c6742..e5723db73 100644 --- a/test/fixtures/line/label-dynamic-show.js +++ b/test/fixtures/line/label-dynamic-show.js @@ -33,10 +33,10 @@ module.exports = { borderWidth: 3, borderDash: [6, 6], content: 'dynamic label', - enabled: false + display: false }, enter({chart, element}) { - element.options.label.enabled = true; + element.options.label.display = true; chart.draw(); } }, diff --git a/test/fixtures/line/labelCanvas.js b/test/fixtures/line/labelCanvas.js index 23252b0ba..36b412f0f 100644 --- a/test/fixtures/line/labelCanvas.js +++ b/test/fixtures/line/labelCanvas.js @@ -34,7 +34,7 @@ module.exports = { content: window.createCanvas, width: '25%', height: '25%', - enabled: true + display: true }, }, } diff --git a/test/fixtures/line/labelDecoration.js b/test/fixtures/line/labelDecoration.js index c49061df3..19bb908b8 100644 --- a/test/fixtures/line/labelDecoration.js +++ b/test/fixtures/line/labelDecoration.js @@ -25,7 +25,7 @@ module.exports = { borderColor: 'black', borderWidth: 5, label: { - enabled: true, + display: true, backgroundColor: '#f5f5f5', borderColor: 'black', borderWidth: 1, @@ -45,7 +45,7 @@ module.exports = { borderColor: 'black', borderWidth: 5, label: { - enabled: true, + display: true, backgroundColor: '#f5f5f5', borderColor: 'black', borderWidth: 1, @@ -64,7 +64,7 @@ module.exports = { borderColor: 'black', borderWidth: 5, label: { - enabled: true, + display: true, backgroundColor: '#f5f5f5', borderColor: 'black', borderWidth: 1, diff --git a/test/fixtures/line/labelShadow.js b/test/fixtures/line/labelShadow.js index 1641e9afe..964820dae 100644 --- a/test/fixtures/line/labelShadow.js +++ b/test/fixtures/line/labelShadow.js @@ -27,7 +27,7 @@ module.exports = { position: 'start', backgroundColor: 'red', content: 'no offset', - enabled: true, + display: true, backgroundShadowColor: 'black', shadowBlur: 12 }, @@ -42,7 +42,7 @@ module.exports = { position: 'center', backgroundColor: 'red', content: 'offset x: 10', - enabled: true, + display: true, backgroundShadowColor: 'black', shadowBlur: 3, shadowOffsetX: 10 @@ -58,7 +58,7 @@ module.exports = { position: 'end', backgroundColor: 'black', content: 'offset y: 10', - enabled: true, + display: true, backgroundShadowColor: 'black', shadowBlur: 3, shadowOffsetY: 10 @@ -74,7 +74,7 @@ module.exports = { position: 'start', backgroundColor: 'red', content: 'offset x: 10, y:10', - enabled: true, + display: true, backgroundShadowColor: 'black', shadowBlur: 3, shadowOffsetX: 10, diff --git a/test/fixtures/line/labelShadowColors.js b/test/fixtures/line/labelShadowColors.js index 574ccf05f..ed06cf1fb 100644 --- a/test/fixtures/line/labelShadowColors.js +++ b/test/fixtures/line/labelShadowColors.js @@ -29,7 +29,7 @@ module.exports = { borderColor: 'rgb(101, 33, 171)', borderWidth: 2, content: 'no offset', - enabled: true, + display: true, backgroundShadowColor: 'black', borderShadowColor: 'orange', shadowBlur: 12 @@ -47,7 +47,7 @@ module.exports = { borderColor: 'rgb(101, 33, 171)', borderWidth: 2, content: 'offset x: 10', - enabled: true, + display: true, backgroundShadowColor: 'black', borderShadowColor: 'orange', shadowBlur: 3, @@ -66,7 +66,7 @@ module.exports = { borderColor: 'rgb(101, 33, 171)', borderWidth: 2, content: 'offset y: 10', - enabled: true, + display: true, backgroundShadowColor: 'black', borderShadowColor: 'orange', shadowBlur: 3, @@ -85,7 +85,7 @@ module.exports = { borderColor: 'rgb(101, 33, 171)', borderWidth: 2, content: 'offset x: 10, y:10', - enabled: true, + display: true, backgroundShadowColor: 'black', borderShadowColor: 'orange', shadowBlur: 3, diff --git a/test/fixtures/line/label_drawTime.js b/test/fixtures/line/label_drawTime.js index 19a630a31..ca57021bb 100644 --- a/test/fixtures/line/label_drawTime.js +++ b/test/fixtures/line/label_drawTime.js @@ -29,7 +29,7 @@ module.exports = { position: 'start', backgroundColor: 'red', content: 'afterDraw/undefined', - enabled: true + display: true }, }, hCenter: { @@ -43,7 +43,7 @@ module.exports = { position: 'center', backgroundColor: 'red', content: 'beforeDraw/afterDraw', - enabled: true + display: true }, }, right: { @@ -58,7 +58,7 @@ module.exports = { position: 'end', backgroundColor: 'black', content: 'afterDraw/beforeDraw', - enabled: true + display: true }, }, top: { @@ -71,7 +71,7 @@ module.exports = { position: 'start', backgroundColor: 'red', content: 'fallback/fallback', - enabled: true + display: true } }, bottomRight: { @@ -83,7 +83,7 @@ module.exports = { position: 'end', backgroundColor: 'green', content: 'fallback = beforeDraw', - enabled: true + display: true } } } diff --git a/test/fixtures/line/labelsScriptableOptions.js b/test/fixtures/line/labelsScriptableOptions.js index 5e6a31b7b..e7e671f60 100644 --- a/test/fixtures/line/labelsScriptableOptions.js +++ b/test/fixtures/line/labelsScriptableOptions.js @@ -50,7 +50,7 @@ module.exports = { content() { return 'auto rotation'; }, - enabled() { + display() { return true; }, }, @@ -91,7 +91,7 @@ module.exports = { content() { return 'auto rotation'; }, - enabled() { + display() { return true; }, }, @@ -132,7 +132,7 @@ module.exports = { content() { return 'auto rotation'; }, - enabled() { + display() { return true; }, }, @@ -173,7 +173,7 @@ module.exports = { content() { return 'auto rotation'; }, - enabled() { + display() { return true; }, }, @@ -214,7 +214,7 @@ module.exports = { content() { return 'rotated 90'; }, - enabled() { + display() { return true; }, }, @@ -255,7 +255,7 @@ module.exports = { content() { return 'rotated -80'; }, - enabled() { + display() { return true; }, }, diff --git a/test/fixtures/line/missingValuesStacked.js b/test/fixtures/line/missingValuesStacked.js index 542bc9c6a..bc7130ce7 100644 --- a/test/fixtures/line/missingValuesStacked.js +++ b/test/fixtures/line/missingValuesStacked.js @@ -40,7 +40,7 @@ module.exports = { borderWidth: 2, value: 1, label: { - enabled: true, + display: true, content: 'Cross scales', backgroundColor: 'white', color: 'black' @@ -53,7 +53,7 @@ module.exports = { xMin: 3, xMax: 3, label: { - enabled: true, + display: true, content: ['Limited to', 'bottom scale'], backgroundColor: 'white', color: 'black' @@ -66,7 +66,7 @@ module.exports = { xMin: 5, xMax: 5, label: { - enabled: true, + display: true, content: ['Limited to', 'top scale'], backgroundColor: 'white', color: 'black' diff --git a/test/fixtures/line/missingYMinMax.js b/test/fixtures/line/missingYMinMax.js index b75d994d2..b6bb91c06 100644 --- a/test/fixtures/line/missingYMinMax.js +++ b/test/fixtures/line/missingYMinMax.js @@ -36,7 +36,7 @@ module.exports = { borderWidth: 2, yMin: 3, label: { - enabled: true, + display: true, content: ['yMin: 3', 'yMax: scale.top'], backgroundColor: 'white', color: 'black' @@ -47,7 +47,7 @@ module.exports = { borderWidth: 2, yMax: 5, label: { - enabled: true, + display: true, content: ['yMin: scale:bottom', 'yMax: 5'], backgroundColor: 'white', color: 'black' @@ -59,7 +59,7 @@ module.exports = { borderWidth: 2, yMin: 3, label: { - enabled: true, + display: true, content: ['reverse', 'yMin: 3', 'yMax: scale.bottom'], backgroundColor: 'white', color: 'black' @@ -71,7 +71,7 @@ module.exports = { borderWidth: 2, yMax: 5, label: { - enabled: true, + display: true, content: ['reverse', 'yMin: scale:top', 'yMax: 5'], backgroundColor: 'white', color: 'black' diff --git a/test/fixtures/line/out-of-range-value0.js b/test/fixtures/line/out-of-range-value0.js index 833a19bc1..4bdb9d307 100644 --- a/test/fixtures/line/out-of-range-value0.js +++ b/test/fixtures/line/out-of-range-value0.js @@ -21,7 +21,7 @@ module.exports = { label: { backgroundColor: 'red', content: 'should be drawn', - enabled: true + display: true } } } diff --git a/test/fixtures/line/out-of-range.js b/test/fixtures/line/out-of-range.js index 89dcc80dc..660b7de48 100644 --- a/test/fixtures/line/out-of-range.js +++ b/test/fixtures/line/out-of-range.js @@ -26,7 +26,7 @@ module.exports = { label: { backgroundColor: 'red', content: 'shold not be drawn', - enabled: true + display: true } } } diff --git a/test/fixtures/line/padding.js b/test/fixtures/line/padding.js index 8d50e07e4..b4b12da47 100644 --- a/test/fixtures/line/padding.js +++ b/test/fixtures/line/padding.js @@ -29,7 +29,7 @@ module.exports = { position: 'start', backgroundColor: 'red', content: 'padding: 10', - enabled: true, + display: true, padding: 10 }, }, @@ -45,7 +45,7 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'padding: {x: 10, y: 15}', - enabled: true, + display: true, padding: {x: 10, y: 15} }, }, @@ -61,7 +61,7 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'padding: {left: 10, top: 15, right: 3, bottom: 2}', - enabled: true, + display: true, padding() { return {left: 10, top: 15, right: 3, bottom: 2}; } diff --git a/test/fixtures/line/position.js b/test/fixtures/line/position.js index c64f1bc28..e39ed98f0 100644 --- a/test/fixtures/line/position.js +++ b/test/fixtures/line/position.js @@ -27,7 +27,7 @@ module.exports = { position: 'start', backgroundColor: 'black', content: 'start', - enabled: true + display: true }, }, hCenter: { @@ -40,7 +40,7 @@ module.exports = { position: 'center', backgroundColor: 'black', content: 'center', - enabled: true + display: true }, }, right: { @@ -53,7 +53,7 @@ module.exports = { position: 'end', backgroundColor: 'black', content: 'end', - enabled: true + display: true }, }, top: { @@ -66,7 +66,7 @@ module.exports = { position: 'start', backgroundColor: 'red', content: 'start', - enabled: true + display: true } }, vCenter: { @@ -79,7 +79,7 @@ module.exports = { position: 'center', backgroundColor: 'red', content: 'center', - enabled: true + display: true } }, bottom: { @@ -92,7 +92,7 @@ module.exports = { position: 'end', backgroundColor: 'red', content: 'end', - enabled: true + display: true } } } diff --git a/test/fixtures/line/positionPercent.js b/test/fixtures/line/positionPercent.js index 91220893e..2f64e8731 100644 --- a/test/fixtures/line/positionPercent.js +++ b/test/fixtures/line/positionPercent.js @@ -27,7 +27,7 @@ module.exports = { position: '0%', backgroundColor: 'black', content: '0%', - enabled: true + display: true } }, l1: { @@ -40,7 +40,7 @@ module.exports = { position: '10%', backgroundColor: 'black', content: '10%', - enabled: true + display: true } }, l2: { @@ -53,7 +53,7 @@ module.exports = { position: '20%', backgroundColor: 'black', content: '20%', - enabled: true + display: true } }, l3: { @@ -66,7 +66,7 @@ module.exports = { position: '30%', backgroundColor: 'black', content: '30%', - enabled: true + display: true } }, l4: { @@ -79,7 +79,7 @@ module.exports = { position: '40%', backgroundColor: 'black', content: '40%', - enabled: true + display: true } }, l5: { @@ -92,7 +92,7 @@ module.exports = { position: '50%', backgroundColor: 'black', content: '50%', - enabled: true + display: true } }, l6: { @@ -105,7 +105,7 @@ module.exports = { position: '60%', backgroundColor: 'black', content: '60%', - enabled: true + display: true } }, l7: { @@ -118,7 +118,7 @@ module.exports = { position: '70%', backgroundColor: 'black', content: '70%', - enabled: true + display: true } }, l8: { @@ -131,7 +131,7 @@ module.exports = { position: '80%', backgroundColor: 'black', content: '80%', - enabled: true + display: true } }, l9: { @@ -144,7 +144,7 @@ module.exports = { position: '90%', backgroundColor: 'black', content: '90%', - enabled: true + display: true } }, l10: { @@ -157,7 +157,7 @@ module.exports = { position: '100%', backgroundColor: 'black', content: '100%', - enabled: true + display: true } }, } diff --git a/test/fixtures/line/rotation.js b/test/fixtures/line/rotation.js index 31168f584..9ba6cf150 100644 --- a/test/fixtures/line/rotation.js +++ b/test/fixtures/line/rotation.js @@ -29,7 +29,7 @@ module.exports = { position: 'start', backgroundColor: 'red', content: 'auto rotation', - enabled: true + display: true }, }, auto2: { @@ -44,7 +44,7 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'auto rotation', - enabled: true + display: true }, }, auto3: { @@ -59,7 +59,7 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'auto rotation', - enabled: true + display: true }, }, auto4: { @@ -74,7 +74,7 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'auto rotation', - enabled: true + display: true }, }, man1: { @@ -89,7 +89,7 @@ module.exports = { rotation: 90, backgroundColor: 'red', content: 'rotated 90', - enabled: true + display: true }, }, man2: { @@ -104,7 +104,7 @@ module.exports = { rotation: -80, backgroundColor: 'red', content: 'rotated -80', - enabled: true + display: true }, } } diff --git a/test/fixtures/line/scriptableOptions.js b/test/fixtures/line/scriptableOptions.js index 5bbba1c79..48405a8d8 100644 --- a/test/fixtures/line/scriptableOptions.js +++ b/test/fixtures/line/scriptableOptions.js @@ -42,7 +42,7 @@ module.exports = { position: 'start', backgroundColor: 'red', content: 'auto rotation', - enabled: true + display: true }, }, auto2: { @@ -75,7 +75,7 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'auto rotation', - enabled: true + display: true }, }, auto3: { @@ -108,7 +108,7 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'auto rotation', - enabled: true + display: true }, }, auto4: { @@ -141,7 +141,7 @@ module.exports = { rotation: 'auto', backgroundColor: 'red', content: 'auto rotation', - enabled: true + display: true }, }, man1: { @@ -174,7 +174,7 @@ module.exports = { rotation: 90, backgroundColor: 'red', content: 'rotated 90', - enabled: true + display: true }, }, man2: { @@ -207,7 +207,7 @@ module.exports = { rotation: -80, backgroundColor: 'red', content: 'rotated -80', - enabled: true + display: true }, } } diff --git a/test/fixtures/line/shadowArrowHeads.js b/test/fixtures/line/shadowArrowHeads.js index 4627b6ced..59d8dd01a 100644 --- a/test/fixtures/line/shadowArrowHeads.js +++ b/test/fixtures/line/shadowArrowHeads.js @@ -22,7 +22,7 @@ module.exports = { shadowBlur: 12, arrowHeads: { start: { - enabled: true, + display: true, borderColor: 'blue', borderShadowColor: 'black', shadowBlur: 12, @@ -30,7 +30,7 @@ module.exports = { width: 15 }, end: { - enabled: true, + display: true, borderColor: 'blue', borderShadowColor: 'black', shadowBlur: 12, @@ -52,7 +52,7 @@ module.exports = { shadowOffsetX: 10, arrowHeads: { start: { - enabled: true, + display: true, borderColor: 'purple', borderShadowColor: 'black', shadowBlur: 12, @@ -61,7 +61,7 @@ module.exports = { width: 15 }, end: { - enabled: true, + display: true, borderColor: 'purple', borderShadowColor: 'black', shadowBlur: 12, @@ -85,7 +85,7 @@ module.exports = { shadowOffsetY: 10, arrowHeads: { start: { - enabled: true, + display: true, borderColor: 'red', borderShadowColor: 'black', shadowBlur: 12, @@ -95,7 +95,7 @@ module.exports = { width: 15 }, end: { - enabled: true, + display: true, borderColor: 'red', borderShadowColor: 'black', shadowBlur: 12, diff --git a/test/fixtures/line/shadowArrowHeadsFill.js b/test/fixtures/line/shadowArrowHeadsFill.js index ee31967ae..6151d7621 100644 --- a/test/fixtures/line/shadowArrowHeadsFill.js +++ b/test/fixtures/line/shadowArrowHeadsFill.js @@ -22,7 +22,7 @@ module.exports = { shadowBlur: 12, arrowHeads: { start: { - enabled: true, + display: true, fill: true, borderColor: 'blue', backgroundShadowColor: 'black', @@ -31,7 +31,7 @@ module.exports = { width: 15 }, end: { - enabled: true, + display: true, fill: true, borderColor: 'blue', backgroundShadowColor: 'black', @@ -54,7 +54,7 @@ module.exports = { shadowOffsetX: 10, arrowHeads: { start: { - enabled: true, + display: true, fill: true, borderColor: 'purple', backgroundShadowColor: 'black', @@ -64,7 +64,7 @@ module.exports = { width: 15 }, end: { - enabled: true, + display: true, fill: true, borderColor: 'purple', backgroundShadowColor: 'black', @@ -89,7 +89,7 @@ module.exports = { shadowOffsetY: 10, arrowHeads: { start: { - enabled: true, + display: true, fill: true, borderColor: 'red', backgroundShadowColor: 'black', @@ -100,7 +100,7 @@ module.exports = { width: 15 }, end: { - enabled: true, + display: true, fill: true, borderColor: 'red', backgroundShadowColor: 'black', diff --git a/test/specs/line.spec.js b/test/specs/line.spec.js index de4286304..7046fa81f 100644 --- a/test/specs/line.spec.js +++ b/test/specs/line.spec.js @@ -61,7 +61,7 @@ describe('Line annotation', function() { scaleID: 'y', value: 5, label: { - enabled: true, + display: true, content: 'Label of the element', rotation } @@ -165,7 +165,7 @@ describe('Line annotation', function() { yMax: 8, borderWidth: 0, label: { - enabled: true, + display: true, content: ['outer label row 1', 'outer label row 2', 'outer label row 3'], borderWidth: 0 } @@ -178,7 +178,7 @@ describe('Line annotation', function() { yMax: 8, borderWidth: 0, label: { - enabled: true, + display: true, content: ['inner label 1', 'inner label 2'], borderWidth: 0 } diff --git a/types/label.d.ts b/types/label.d.ts index c984494e2..ce6e34cfc 100644 --- a/types/label.d.ts +++ b/types/label.d.ts @@ -82,10 +82,10 @@ export interface ContainedLabelOptions extends CoreLabelOptions { export interface LabelOptions extends ContainedLabelOptions, ShadowOptions { position?: Scriptable, /** - * Whether the label is enabled and should be displayed + * Whether the label should be displayed * @default true */ - enabled?: Scriptable, + display?: Scriptable, /** * Rotation of label, in degrees, or 'auto' to use the degrees of the line, default is 0 * @default 90 @@ -96,10 +96,10 @@ export interface LabelOptions extends ContainedLabelOptions, ShadowOptions { export interface BoxLabelOptions extends CoreLabelOptions { position?: Scriptable, /** - * Whether the label is enabled and should be displayed + * Whether the label should be displayed * @default true */ - enabled?: Scriptable, + display?: Scriptable, rotation?: Scriptable } diff --git a/types/options.d.ts b/types/options.d.ts index 2213cf6bb..e1d645519 100644 --- a/types/options.d.ts +++ b/types/options.d.ts @@ -62,7 +62,7 @@ export interface ArrowHeadOptions extends ShadowOptions { borderDash?: Scriptable, borderDashOffset?: Scriptable, borderWidth?: Scriptable, - enabled?: Scriptable, + display?: Scriptable, fill?: Scriptable, length?: Scriptable, width?: Scriptable, @@ -128,7 +128,7 @@ export interface CalloutOptions { borderDashOffset?: Scriptable, borderJoinStyle?: Scriptable, borderWidth?: Scriptable, - enabled?: Scriptable, + display?: Scriptable, margin?: Scriptable, position?: Scriptable, side?: Scriptable,