Display of Stacked Column Chart (amcharts library)

泄露秘密 提交于 2020-01-07 05:09:11

问题


Problem is that columns appear to be located one behind the other, instead of one on top of the other

Please have a look at http://jsfiddle.net/LLWft/2/

var chart1=new AmCharts.AmSerialChart();
chart1.theme="light";
chart1.colors=["#00a0db", "#428bca"];
var legend = new AmCharts.AmLegend();
legend.horizontalGap=10;
legend.maxColumns=1;
legend.position="right";
legend.useGraphSettings=true;
  legend.markerSize=10;
   chart1.addLegend(legend);
   chart1.dataProvider=chartData;
   chart1.valueAxes.stackType="regular";
   chart1.valueAxes.axisAlpha=0.3;
   chart1.valueAxes.gridAlpha=0.3;
   chart1.graphs=chartGraphs;
   chart1.categoryField="year";
   chart1.categoryAxis.gridPosition="start";
   chart1.categoryAxis.axisAlpha=0;
   chart1.categoryAxis.gridAlpha=0;
   chart1.categoryAxis.position = "left";
   chart1.write('chartdiv');

回答1:


finally i figured out the problem

i have set valueAxis by array and it solved my issue

Please have a look at http://jsfiddle.net/LLWft/3/

chart1.valueAxes=[{
        "stackType": "regular",
        "axisAlpha": 0.3,
        "gridAlpha": 0.3
    }];


来源:https://stackoverflow.com/questions/27035747/display-of-stacked-column-chart-amcharts-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!