Make chart cell size dynamic

This commit is contained in:
Dennis Eichhorn 2017-01-08 12:10:04 +01:00
parent d7f317c815
commit 234ab60a26

View File

@ -11,7 +11,6 @@
this.chart.color = d3.scale.quantize()
.domain([-.05, .05])
.range(d3.range(11).map(function(d) { return "q" + d + "-11"; }));
this.chart.cellSize = 17;
this.chart.subtype = 'calendar';
};
@ -38,6 +37,8 @@
height: box.height
};
this.chart.cellSize = Math.min(this.chart.dimension.width / (12*5), this.chart.dimension.height / (8));
document.getElementById(this.chart.chartId).style.height = (this.chart.dimension.height * this.chart.dataset.length) + 'px';
svg = this.chart.chartSelect.selectAll('svg').data(this.chart.dataset).enter().append("svg")