1
var composite = dc.compositeChart("#test_composed");
var LineChart1 = dc.lineChart(composite)
.dimension(yearDim)
.colors('yellow')
.group(spendPerYear, "Top Line")
.dashStyle([2,2])
var LineChart2 = dc.lineChart(composite)
.dimension(yearDim)
.colors('blue')
.group(incomePerYear, "Bottom Line")
.dashStyle([5,5])
var abc = [LineChart1, LineChart2];
composite
.x(d3.scale.linear().domain([2011,2013]))
.yAxisLabel("The Y Axis")
.legend(dc.legend().x(80).y(20).itemHeight(13).gap(5))
.renderHorizontalGridLines(true)
.elasticY(true)
.compose([
//abc
LineChart1, LineChart2
])
dc.renderAll();
このコードは機能します。しかし.compose
でどうすればabc
配列を含めることができるので、私はabc
の配列.compose
でさらにチャートをプッシュすると自動的に更新されます。私は各グラフを手動で配置する必要はありません。DC複合チャートに動的チャートを含める
基本的に私はあなたがmulti-dimensional
配列として.compose
を呼んでいるこの
var abc = [LineChart1, LineChart2, LineChart3, LineChart4 ....];
composite
.x(d3.scale.linear().domain([2011,2013]))
.yAxisLabel("The Y Axis")
.legend(dc.legend().x(80).y(20).itemHeight(13).gap(5))
.renderHorizontalGridLines(true)
.elasticY(true)
.compose([
abc
])
こんにちは、グラフ作成用ライブラリに関する質問は、dc.jsタグを使用してください。 – Gordon