| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
-| `showLines` | `boolean` | `true` | If false, the lines between points are not drawn.
+| `showLine` | `boolean` | `true` | If false, the lines between points are not drawn.
| `spanGaps` | `boolean`\|`number` | `false` | If true, lines will be drawn between points with no or null data. If false, points with `NaN` data will create a break in the line. Can also be a number specifying the maximum gap length to span. The unit of the value depends on the scale used.
## Default Options
}]
},
options: {
- showLines: false // disable for all datasets
+ showLine: false // disable for all datasets
}
});
```
* `scales.[x/y]Axes.zeroLine*` options of axes were removed. Use scriptable scale options instead.
* The dataset option `steppedLine` was removed. Use `stepped`
* The dataset option `tension` was removed. Use `lineTension`
+* The chart option `showLines` was renamed to `showLine` to match the dataset option.
* Dataset options are now configured as `options[type].datasets` rather than `options.datasets[type]`
* To override the platform class used in a chart instance, pass `platform: PlatformClass` in the config object. Note that the class should be passed, not an instance of the class.
* `aspectRatio` defaults to 1 for doughnut, pie, polarArea, and radar charts
const options = me.chart.options;
const lineOptions = options.elements.line;
const values = super.resolveDatasetElementOptions(active);
- const showLine = valueOrDefault(config.showLine, options.showLines);
+ const showLine = valueOrDefault(config.showLine, options.showLine);
// The default behavior of lines is to break at null values, according
// to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158
rotation: 'pointRotation'
},
- showLines: true,
+ showLine: true,
spanGaps: false,
interaction: {
const config = me._config;
const options = me.chart.options;
const values = super.resolveDatasetElementOptions(active);
- const showLine = valueOrDefault(config.showLine, options.showLines);
+ const showLine = valueOrDefault(config.showLine, options.showLine);
values.spanGaps = valueOrDefault(config.spanGaps, options.spanGaps);
values.tension = valueOrDefault(config.lineTension, options.elements.line.tension);
this.onHover = null;
this.onClick = null;
this.responsive = true;
- this.showLines = true;
+ this.showLine = true;
this.plugins = {};
this.scale = undefined;
this.doughnut = undefined;
options: {
legend: false,
title: false,
- showLines: true,
+ showLine: true,
scales: {
x: {
display: false
options: {
legend: false,
title: false,
- showLines: false,
+ showLine: false,
scales: {
x: {
display: false
options: {
legend: false,
title: false,
- showLines: false,
+ showLine: false,
elements: {
line: {
borderColor: '#ff0000',
module.exports = {
- description: 'showLines option should draw a line if true',
+ description: 'showLine option should draw a line if true',
config: {
type: 'scatter',
data: {
module.exports = {
- description: 'showLines option should not draw a line if undefined',
+ description: 'showLine option should not draw a line if undefined',
config: {
type: 'scatter',
data: {
},
options: {
animation: false,
- showLines: true
+ showLine: true
}
});
labels: ['label1', 'label2', 'label3', 'label4']
},
options: {
- showLines: true
+ showLine: true
}
});
labels: ['label1', 'label2', 'label3', 'label4']
},
options: {
- showLines: true,
+ showLine: true,
legend: false,
title: false,
elements: {
labels: ['label1', 'label2', 'label3', 'label4']
},
options: {
- showLines: true,
+ showLine: true,
legend: false,
title: false,
elements: {
labels: ['label1', 'label2', 'label3', 'label4']
},
options: {
- showLines: true,
+ showLine: true,
legend: false,
title: false,
startAngle: 90, // default is 0
labels: ['label1', 'label2', 'label3', 'label4']
},
options: {
- showLines: true,
+ showLine: true,
elements: {
arc: {
backgroundColor: 'rgb(255, 0, 0)',
labels: ['label1', 'label2', 'label3', 'label4']
},
options: {
- showLines: true,
+ showLine: true,
legend: false,
title: false,
elements: {
var options = chart.options;
expect(options.font.size).toBe(defaults.font.size);
- expect(options.showLines).toBe(defaults.line.showLines);
+ expect(options.showLine).toBe(defaults.line.showLine);
expect(options.spanGaps).toBe(true);
expect(options.hover.onHover).toBe(callback);
expect(options.hover.mode).toBe('test');
var options = chart.options;
expect(options.font.size).toBe(defaults.font.size);
- expect(options.showLines).toBe(defaults.line.showLines);
+ expect(options.showLine).toBe(defaults.line.showLine);
expect(options.spanGaps).toBe(true);
expect(options.hover.onHover).toBe(callback);
expect(options.hover.mode).toBe('test');
});
var options = chart.options;
- expect(options.showLines).toBe(defaults.showLines);
+ expect(options.showLine).toBe(defaults.showLine);
expect(options.spanGaps).toBe(false);
expect(options.hover.mode).toBe('dataset');
expect(options.title.position).toBe('bottom');
* If false, the lines between points are not drawn.
* @default true
*/
- showLines: boolean;
+ showLine: boolean;
}
export interface LineController extends DatasetController {}
extends IControllerDatasetOptions,
ScriptableAndArrayOptions<IArcOptions>,
ScriptableAndArrayOptions<IArcHoverOptions> {
-
+
/**
* Sweep to allow arcs to cover.
* @default 2 * Math.PI