Numbers on Y Axis get trimmed off

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MVB
Newbie
Newbie
Posts: 11
Joined: Fri Dec 09, 2011 12:00 am

Numbers on Y Axis get trimmed off

Post by MVB » Tue Sep 04, 2012 9:18 am

Hi,

I want to show a very small chart (size 400 x 300). When I add only one data point with a float value on the Y Axis, this float value gets trimmed on the left side.
From the moment that I add a second data point, the values are shown correctly.
Why is this value trimmed when I have only one data point?

I made a very small C# project to reproduce this issue.

This is what I did:

TChart chut;
chut.Aspect.View3D = false;
line = new Steema.TeeChart.Styles.Line(chut.Chart);
line.Add(1, 105487.648984894);

and the TChart is added with a maximum size set to 400 x 300.

You can see the result in the attached screenshot.

I can also send you the complete C# project if that could be helpful. But where do I put that zip file?

Kind regards,
Marijke.
Attachments
Capture.PNG
screenshot
Capture.PNG (12.63 KiB) Viewed 5006 times

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

Re: Numbers on Y Axis get trimmed off

Post by Sandra » Tue Sep 04, 2012 11:25 am

Hello Marijke,

I suggest you do something as next code to achieve your code works as you expect:

Code: Select all

    Steema.TeeChart.Styles.Line line;
       
        private void InitializeChart()
        {
            this.Width = 500;
            this.Height = 400;
            tChart1.Height = 300;
            tChart1.Width = 400;
            tChart1.Aspect.View3D = false;
            line = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line.Add(1, 105487.648984894);
            tChart1.Draw();
            tChart1.Panel.MarginUnits = PanelMarginUnits.Pixels;
            tChart1.Panel.MarginLeft = tChart1.Panel.MarginLeft + tChart1.Axes.Left.MaxLabelsWidth();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            tChart1.ShowEditor();
        }
      
Can you tell us if previous code works as you want?

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

MVB
Newbie
Newbie
Posts: 11
Joined: Fri Dec 09, 2011 12:00 am

Re: Numbers on Y Axis get trimmed off

Post by MVB » Tue Sep 04, 2012 1:53 pm

Your solution solved my problem.

Thank you very much!
Marijke

Post Reply