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
1300
shift y axis
posted

Hi ,

I have a plot like this :

 

I would like to shift the why axis to the label , I use the followinf fillscene graph :

 private void Chartquadrant_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
        {
            foreach (Primitive item in e.SceneGraph)
            {


                if (item.GetType() == typeof(Line) && ((Line)item).lineStyle.DrawStyle != LineDrawStyle.Dash)
                {
                    if (((Line)item).p1.X == ((Line)item).p2.X)
                    {
                        ((Line)item).p1.Offset(this.Chartquadrant.Width / 2, 0);
                        ((Line)item).p2.Offset(this.Chartquadrant.Width / 2, 0);
                    }
                    else
                    {
                        ((Line)item).p1.Offset(0, -400);
                        ((Line)item).p2.Offset(0, -400);
                    }
                }

                Text pl = item as Text;
                if (pl != null && ((Text)item).labelStyle.Orientation == TextOrientation.VerticalLeftFacing)
                {
                    ((Text)item).bounds = new Rectangle(((Text)item).bounds.X + 0, ((Text)item).bounds.Y - (400), ((Text)item).bounds.Width, ((Text)item).bounds.Height);
                }

                if (pl != null && ((Text)item).labelStyle.Orientation == TextOrientation.Horizontal)
                {
                    ((Text)item).bounds = new Rectangle(((Text)item).bounds.X + this.Chartquadrant.Width / 2 - 50, ((Text)item).bounds.Y, ((Text)item).bounds.Width, ((Text)item).bounds.Height);
                }


            }
        }

 

Do you have any idea of how i can do that ?

 

Thanks.

 

F.

Parents
  • 53790
    posted

    Hello F,

    I suppose that we discuss similar topic with you in another forum thread. If you want to change the Axis posiition you should used :

    ((Line)item).p1.Offset(this.ultraChart1.Width / 2 - 23, 0);

    In this sample I have additional offset of (- 23). This will move only my axis, so I should apply the same offset for the labels. For example:

    ((Text)item).bounds = new Rectangle(((Text)item).bounds.X + this.ultraChart1.Width / 2 - 23, ((Text)item).bounds.Y, ((Text)item).bounds.Width, ((Text)item).bounds.Height);

    The same approuch would be for the other axis and lables. Please take a look at the attached sample for more details and let me know if you have any questions.

    Regards

    ScatterChart_3.zip
Reply Children
No Data