我的dojo stackcolumn似乎有问题,因为某些条形的比例对于某些x轴点是正确的,而不是其他的。这是我的代码(观察北爱尔兰水电应该是70,但只显示在30左右):
dojo.addOnLoad(function() {
var chart1 = new dojox.charting.Chart2D("sitesbycountry");
chart1.addPlot("default", {type: "StackedColumns", gap: 10});
chart1.addPlot("horzgrid", {type: "Grid", hMajorLines: true, vMajorLines: false});
chart1.addAxis("x", {labels: [{value: 1, text: 'Northern Ireland'}, {value: 2, text: 'Wales'}, {value: 3, text: 'Scotland'}, {value: 4, text: 'England'}], minorTicks: false, microTicks: false});
chart1.addAxis("y", {vertical: true, minorTicks: false, microTicks: false});
chart1.addSeries("Hydro", [70, 53, 198, 102], {fill: "#ddddff"});
chart1.addSeries("Wind and Wave", [67, 51, 150, 245], {fill: "#FEFFBF"});
chart1.addSeries("Landfill", [1, 23, 40, 0], {fill: "#CFFFD1"});
chart1.addSeries("Other Biofuels and Wastes", [4, 3, 11, 66], {fill: "#DFD2C3"});
chart1.render();
});
这是图表中我不知道的行为吗?
TIA
FokeyJoe
答案 0 :(得分:1)
抱歉..没有发现y轴没有从0开始。确切地说是:
chart1.addAxis("y", {min:0, vertical: true, minorTicks: false, microTicks: false});