Commit 755555f6 authored by David Anderson's avatar David Anderson
Browse files

area chart now detects if fill axis or axis origin are needed but not set

parent b367d577
......@@ -84,6 +84,14 @@ export class AreaChartImplementation extends BaseChartImplementation {
const ctx = me.canvas.context;
let startingIndex = me.drawnData.length;
const list = me.chart.datalist();
if ( me.chart.shouldFillToOrigin ) {
if ( !me.chart.fillAxis ) {
throw 'GistCharts: AreaChart Usage Error. If shouldFillToOrigin is true than fillAxis must also be defined';
}
if ( !me.chart.axisOrigin ) {
throw 'GistCharts: AreaChart Usage Error. If shouldFillToOrigin is true than axisOrigin must also be defined';
}
}
while ( me.drawnData.length < list.length && me.drawnData.length - startingIndex < me.chart.drawCountPerRender ) {
let line = me.processLine( list[ me.drawnData.length ] );
ctx.beginPath();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment