add d3 calendar grid

This commit is contained in:
Eric Hulburd
2016-02-12 15:51:06 -06:00
parent 715feda051
commit b13c33d83c
10 changed files with 184 additions and 6 deletions

View File

@@ -38,6 +38,12 @@ class LineChart {
line_chart.init();
}
get chart_options(){
return {
interpolation: 'basis'
};
}
init(){
var line_chart = this;
@@ -49,7 +55,7 @@ class LineChart {
// function that draws the lines.
line_chart.line = d3.svg.line()
.interpolate("basis")
.interpolate(line_chart.chart_options.interpolation)
.x(function(d){ return x(d[line_chart.domain_attr]); })
.y(function(d){ return y(d[line_chart.range_attr]); });

View File

@@ -1,6 +1,13 @@
import LineChart from './line';
const INTEPOLATION = 'cardinal';
class SplineChart extends LineChart {
get chart_options(){
return {
interpolation: INTEPOLATION
}
}
}