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;
}
}