问题描述
|
我如何使用.net制作一些折线图,如下图所示?
http://monitor.red-gate.com/
要么
http://bandcamp.com
(http://bandcamp.com/img/schwing.gif)
感谢您的输入。
解决方法
这些小的折线图称为迷你图-这是您需要的关键字。有很多方法,可以在使用jQuery的客户端上进行操作,或者通过System.Drawing在ASP.NET Charting甚至DYI上进行操作。
, 注意事项:图形必须在UI线程上绘制,因此您希望图形有多响应(实时或延迟)?
布置图形(我在纸上进行此操作)以确定X和Y范围,限制等。这将帮助您清楚地了解所需的内容。
放在一起进行测试就没有办法,但这可能会让您朝正确的方向前进。我从来没有创造过类似“火花线”的东西。
Point newPoint;
Point lastPoint;
void SetNewPoint( Point NewPoint );
{
newPoint = NewPoint;
myPicBox.Refresh ( ); // include the Rectangle area to refresh
}
void myPicBox_Paint ( object sender,PaintEventArgs e)
{
// grab Graphics handle
// paint line from lastPoint to newPoint
// you will have to keep a collection of points if redrawing the entire graph
}