由于图形和图表库有点复杂,我想自己画图表。我所做的:嗯,它必须是一条有两个点的线,所以我有这样一段代码
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);
}
如何使图表看起来像股市图表?