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
170
Gridlines go beyond the axis
posted

I set up the far margin of the x-axis so I can have some space to create my own legend and it would not colide with the data.

The problem that I have now is that the gridlines for the y-axis go beyond the length of the x-axis. How can I make the gridlines to go only as far as the x-axis go.

Parents
No Data
Reply
  • 28496
    Suggested Answer
    Offline posted

    try handling the FillSceneGraph method with some code like this:

     private void ch_FillSceneGraph(object sender, FillSceneGraphEventArgs e)
            {
                Axis xAxis = e.Grid["X"] as Axis;
                Axis yAxis = e.Grid["Y"] as Axis;

                foreach (Primitive currentPrimitive in e.SceneGraph)
                {
                    Line currentLine = currentPrimitive as Line;
                    if (currentLine != null)
                    {
                        if (currentLine.p1.Y == currentLine.p2.Y)
                        {
                            // must be the x axis or an x gridline
                            currentLine.p1.X = xAxis.axisLineStart.X;
                            currentLine.p2.X = xAxis.axisLineEnd.X;
                        }
                    }
                }


            }

Children
No Data