MSCharts:如何在代码隐藏中连续更改边框颜色
如何在代码隐藏(C#)中将自定义颜色设置为 ASP.NET 3.5 图表控件系列的边框颜色?我需要以下代码隐藏实现(位于 ASPX 中)
<ChartAreas>
<asp:ChartArea Name="ChartArea1" AlignmentOrientation="All">
<AxisX>
<MajorGrid LineColor="#EEEEEE" />
<MinorGrid LineColor="#EEEEEE" />
</AxisX>
<AxisY>
<MajorGrid LineColor="#EEEEEE" />
<MinorGrid LineColor="#EEEEEE" />
</AxisY>
</asp:ChartArea>
</ChartAreas>
我想将代码隐藏中的 MajorGrid 线条颜色更改为 RGB(125,135,111)
How can i set a custom color as border color for the ASP.NET 3.5 chart control series in code behind(C#) ? I need a codebehind implementation of the following (which is in ASPX)
<ChartAreas>
<asp:ChartArea Name="ChartArea1" AlignmentOrientation="All">
<AxisX>
<MajorGrid LineColor="#EEEEEE" />
<MinorGrid LineColor="#EEEEEE" />
</AxisX>
<AxisY>
<MajorGrid LineColor="#EEEEEE" />
<MinorGrid LineColor="#EEEEEE" />
</AxisY>
</asp:ChartArea>
</ChartAreas>
I want to change the MajorGrid line color in my codebehind as RGB(125,135,111)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保为图表提供 ID 并 runat="server"...
然后您可以直接访问 LineColor 属性:
或使用自定义颜色(来自十六进制字符串):
Make sure you give your Charts an ID and runat="server"...
Then you can directly access the LineColor properties:
Or using a custom colour (from a Hex string):