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
107
Line from floating points to composite chart.
posted

Hello!

 I would like to draw line from floating points to composite chart in FillSceneGraph method. Is it possible and how I can do it?

Example (drawing line from integer points):

private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)

{

    //gets the X and Y axis

    IAdvanceAxis x = (IAdvanceAxis)e.Grid["X"];

    IAdvanceAxis y = (IAdvanceAxis)e.Grid["Y"];

    //checks if axis exist

    if (x != null)

    {

        //figures out the coordinate to draw

        //a line at y=100

        int target = 100;

        int yVal = (int)y.Map(target);

        //note: the x axis is a string axis

        //that means that 0 stands for the first

        //column and 50 stands for the 50th

        //column               

        int xStart = (int)x.Map(0);

        int xEnd = (int)x.Map(50);

        //creates the line primitive based

        //on the coordinates

        Line l = new Line(new Point(xStart, yVal), new Point(xEnd, yVal));

        //sets the color of the line

        l.PE.Stroke = Color.Red;

        //adds it to the scene

        e.SceneGraph.Add(l);

    }

}

Parents
No Data
Reply
  • 28496
    Offline posted

    it's not possible, because the chart SceneGraph is based on pixel coordinates.  you can, however, handle the chart's Paint event and use the e.Graphics.DrawLine method ... that accepts PointFs as arguments.  but i think the display will just round these points to the nearest pixel, anyway.

    why do you want to use floating point coordinates?

     

    edit: you could also use a Path primitive (Infragistics.UltraChart.Core.Primitives.Path), and use its GraphicsPath property to host a GraphicsPath object.  The GraphicsPath.AddLine method also allows floating point arguments.

Children
No Data