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
485
Polar Chart - How to get X,Y values from DataPoint.point
posted

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

Parents
  • 485
    posted

    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.

    Thanks

    Anil

    ---------------------------------------------------------------------------------------------------------------------------------

    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;

    }

    }

    }

Reply Children
No Data