Author |
Topic  |
|
hamfree
11 Posts |
Posted - 22 Jul 2009 : 12:18:56
|
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
|
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.
|
 |
|
quinncurtis
1164 Posts |
Posted - 22 Jul 2009 : 13:22:28
|
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.
|
 |
|
|
Topic  |
|
|
|