i want to highlight the lowest and the highest datapoint with green and red bubble as shown below.
i have a composite webchart. i am trying to add 2 bubble series with a different chart area for each bubble series overlapping one on top of other. I want to know if there is a better solution to implement this logic.
Hi utkarsh_bandekar,
Thank you for posting in the community.
In order to style particular datapoints in your chart differently, you can use the FillSceneGraph event. Please refer to the following threads for instructions and samples on this topic:
http://blogs.infragistics.com/forums/p/64387/326458.aspx
http://blogs.infragistics.com/forums/p/33056/180939.aspx#180939
Please note that if you are planning to implement overlapping charts, it may be more convenient to use a single area for the composite chart and multiple chart layers.
Do not hesitate to contact me if you have any questions.
hello Petar,
thanks for your reply.
i am using FillSceneGraph to highlight low/high datapoint.
i am facing one problem in FillSceneGraph.
i have a composite chart which has two chart layers with line chart and area chart resp.
the below event highlights low/high point in both charts line as well as area.
i want to highlight only in line chart.
void ultraChart_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e) { UltraChart ultraChart = sender as UltraChart; if (ultraChart != null) { PrimitiveCollection symbols = new PrimitiveCollection(); foreach (Primitive p in e.SceneGraph) { Polyline polyline = p as Polyline; if (polyline != null) { foreach (DataPoint dataPoint in polyline.points) { NumericTimeDataPoint numericTimeDataPoint = dataPoint.DataPoint as NumericTimeDataPoint; if (numericTimeDataPoint != null) { Symbol symbol; if (numericTimeDataPoint.NumericValue == Maxvalue) { symbol = new Symbol { icon = SymbolIcon.Circle, iconSize = (SymbolIconSize) 7, PE = {Fill = Color.FromArgb(0, 50, 205, 50), StrokeWidth = 0, Stroke = Color.Transparent }, point = dataPoint.point }; symbols.Add(symbol); } if (numericTimeDataPoint.NumericValue == Minvalue) { symbol = new Symbol { icon = SymbolIcon.Circle, iconSize = (SymbolIconSize) 7, PE = { Fill = Color.FromArgb(0, 255, 48, 48) , StrokeWidth = 0, Stroke = Color.Transparent }, point = dataPoint.point }; symbols.Add(symbol); } } } } break; //since chart type cannot be known, it is assumed the 1st collection is of line chart } } e.SceneGraph.AddRange(symbols.ToArray()); } }
Thank you for your reply.
Below is some sample code for accessing the layer id of a particular dataPoint:
((Infragistics.UltraChart.Core.Primitives.Primitive)(dataPoint)).Layer.LayerID
Please let me know if this helps.
Hi,
thanks for the reply.
your solution worked for me.
first i assigned the key property for the chartlayer apperence
chartLayerAppearance.Key = "LineChartLayer";than in FillSceneGraph event i checkedif (dataPoint.Layer.LayerID.Equals("LineChartLayer")) {.........
Thank you for your reply. Glad that you were able to implement your requirement.
Please feel free to contact me if you have any additional questions.
Hi Peter,
i am facing a strange problem in the ultraChart_FillSceneGraph event of the chart.
there is problem with rounding in NumericTimeDataPoint
The Original value passed to the series data is :- 27.806478019718991
if i check the value in NumericTimeDataPoint.NumericValue in the ultraChart_FillSceneGraph event it shows me 27.806478019719
i am not getting why it is rounding of the number.
This is creating problem in finding the low an high point in the chart because of this internal rounding by the chart.
I need help ASAP. have to solve this issue urgently
Thanks
utkarsh
Hi utkarsh,
Glad that your issue has been resolved.
Please feel free to contact me if I can be of further assistance.
Thanks for the reply. Following worked for me
(Convert.ToDouble(_chartA3Max.ToString()).Equals(numericTimeDataPoint.NumericValue)) thanksutkarsh
The issue you are experiencing seems to be related to the way Doubles are handled in C#. A discussion on that topic can be found at:http://stackoverflow.com/questions/2105096/why-is-tostring-rounding-my-double-value
To summarize, I would suggest that you try accessing your data point's values using:
Debug.WriteLine(((Double) dataPoint.Value).ToString("G17"));