Common Zero for Left Axis & Bottom Axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Common Zero for Left Axis & Bottom Axis

Post by Neelam » Wed Apr 04, 2012 4:58 pm

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.
Attachments
CommonZero.PNG
CommonZero.PNG (18.25 KiB) Viewed 6219 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Common Zero for Left Axis & Bottom Axis

Post by Sandra » Thu Apr 05, 2012 10:34 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply