Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 strange peaks with SimpleLinePlot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

hamfree

11 Posts

Posted - 22 Jul 2009 :  12:18:56  Show Profile  Reply with Quote
Hello,

we see some strange effects when showing data using SimpleLinePlots.
You can see that the green line exceeds the yellow line.



Now, when we "zoom in" (change the x-scale, still using the same data), the peaks from the previous image are gone.



We checked, that these peaks simply don't exist in the data, it seems to be some sort of artefact.

Could you help us to avoid these peaks?

Thanks

humfree

quinncurtis

1164 Posts

Posted - 22 Jul 2009 :  13:06:58  Show Profile  Reply with Quote
Certainly our software is not trying to plot data points that aren't there.

It must have something to do with the .Net implemention of polyline drawing for near infinite changes of slope, +1 to -1 in less than one pixel. It looks like some form of anti-alias smoothing, though that should be turned off by default.

Make sure that the ChartView object has its smoothing mode set to None.

chartVu.SmoothingMode = SmoothingMode.None;


You can also try the HighSpeed mode, since that would less likely to light extraneous pixels.

chartVu.SmoothingMode = SmoothingMode.HighSpeed;

If these don't work, can you supply us with the complete source to an example program we can experiment with.


Go to Top of Page

quinncurtis

1164 Posts

Posted - 22 Jul 2009 :  13:22:28  Show Profile  Reply with Quote
It is most likely the interaction between the smoothing mode, and the MiterLimit of the pen used to draw the line. You can read about miter limits in the .Net documentation about the Pen class. We don't set the miter limits, so it reverts to its default value of 10, which is causing the problem for lines with slope changes like yours.

Specify a custom pen for the ChartAttribute, and set the MiterLimit property of that pen to 1.

ChartAttribute attrib2 = new ChartAttribute (Color.Green, 3,DashStyle.Solid);
Pen pen = new Pen(Color.Green);
pen.MiterLimit = 1;
attrib2.SetCurrentPen(pen);

SimpleLinePlot thePlot2 = new SimpleLinePlot(pTransform1, Dataset1, attrib2);

chartVu.AddChartObject(thePlot2);

Let us know the results.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07