由于图表和图表库有点复杂,我想自己绘制图表。 我做了什么: 那么它必须是一个有两点的线,所以我用这种方式得到了一段代码
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);
}
如何使图表看起来像股票市场图?