mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Made 'type' optional to avoid problems with Chartist defaults
When forced to define the type, Chartist won't default to all of the other options. So if you just want to do something like not show the grid, you'll end up having to define all of the axis options because of the strict typing that was there before.
This commit is contained in:
@@ -242,6 +242,26 @@ new Chartist.Line('.ct-chart', {
|
||||
}
|
||||
});
|
||||
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
series: [
|
||||
[5, 9, 7, 8, 5, 3, 5, 4]
|
||||
]
|
||||
}, {
|
||||
ticks: [0, 4],
|
||||
low: 0,
|
||||
showArea: true,
|
||||
axisX: {
|
||||
showGrid: false
|
||||
},
|
||||
axisY: {
|
||||
showLabel: true,
|
||||
showGrid: false,
|
||||
ticks: [1, 4],
|
||||
type: Chartist.FixedScaleAxis
|
||||
}
|
||||
});
|
||||
|
||||
var chart2 = new Chartist.Line('.ct-chart', {
|
||||
labels: [1, 2, 3, 4, 5],
|
||||
series: [
|
||||
|
||||
Vendored
+3
-3
@@ -305,13 +305,13 @@ declare module Chartist {
|
||||
}
|
||||
|
||||
interface IChartistStepAxis extends ILineChartAxis {
|
||||
type: IStepAxisStatic;
|
||||
type?: IStepAxisStatic;
|
||||
ticks?: Array<string> | Array<number>;
|
||||
stretch?: boolean;
|
||||
}
|
||||
|
||||
interface IChartistFixedScaleAxis extends ILineChartAxis {
|
||||
type: IFixedScaleAxisStatic;
|
||||
type?: IFixedScaleAxisStatic;
|
||||
high?: number;
|
||||
low?: number;
|
||||
divisor?: number;
|
||||
@@ -324,7 +324,7 @@ declare module Chartist {
|
||||
scaleMinSpace?: number;
|
||||
onlyInteger?: boolean;
|
||||
referenceValue?: number;
|
||||
type: IAutoScaleAxisStatic;
|
||||
type?: IAutoScaleAxisStatic;
|
||||
}
|
||||
|
||||
interface ILineChartClasses {
|
||||
|
||||
Reference in New Issue
Block a user