Page 1 of 1
Positioning stacked bars above bottom axis
Posted: Wed May 13, 2009 8:32 am
by 9092401
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
Posted: Wed May 13, 2009 11:18 am
by 10050769
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,
Posted: Wed May 13, 2009 11:44 am
by 9092401
Hi
What exactly is the problem with Stacked bar when doing this ? Didnt notice anthing
bar.UseOrigin = true;
bar.Origin = -1;
Thanks.
Posted: Wed May 13, 2009 12:19 pm
by 9092401
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.
Posted: Thu May 14, 2009 8:26 am
by 10050769
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,
Posted: Thu May 14, 2009 2:39 pm
by 9092401
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 .
Posted: Fri May 15, 2009 8:27 am
by 10050769
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.