在C#中绘制线条类似于图形

时间:2012-05-25 09:11:11

标签: c# windows-phone-7 graph charts

由于图表和图表库有点复杂,我想自己绘制图表。 我做了什么: 那么它必须是一个有两点的线,所以我用这种方式得到了一段代码

                int k = 0;
        while ( k < 200)
        {

            //previous point
            Point l_p1 = new Point();
            l_p1.X = 100;
            l_p1.Y = 250;
            //current point
            Point l_p2 = new Point();
            l_p2.X = 200+k;
            l_p2.Y = 350 ;
            // count 
            Point l_count = new Point();
            l_count.X = k + 75;
            l_count.Y = k + 50;
            Line l_ex = new Line();
            l_ex.Stroke = new SolidColorBrush(Colors.Orange);
            l_ex.StrokeThickness = 5;
            l_ex.X1 = l_p1.X;
            l_ex.X2 = l_p2.X;
            l_ex.Y1 = l_p1.Y;
            l_ex.Y2 = l_p2.Y;
            k += 10;

            l_p2 = l_p1;
            l_count = l_p2;
            this.ContentPanelCanvas.Children.Add(l_ex);

        }

如何使图表看起来像股票市场图?

0 个答案:

没有答案