Page 1 of 1

Numbers on Y Axis get trimmed off

Posted: Tue Sep 04, 2012 9:18 am
by 15660987
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.

Re: Numbers on Y Axis get trimmed off

Posted: Tue Sep 04, 2012 11:25 am
by 10050769
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,

Re: Numbers on Y Axis get trimmed off

Posted: Tue Sep 04, 2012 1:53 pm
by 15660987
Your solution solved my problem.

Thank you very much!
Marijke