我使用了.NET Fastline系列的teecharts,然后我画了一些简单的图(用于测试)
for (t = 0; t < maxPoints; ++t)
{
realtimeLine.Add(t, Math.Sin(t * 2 * Math.PI / 10 / 20));
}但是,点的数量( maxPoints )很大( 12000 ),绘图看起来不太好,上面有楼梯之类的东西(楼梯属性变成了false)。
我也试着使用Line,使用Smoothed = true,但在这种情况下,绝对没有发生任何事情,绘图还没有被绘制,如果Smoothed =false,绘图绘制,但处理器负载增加,相对较快,这对我来说不是很好,我认为,平滑也需要一些资源。
我应该怎么做才能得到一个流畅的快速线条呢?我可以把我的项目发给你,如果你愿意,我该怎么做?
发布于 2013-07-23 23:11:31
在您的情况下,我认为使用平滑函数并将其应用于您的Fastline将非常有用,如下面的示例代码所示:
public Form1()
{
InitializeComponent();
InitializeChart();
}
const int maxPoints = 500;
Steema.TeeChart.Styles.FastLine fast;
Steema.TeeChart.Styles.FastLine fast1;
Steema.TeeChart.Functions.Smoothing smoothing;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
fast = new FastLine(tChart1.Chart);
fast1 = new FastLine(tChart1.Chart);
smoothing = new Steema.TeeChart.Functions.Smoothing();
for (int t = 0; t < maxPoints; ++t)
{
fast.Add(t, Math.Sin(t * 2 * Math.PI / 10 / 20));
}
fast1.DataSource = fast;
fast1.Function = smoothing;
smoothing.Period = 4;
fast.Active = false;
checkBox1.Checked = true;
}你能告诉我们之前的代码是否能帮助你达到你想要的效果吗?
我希望威尔能帮上忙。
谢谢,
https://stackoverflow.com/questions/17803697
复制相似问题