开发者

Incorrect rendering in dojox charting stacked column?

开发者 https://www.devze.com 2022-12-23 13:31 出处:网络
I seem to be having a problem with my dojo stackedcolumn whereby the scale of some of the bar开发者_如何学Gos is correct for some x-axis points, but not others. Here\'s my code (observe the northern i

I seem to be having a problem with my dojo stackedcolumn whereby the scale of some of the bar开发者_如何学Gos is correct for some x-axis points, but not others. Here's my code (observe the northern ireland hydro should be 70, but only shows as around 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();
}); 

Is this a behaviour of the chart that I'm not aware of?

TIA

FokeyJoe


Sorry.. hadn't spotted that the y-axis wasn't starting from 0. Fix exactly is:

chart1.addAxis("y", {min:0, vertical: true, minorTicks: false, microTicks: false});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号