MS图表与ASP.NET图表类型"柱"不显示x轴的标签,如果有图表中超过9条 [英] MS Chart with ASP.NET chart type "column" not showing axis x label if there are more than 9 bar in the chart
本文介绍了MS图表与ASP.NET图表类型"柱"不显示x轴的标签,如果有图表中超过9条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有与MS图表图表类型列一个问题。如果有超过9条在图表中,轴-X标签将无法正确显示,其中一些只是消失。
I have a problem with an MS Chart chart type column. If there are more than 9 bars in the chart, the axis-x labels won't show up properly, some of them just disappear.
下面是我的加价图表:
<asp:Chart ID="chtNBAChampionships" runat="server">
<Series>
<asp:Series Name="Championships" YValueType="Int32" Palette="Berry" ChartType="Column" ChartArea="MainChartArea" IsValueShownAsLabel="true">
<Points>
<asp:DataPoint AxisLabel="Celtics" YValues="17" />
<asp:DataPoint AxisLabel="Lakers" YValues="15" />
<asp:DataPoint AxisLabel="Bulls" YValues="6" />
<asp:DataPoint AxisLabel="Spurs" YValues="4" />
<asp:DataPoint AxisLabel="76ers" YValues="3" />
<asp:DataPoint AxisLabel="Pistons" YValues="3" />
<asp:DataPoint AxisLabel="Warriors" YValues="3" />
<asp:DataPoint AxisLabel="Mara" YValues="4" />
<asp:DataPoint AxisLabel="Saza" YValues="9" />
<asp:DataPoint AxisLabel="Buha" YValues="6" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="MainChartArea">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
由于只有9条它的工作原理,但我不知道为什么它不能超过9条。有没有什么办法,使图表可以正常工作?另外,如果可能的话,如何让每一个酒吧都有不同的颜色?
With only 9 bars it works, but I don't know why it fails with more than 9 bars. Is there any way to make the chart work properly? Also, if possible, how to make each bar have different color?
推荐答案
我有同样的问题,但我使用在页面加载C#。
I had the same problem, but i'm using c# on page load.
我解决它通过添加此
Chart2.ChartAreas["ChartArea1"].AxisX.Interval = 1;
这篇关于MS图表与ASP.NET图表类型&QUOT;柱&QUOT;不显示x轴的标签,如果有图表中超过9条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文