ASP.NET 与 MS Chart 禁用垂直线
我有一个使用 MS Chart 创建的图表,如下图所示。正如您所看到的,垂直线与每个条形顶部的值混淆了。
替代文字 http://img46.imageshack.us/img46/3720/chartimgaxd.png
这是标记- 图表:
<asp:Chart ID="chtNBAChampionships" runat="server">
<Series>
<asp:Series Name="Championships" YValueType="Int32" 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" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="MainChartArea">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
我不希望显示垂直线,因为它与每个条形顶部的值搞乱了。如何禁用垂直线?
谢谢。
I have a graph created with MS Chart like the following picture. As you can see the vertical lines are messed up with value of the top of each bar.
alt text http://img46.imageshack.us/img46/3720/chartimgaxd.png
Here's the mark-up for the graph:
<asp:Chart ID="chtNBAChampionships" runat="server">
<Series>
<asp:Series Name="Championships" YValueType="Int32" 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" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="MainChartArea">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
I don't want the display the vertical line because it's messed up with the value on top of the each bar. How can I disable the vertical line?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
简单的方法:
simple way:
我不知道具体的 ASP 语法,但这里有 VB.NET 代码,可以实现这一点:
C# 版本(如果需要):
如您所见,您不能只关闭网格线,您必须将其宽度设置为0. MinorGrid可以用同样的方式隐藏。
I don't know the specific ASP syntax, but here is the VB.NET code that does the trick:
C# version if needed :
As you can see, you can't just turn off the gridline, you have to set it's width to 0. The MinorGrid can be hidden the same way.
最简单的方法,将以下代码放入图表加载事件中。
Simplest way, put the following code in chart load event.
这解决了这个问题。谢谢。
下面是c#代码......
This resolved the issue. Thanks.
Below is the c# code....
这可以从源头开始工作
This could work from source