我有这样的数据,
income correlation bath_math_count bath_read_count
High Negative 3 2
High Not significant 7 12
High Positive 17 13
Medium Negative 0 0
Medium Not significant 2 3
Medium Positive 9 8
Low Negative 0 1
Low Not significant 6 8
Low Positive 19 16
我的酒窝代码读取,
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("generated_data/test.tsv", function (data) {
var myChart = new dimple.chart(svg, data);
myChart.setBounds(60, 30, 510, 330);
myChart.addCategoryAxis("x", ["correlation", "income"]);
myChart.addMeasureAxis("y", "bath_read_count");
var s = myChart.addSeries("income", dimple.plot.bar);
// s.addOrderRule(["Low", "Medium", "High"]);
myChart.addLegend(65, 10, 510, 20, "right");