ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Points on LineLayer
Posted by Davide on Jul-02-2019 21:04
Attachments:
Hi,

I'm having problems with a LineLayer Chart that I'm using. I have an XYChart that contains a variable number of LineLayer but I see something very strange on the Line, if you look at the pics you can easily understand what i'm trying to tell you.

The piece of code that adds the LineLayer to the chart is the following:
@
LineLayer *layer = c->addLineLayer();
                layer->setFastLineMode();
                layer->setLineWidth(WIDTH_LINE_CM);
                layer->setXData(viewPortTimeStamps);
                layer->addDataSet(DoubleArray(pAccDecStruct.at(nSt)->lacc.data() + start, noOfPoints), color);
@
The second pic is a zoom of the first one, and I still can see that point/small vertical line on the LineLayer.
I really don't know what it is, if you look carefully at the second pic it looks like that the point is drawn when the lines change inclination and usually on the blue and on the green lines.

Is there some setting that I'm missing?
I hope you understand what I mean, it's a little difficult to explain.

Thanks in advance.
Cattura2.PNG
Cattura3.PNG

  Re: Points on LineLayer
Posted by Peter Kwan on Jul-02-2019 22:09
Attachments:
Hi Davide,

Is the entire cyan line obtained from one line layer with one data set, or is it actually lines joined together, that is, the ending point of one line is the same as the starting point of the next line?

Note that multiple lines joined together (with ending point of one line the same as the the starting point of the next line) are not the same as one single line containing all the points. I have attached an image to show one of the differences. For get a consistent line, some special processing is required, particular around the line joints. If the two lines are drawn as separated entities, there is no line joint processing between the two lines, so it looks different and can lead to various artifacts.

If the above is the cause of the problem, to solve the problem, please make sure the sequence of points of the same line width and color is in one single layer and data set. You should only need to add new layers when the line width or color changes.

Hope this can help.

Regards
Peter Kwan
linejoint.png

  Re: Points on LineLayer
Posted by Davide on Jul-02-2019 22:48
Attachments:
Hi Peter,

Thank you a lot for your reaply.
At the moment I'm using two different color for each line to change the color, as you can see on the image. I was using the wrong method using more than one LineLayer, I tried your method but unfortunately it seems not to work right, the result is the same. Moreover it looks like the point/vertical lines are not when the color change.

Have you got any other suggestions on what to do?

Thanks a lot,
Davide
Cattura4.PNG

  Re: Points on LineLayer
Posted by Peter Kwan on Jul-03-2019 02:19
Hi Davide,

Is it possible to provide a hard coded example that can illustrate the problem? May be you can try to modify the sample code that comes with ChartDirector until you can reproduce the problem and then attach the resulting code with your post. This can help to identify the cause of the problem.

If you cannot reproduce the problem by using the sample code, may be you can try to create the simplest possible chart with your code (such as a chart with just one short line), and then save the chart in SVG, and attach the SVG with your post. By examining the SVG, I may be able to determine roughly how to chart is configured. You can save in SVG by using:

c->makeChart("\path\to\your\directory\test.svg");

Regards
Peter Kwan