Positioning stacked bars above bottom axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Positioning stacked bars above bottom axis

Post by qcrnd » Wed May 13, 2009 8:32 am

Hi
I have a stacked bar chart and would like the bars to start a little above the bottom axis.
My Bottom axis postion is 0 but If I change it to -1there is a gap between the back wall and the axis and it doesnt look nice. I need the axis to be aligned with bottom of the back wall but want the first series to start a little above the axis.
Thanks

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

Post by Sandra » Wed May 13, 2009 11:18 am

Hello gcrnd,

I found a simple solution for your problem, you could make a similar coder using next code:

Code: Select all

      tChart1.Axes.Bottom.RelativePosition = -1;
            tChart1.Axes.Left.EndPosition = 101;
            tChart1.Walls.Back.Pen.Visible = false;
            tChart1.Walls.Bottom.Pen.Visible = false;
            tChart1.Walls.Left.Pen.Visible = false;

Also, there is a simple solution using:

Code: Select all

            bar.UseOrigin = true;
            bar.Origin = -1;
But, when use stacked not works fine andwish-list to be considered for inclusion in future releases.

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

qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Post by qcrnd » Wed May 13, 2009 11:44 am

Hi
What exactly is the problem with Stacked bar when doing this ? Didnt notice anthing

bar.UseOrigin = true;
bar.Origin = -1;

Thanks.

qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Post by qcrnd » Wed May 13, 2009 12:19 pm

Hi Again

Actually I noticed that it doesnt work if set
m_Chart.Axes.Left.AutomaticMinimum = false;

Is there any reason for this. Are there other problems in your code suggestions.

Also I see there is a problem with Multibar is with "Side" style.
Thanks.

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

Post by Sandra » Thu May 14, 2009 8:26 am

Hello grcnd,

What exactly is the problem with Stacked bar when doing this ? Didnt notice anthing

bar.UseOrigin = true;
bar.Origin = -1;
The exactly problem with Stacked, when you use bar.UseOrigin, and Bar.Origin, not works.
Actually I noticed that it doesnt work if set
m_Chart.Axes.Left.AutomaticMinimum = false;

Please, could you send us a simple example project we can run "as-is" to reproduce the problem here? You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page, and explain exactly how we can reproduce here the problem.

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

qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Post by qcrnd » Thu May 14, 2009 2:39 pm

Hi
I have uploaded sample TChartBarsAboveXAxis.Zip.
in the method InitializeStyle comment or uncomment the line
this.m_Chart.Axes.Left.AutomaticMinimum = false;
and look at the top left chart .

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

Post by Sandra » Fri May 15, 2009 8:27 am

Hello gcrnd,

I could reproduce your code, and two thinks:

First:

When you add this.m_Chart.Axes.Left.AutomaticMinimum = false; and then add data axis dosen't know how recalculate and remain with the initial position.

Second:

If you use this.m_Chart.axes.Left.AutomaticMinimum= false, you need to add an value minimum, for example:

Code: Select all

      this.m_Chart.Axes.Left.AutomaticMinimum = false;
      this.m_Chart.Axes.Left.Minimum = 0;
I hope that will helps.
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