How do I get the x,y coord of the chart from the datapoint.point?
Here is what I am trying:
From the fillscene graph event, get all the Primitives/Data Points. From the Y value (or the radial axis value), resize the symbol and give it a color based on a property value.
Thanks
Anil
Here is what I am doing with the fillSceneGraph event - with no success.
The dataPoint.point.X, and dataPoint.Y values for some of the points are like -267534.
I could put an if condition to fiter values between 0-700 for screen y coord. At least thats
what I get for my chart - but risky to assume. MapInverse doesnt seem to return the right
values.
Any help will be highly appreciated.
---------------------------------------------------------------------------------------------------------------------------------
private void update_scene(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
{
if (e.Grid.Count == 0) return;
IAdvanceAxis xAxis = (IAdvanceAxis)e.Grid["X"];
IAdvanceAxis yAxis = (IAdvanceAxis)e.Grid["Y"];
int minval = 0;
int maxval = 0;
foreach (Primitive primitive in e.SceneGraph)
PointSet pointSet = primitive as PointSet;
if (pointSet == null)
continue;
}
else
Color clr = Color.Aquamarine;
for (int k = 0; k < pointSet.points.Length; k++)
int newIconsize = 10;
DataPoint dataPoint = pointSet.points[k];
int yVal = yAxis.MapInverse(dataPoint.point.Y);
int xVal = yAxis.MapInverse(dataPoint.point.X);
newIconsize = getPointSizeBasedOnYcoord(yVal);
clr = getColorBasedOnSelectedPropertyVal(xVal,yVal);
if (newIconsize == 0) newIconsize = 10;
Symbol symbol = new Symbol(dataPoint.point, SymbolIcon.Circle, (SymbolIconSize)newIconsize);
symbol.PE.Fill = clr;
symbol.PE.Stroke = clr;
symbol.PE.StrokeOpacity = 0;
e.SceneGraph.Add(symbol);
break;
Finally got it right and realised that my directionw as not right.
if (dataPoint.point.X>-1) // Still I had to do this..
int rowid = dataPoint.Row;
double dipval = dataPoint.Layer.ChartData.GetValue(rowid, 0);
double azimval = dataPoint.Layer.ChartData.GetValue(rowid, 1);
double propertyval = dataPoint.Layer.ChartData.GetValue(rowid, 2);