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.
Thanks again; this will do for now.
Hello,
What you could do is to set Horizontal and Vertical alignment of ChartTextApperance. So you could use following code in my sample
ultraChart1.ScatterChart.ChartText.Add(new ChartTextAppearance() { ChartTextFont = new System.Drawing.Font("Arial", 7F),
ClipText = false,
Column = -2,
Row = -2,
ItemFormatString = "<ITEM_LABEL>",
HorizontalAlign = StringAlignment.Far,// set horizontal alignment
VerticalAlign = StringAlignment.Far,//set vertical alignment
FontColor = Color.Black,
Visible = true });
I hope that this will helps you.
Thanks!, it was just what I was looking for.
However, I wanted to ask you another question: to clean up the chart, is there a way to offset the labels that gets printed right on top of the start / end node, so as to make it more readable?
Thanks again,
I am just checking about the progress of this issue. Let me know If you need our further assistance on this matter ?
Thank you for using Infragistics Components.
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.