回复 1楼cf10082007的帖子
根据你贴出的代码,该XMAL代码用C#代码实现如下:
- var obj = new ChartPanelObject()
- {
- Action= ChartPanelAction.LeftMouseButtonDrag,
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Stretch
- };
- var bdr = new Border()
- {
- Background = new SolidColorBrush(Colors.Green) { Opacity = 0.4 },
- BorderBrush = new SolidColorBrush(Colors.Green),
- Width=40,
- BorderThickness = new Thickness(1, 0, 0, 0),
- };
-
- obj.Content = bdr;
- obj.DataPoint = new Point(1, 20d);
- var pnl = new ChartPanel();
-
- pnl.Children.Add(obj);
- this.chart1.View.Layers.Add(pnl);
复制代码
就是给ChartPanelObject的Content设置一个Border,然后添加到ChartPanel去,最后添加到C1Chart.View.Layers. |