您的位置:首页 > 其它

RadCartesianChart图表控件对象名称的获取方法

2013-08-26 14:49 309 查看
http://demos.telerik.com/silverlight/#ChartView/Gallery/Linear

待研究

public static readonly DependencyProperty SeriesTypeProperty = DependencyProperty.RegisterAttached("SeriesType",

typeof(string), typeof(ChartSeriesTypeSwitch), new PropertyMetadata(OnSeriesTypeChanged));

public static string GetSeriesType(DependencyObject obj)

{

return (string)obj.GetValue(SeriesTypeProperty);

}

public static void SetSeriesType(DependencyObject obj, string value)

{

obj.SetValue(SeriesTypeProperty, value);

}

private static void OnSeriesTypeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)

{

RadCartesianChart chart = sender as RadCartesianChart;

if (chart == null)

return;

string seriesType = e.NewValue as string;

chart.Series.Clear();

foreach (CartesianSeries series in GetSeries(chart, seriesType))

{

chart.Series.Add(series);

}

CategoricalAxis categoricalAxis = chart.HorizontalAxis as CategoricalAxis;

if (categoricalAxis != null)

{

AxisPlotMode plotMode = AxisPlotMode.BetweenTicks;

if (seriesType == "Area" || seriesType == "Spline Area")

{

plotMode = AxisPlotMode.OnTicks;

}

categoricalAxis.PlotMode = plotMode;

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐