Page 1 of 1

Common Zero for Left Axis & Bottom Axis

Posted: Wed Apr 04, 2012 4:58 pm
by 13045482
I'm using Steema Silverlight. My Left Y Axis Starts from Zero and Bottom Axis also starts from Zero. So I need a common Zero instead of 2 Zeros. In Windows .NET version it was working. Is there any way to achieve the same in Silverlight version.

Re: Common Zero for Left Axis & Bottom Axis

Posted: Thu Apr 05, 2012 10:34 am
by 10050769
Hello Neelam,

I have try to achieve a common 0 using the same code with Winforms and Silverlight and I have gotten the same results in both projects and these are negative. Can you tell us, which values are you using to achieve a common 0 in Winforms? On the other hand, you can solve your problem using GetAxisLabel Event and remove the 0 you don't want as do in next code:

Code: Select all

   public MainPage()
        {
            InitializeComponent();
            InitializeChart();
        }

        Steema.TeeChart.Silverlight.Styles.Line Series1, Series2;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            Series1 = new Steema.TeeChart.Silverlight.Styles.Line(tChart1.Chart);
            Series2 = new Steema.TeeChart.Silverlight.Styles.Line(tChart1.Chart);

            Series1.Add(0, 35);
            Series1.Add(1, 134);
            Series1.Add(2, 245);
            Series1.Add(2, 555);

            Series2.Add(0,0);
            Series2.Add(1, 50);
            Series2.Add(3, 150);
            Series2.Add(2, 300);
            tChart1.GetAxisLabel  = new Steema.TeeChart.Silverlight.GetAxisLabelEventHandler(tChart1_GetAxisLabel);
          
        }

        void tChart1_GetAxisLabel(object sender, Steema.TeeChart.Silverlight.GetAxisLabelEventArgs e)
        {
            if (sender == tChart1.Axes.Left)
            {
                if (e.LabelText == "0")
                {
                    e.LabelText = " ";
                }
            }
        }
 
I hope will helps.

Thanks,