带有MS Chart的ASP.NET禁用垂直线
发布时间:2020-12-16 04:20:19 所属栏目:asp.Net 来源:网络整理
导读:我有一个用MS Chart创建的图表,如下图所示.正如您所看到的,垂直线条与每个条形顶部的值混淆. alt text http://img46.imageshack.us/img46/3720/chartimgaxd.png 这是图表的加价: asp:Chart ID="chtNBAChampionships" runat="server" Series asp:Series Name
我有一个用MS Chart创建的图表,如下图所示.正如您所看到的,垂直线条与每个条形顶部的值混淆.
alt text 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> 我不希望显示垂直线,因为它与每个条顶部的值搞混了.如何禁用垂直线? 谢谢. 解决方法
我不知道具体的ASP语法,但这里是VB.NET代码,它可以解决这个问题:
Dim gd As New System.Windows.Forms.DataVisualization.Charting.Grid gd.LineWidth = 0 myChart.ChartAreas("MainChartArea").AxisX.MajorGrid = gd C#版本如果需要: System.Web.UI.DataVisualization.Charting.Grid gd = new System.Web.UI.DataVisualization.Charting.Grid(); gd.LineWidth = 0; myChart.ChartAreas[0].AxisX.MajorGrid = gd; 如您所见,您不能只关闭网格线,您必须将其宽度设置为0. MinorGrid可以以相同的方式隐藏. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 如何将数据绑定表达式的值存储到变量中
- ASP.NET MVC基于标注特性的Model验证:一个Model,多种验证
- asp.net – 调整白色图像后获得灰色边框
- ASP.NET MVC错误处理 – 删除aspxerrorpath
- asp.net-mvc – 是否可以为模型中的字段指定标签?
- asp.net-mvc – 在ASP.Net中路由保留字
- 具有Entity Framework Code Only和ASP.NET MVC的模块化应用
- asp.net – MVC应用程序构建速度极慢
- 当我使用ASP.NET传输文件时,为什么IIS7会忽略我的内容类型标
- asp.net-mvc – 对每个动作调用使用MVC Miniprofiler