I have a scatter chart in which I need to set the size of the icon of one particular point to a larger size. What is the best way to go about this? I will need to determine which point to make larger dynamically based on x & y value.
Hi,
You could achieve the desired behavior when add a new larger icon element over the desired point one using the FillSceneGraph event as follows:
private void Form1_Load(object sender, EventArgs e){ ultraChart1.FillSceneGraph += new Infragistics.UltraChart.Shared.Events.FillSceneGraphEventHandler(ultraChart1_FillSceneGraph);}void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e){ Symbol symbol = null; foreach (Primitive primitive in e.SceneGraph) { PointSet pointSet = primitive as PointSet; if (pointSet == null) { continue; } //get the desired point you want with different icon -> you could determine it based on x & y values DataPoint dataPoint = pointSet.points[0]; //add a new icon with the desired settings over the point's default icon symbol = new Symbol(dataPoint.point, pointSet.icon, SymbolIconSize.Large); } if (symbol != null) { e.SceneGraph.Add(symbol); }}
I implemented this solution last week (thank you for confirming that the method I came up with was the best way), but the added symbol moves off of the line when printing the chart. Why is that? What would you recommend to fix this issue?
I have try to reproduce the issue calling ultraChart1.PrintChart(); but with no luck. Do you have some custom settings changing the resolution or the dpi when printing? If so, please, give them to us so we could reproduce the problem locally and advise you further.
Thank you Petia. All I'm doing differently is using the print preview:
// GET PRINT DOCUMENT FROM CHART
this.Chart.PrintDocument;
// SHOW PRINT PREVIEW DIALOG
I also tried your exact code to generate the larger icon AND printing the chart with chart.PrintChart() and I still have the same issue with the new larger symbol printing in the wrong location.
I have determined that this issue only occurs when there is a VerticalLeftFacing or VerticalRightFacing annotation on the chart when you print. Horizontal annotations do not have this negative side effect. This may be related to a trouble ticket that I have open with printing VerticalLeftFacing or VerticalRightFacing annotations - the annotation text and border are printed separately from each other and both the text and the border are printed in the wrong place. The icon printing issue and vertical annotation printing issue can both be seen in print preview (so you don't have to actually print and waste paper).
Should I create a trouble ticket for this icon issue as well?
I'm tryging to reproduce it setting VerticalLeftFacing to the X and Y axis labels but still got no luck - every chart element stays on its place when printing it. Please, attach a sample project through the Option tabs while posting.
I have added the problem as a bug in our system under the number of 28331 so you could follow its status.
I hope it will be fixed for the next release of the control.
Sample attached.
The issue is with vertical annotations, not axis labels. If you meant annotations, I'd be very interested to find out why printing vertical annotations worked correctly for you especially since Infragistics was able to reproduce that issue from a separate trouble ticket.