我想在ASP.Net Ajax RadChart控件的线图上显示X轴的交替背景颜色。
我已经找到了这篇文章,它显示了Silverlight和WPF图表控件的StripLine属性,但是我在Ajax控件上找不到这个属性。也许我只是没有看到它-我如何设置背景颜色垂直条纹与X轴列?
在提到的文章中,"AlternateStripLineStyle“位于:RadChart1.DefaultView.ChartArea.AxisY.AxisStyles.AlternateStripLineStyle
但是,Ajax控件没有AxisStyles属性。
谢谢。
更新:--我认为使用PlotArea的MarkedZones属性是可能的,但如果确实有效的话,这不是一个非常优雅的解决方案。
发布于 2012-07-16 09:01:01
Telerik自己使用提供下列解决方案,正如我所怀疑的,它使用MarkedZones:
public void GenerateStripLines(RadChart chart, int minValue, int maxValue, int step)
{
for (int i = minValue; i <= maxValue + step; i+=step)
{
Color zoneColor;
if (i % 2 == 0)
zoneColor = Color.White;
else
zoneColor = Color.WhiteSmoke;
var item = new ChartMarkedZone() { ValueStartY = i, ValueEndY = i + step };
item.Appearance.FillStyle.MainColor = zoneColor;
chart.PlotArea.MarkedZones.Add(item);
}
}https://stackoverflow.com/questions/11435334
复制相似问题