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;
}
}
待研究
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;
}
}
相关文章推荐
- 遍历获取ASP.NET页面控件的名称及值 后台调用前台javascript方法报错:“缺少对象”的解决方法 xml与DataSet的互转换类
- [置顶] MFC树形控件CTreeCtrl使用方法、遍历、SetCheck无效、根据名称获取节点、获取选中节点等问题
- C#中通过反射方法获取控件类型和名称
- js 获取函数的所有参数和遍历JavaScript某个对象所有的属性名称和值的方法
- document.getElementById获取控件对象为空的解决方法
- document.getElementById获取控件对象为空的解决方法
- document.getElementById获取控件对象为空的解决方法
- silverlight visifire控件图表制作——silverlight 后台方法ControlChart.xaml.cs
- Java中Thread类currentThread获取多线程对象和为线程设置名称的方法
- JavaScript函数之实际参数对象(arguments) / callee属性 / caller属性 / 递归调用 / 获取函数名称的方法
- jQuery获取当前对象标签名称的方法
- jQuery获取当前对象标签名称的方法
- js 获取函数的所有参数和遍历JavaScript某个对象所有的属性名称和值的方法
- js 获取函数的所有参数和遍历JavaScript某个对象所有的属性名称和值的方法
- 利用控件名称获取控件对象
- C# 通过属性名称获取(读取)Json对象属性值的方法
- C#实现获取不同对象中名称相同属性的方法
- highcharts 获取图表对象的几种方法
- jquery 根据样式或者名称获取 对象遍历赋值
- javascript 获取父页面中元素对象方法