Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 清楚直线。之后使用需要另外创建
 /// </summary>
 /// <param name="line"></param>
 public void ClearLine(s_Line line)
 {
     //清除线条
     Plot.Children.Remove(line.chart.LineGraph);
     //清除点
     Plot.Children.Remove(line.chart.MarkerGraph);
 }
Ejemplo n.º 3
0
 //添加线条
 private void LineAdd()
 {
     if (曲线条数box.Text == "1")
     {
         g_line1 = scopeShow1.AddLine("line1", System.Windows.Media.Brushes.Red, 0, System.Windows.Media.Brushes.Red, 5);
     }
     else if (曲线条数box.Text == "2")
     {
         g_line1 = scopeShow1.AddLine("line1", System.Windows.Media.Brushes.Red, 0, System.Windows.Media.Brushes.Red, 5);
         g_line2 = scopeShow1.AddLine("line2", System.Windows.Media.Brushes.Green, 0, System.Windows.Media.Brushes.Green, 5);
     }
     else if (曲线条数box.Text == "3")
     {
         g_line1 = scopeShow1.AddLine("line1", System.Windows.Media.Brushes.Red, 0, System.Windows.Media.Brushes.Red, 5);
         g_line2 = scopeShow1.AddLine("line2", System.Windows.Media.Brushes.Green, 0, System.Windows.Media.Brushes.Green, 5);
         g_line3 = scopeShow1.AddLine("line3", System.Windows.Media.Brushes.Blue, 0, System.Windows.Media.Brushes.Blue, 5);
     }
 }
Ejemplo n.º 4
0
        public void PutPoint(s_Line line, Point pnt)
        {
            line.source.AppendAsync(base.Dispatcher, pnt);

            Plot.FitToView();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 放入点与集合,并显示
        /// </summary>
        /// <param name="line"></param>
        /// <param name="pnt"></param>
        public void PutPoints(s_Line line, Point[] pnt)
        {
            line.source.AppendMany(pnt);

            Plot.FitToView();
        }