Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Plotting Vectors using Ultrachart
posted

Hi All,

       I'm currently trying to plot a list of vectors on a 2D chart. What I mean by 'vectors', is just a simple lines which start on an specific X-Y coordinate and ends on another one.

 

For this purposes I was trying to use the composite chart, specifically as a scatterChart, where each vector would be a single XYSeries object containing 2 XYDatapoints (start and end)

 

However, this proves somewhat troublesome, as each vector can vary in the following ways:

  - Different lengths (can easily be accomplished by changing the 'ending' XYData point

  - Different line styles (dashed, solid)

  - Different colors

  - Different symbols (each vector has just 1 symbol at the start point, but not the end point)

  - Some vectors have a label next to it

 

I found that the LineAppearance class addresses most of these variants altogether; but I can't seem to find a way to apply a LineAppearance to a single XYseries in an scatterchart, so the workaround I found is to create several ScatterChartAppearance 's with all the format combinations I'll be using, and assigning a series to the scatterchartappearance; but that seems way too excessive.

 

So, my question would be, is there a way to customize the items I described above in a per-XYSeries basis? Or is there a better type of chart / way to approach this issue?

 

Also, what's the difference between scatterChart and scatterLineChart, given that the former has a ConnectWithLines property?

 

Thanks,

   - Nicolas.

Parents
No Data
Reply
  • 23930
    Verified Answer
    Offline posted

    Hi Nicolas,

    Thank you for contacting Infragistics Developer Support.

    What you could do in order to apply these setting on a series basis is to use the FillSceneGraph event. You can define the properties for each series in a custom class and keep it in a Dictionary. Then in the fill scene event get the PointSet primitives. They have a Series property which you can use to get the icon and the icon size for this series from the Dictionary. If you want the symbol to appear only at the first point of the vector you need to create a new PointSet primitive and add only the first point to it. Then set its icon and icon size. After that get the PolyLine primitives and apply to them the DrawStyle for this series. The PolyLines have a null value for the series so you will have to use the Row and Column properties which will return the index of the series.

    I have attached a sample demonstrating this approach.

    Please let me know if you have any additional questions.

    141066.zip
Children
No Data