Beispiel #1
0
        /// <summary>
        /// 创建直线源
        /// </summary>
        /// <param name="name"></param>线条标示
        /// <param name="lineColor"></param>线条颜色 eg: Brushs.red
        /// <param name="lineWidth"></param>线条宽度
        /// <param name="pointColor"></param>关键点颜色
        /// <param name="pointSize"></param>关键点大小
        /// <returns></returns>
        public s_Line AddLine(string name, SolidColorBrush lineColor, uint lineWidth, SolidColorBrush pointColor, uint pointSize)
        {
            s_Line line = new s_Line();

            ObservableDataSource <Point> dataSource = new ObservableDataSource <Point>();

            LineAndMarker <ElementMarkerPointsGraph> chart = new LineAndMarker <ElementMarkerPointsGraph>();


            chart = Plot.AddLineGraph(dataSource,
                                      new Pen(lineColor, lineWidth),
                                      new CircleElementPointMarker
            {
                Size  = pointSize,
                Brush = pointColor,
                Fill  = pointColor
            },
                                      new PenDescription(name));


            line.chart  = chart;
            line.source = dataSource;

            return(line);
        }