mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
"chartist": added "series" to the ILineChartOptions, see https://gionkunz.github.io/chartist-js/examples.html#example-line-series-override
This commit is contained in:
@@ -53,6 +53,59 @@ new Chartist.Line('.ct-chart', {
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
// This example was taken here: https://gionkunz.github.io/chartist-js/examples.html#example-line-series-override
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: ['1', '2', '3', '4', '5', '6', '7', '8'],
|
||||
// Naming the series with the series object array notation
|
||||
series: [{
|
||||
name: 'series-1',
|
||||
data: [5, 2, -4, 2, 0, -2, 5, -3]
|
||||
}, {
|
||||
name: 'series-2',
|
||||
data: [4, 3, 5, 3, 1, 3, 6, 4]
|
||||
}, {
|
||||
name: 'series-3',
|
||||
data: [2, 4, 3, 1, 4, 5, 3, 2]
|
||||
}]
|
||||
}, {
|
||||
fullWidth: true,
|
||||
// Within the series options you can use the series names
|
||||
// to specify configuration that will only be used for the
|
||||
// specific series.
|
||||
series: {
|
||||
'series-1': {
|
||||
lineSmooth: Chartist.Interpolation.step()
|
||||
},
|
||||
'series-2': {
|
||||
lineSmooth: Chartist.Interpolation.simple(),
|
||||
showArea: true
|
||||
},
|
||||
'series-3': {
|
||||
showPoint: false
|
||||
}
|
||||
}
|
||||
}, [
|
||||
// You can even use responsive configuration overrides to
|
||||
// customize your series configuration even further!
|
||||
['screen and (max-width: 320px)', {
|
||||
series: {
|
||||
'series-1': {
|
||||
lineSmooth: Chartist.Interpolation.none()
|
||||
},
|
||||
'series-2': {
|
||||
lineSmooth: Chartist.Interpolation.none(),
|
||||
showArea: false
|
||||
},
|
||||
'series-3': {
|
||||
lineSmooth: Chartist.Interpolation.none(),
|
||||
showPoint: true
|
||||
}
|
||||
}
|
||||
}]
|
||||
]);
|
||||
|
||||
|
||||
var data = {
|
||||
series: [5, 3, 4]
|
||||
};
|
||||
|
||||
9
types/chartist/index.d.ts
vendored
9
types/chartist/index.d.ts
vendored
@@ -333,6 +333,15 @@ declare namespace Chartist {
|
||||
chartPadding?: IChartPadding;
|
||||
fullWidth?: boolean;
|
||||
classNames?: ILineChartClasses;
|
||||
series?: {
|
||||
[key: string]: {
|
||||
lineSmooth?: Function | boolean;
|
||||
showLine?: boolean;
|
||||
showPoint?: boolean;
|
||||
showArea?: boolean;
|
||||
areaBase?: number;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ILineChartAxis {
|
||||
|
||||
Reference in New Issue
Block a user