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:
Matt Gibbs
2016-01-19 15:32:11 -05:00
parent 7edc447a5f
commit f9b189a873
2 changed files with 23 additions and 3 deletions
+20
View File
@@ -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: [
+3 -3
View File
@@ -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 {