问题
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