I have a horizontal bar chart with 2 series. One series is a percentage using the left axis. The axis is set to run from 0% to 100%. The second series is using the right axis and represents a temperature. Potential values are -40 - 160. I would like the second series bar to start at the base of the chart instead of starting at zero.
However that is not how it's rendering. I tried setting UseOrigin to true and Origin to -40, but it didn't make a difference.
I've also posted my question on stackoverflow.com here:
http://stackoverflow.com/questions/2406 ... rigin-inst
I have included a screen capture so you can see my code and see how it rendering.
An unrelated problem I'm having is no matter what property I change, I can't see to get the background of the graph to render as white. It always seems to be battleship grey.
Using none zero Origin on a bar series.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Using none zero Origin on a bar series.
Hello!
gives me the following chart:
Do you get the same results at your end?
The following code:tms4000 wrote:I have a horizontal bar chart with 2 series. One series is a percentage using the left axis. The axis is set to run from 0% to 100%. The second series is using the right axis and represents a temperature. Potential values are -40 - 160. I would like the second series bar to start at the base of the chart instead of starting at zero.
Code: Select all
private void InitializeChart()
{
tChart1.Axes.Right.Grid.Visible = false;
tChart1.Axes.Right.Maximum = 160.0;
tChart1.Axes.Right.Minimum = -40;
tChart1.Axes.Right.Increment = 40;
tChart1.Axes.Right.Automatic = false;
tChart1.Axes.Right.AutomaticMinimum = false;
tChart1.Axes.Right.AutomaticMaximum = false;
tChart1.Aspect.View3D = false;
tChart1.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
tChart1.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
tChart1.Axes.Left.Grid.Visible = false;
tChart1.Axes.Bottom.Grid.Centered = false;
tChart1.Axes.Bottom.Ticks.Visible = false;
tChart1.Axes.Left.Automatic = false;
tChart1.Axes.Left.Minimum = 0;
tChart1.Axes.Left.Maximum = 100;
tChart1.Axes.Right.Visible = true;
var barProduct = new Steema.TeeChart.Styles.Bar();
barProduct.MultiBar = MultiBars.Side;
barProduct.Color = Color.Green;
barProduct.Marks.Visible = false;
barProduct.Title = "% Vol";
barProduct.ShowInLegend = true;
Random rnd = new Random();
for (int i = 0; i < 10; i++)
{
barProduct.Add(rnd.Next(0, 100));
}
tChart1.Series.Add(barProduct);
var barTemperature = new Steema.TeeChart.Styles.Bar();
barTemperature.MultiBar = MultiBars.Side;
barTemperature.Color = Color.FromArgb(153, 74, 11);
barTemperature.Marks.Visible = false;
barTemperature.VertAxis = VerticalAxis.Right;
barTemperature.UseOrigin = true;
barTemperature.Origin = -40;
barTemperature.Title = "Temperature";
barTemperature.ShowInLegend = true;
for (int i = 0; i < 10; i++)
{
barTemperature.Add(rnd.Next(-40, 160));
}
tChart1.Series.Add(barTemperature);
tChart1.Panel.Gradient.Visible = false;
tChart1.Walls.Back.Gradient.Visible = false;
tChart1.Panel.Color = Color.White;
tChart1.Walls.Back.Color = Color.White;
}
Do you get the same results at your end?
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Using none zero Origin on a bar series.
If I use your code, I get the same result as you.
I messed around and determined the issue is related to the mutibar property.
My origin code snippet left out some details, that in retrospect I should have included.
I actually have 5 series: Product, SP1, SP2, SP3 alll with Multibar = Multibar.Stacked & StackGroup = 1
The last series is the temperature series.
I need the first 4 series to be stacked together and use the left axis.
I need the temp series to stand alone and use the right axis (-40 to 160)
When I remove the SP1 SP2 and SP3 series and change the Mutibar property on the product seriers to MultiBars.Side, the Temperature series responds correctly to the origin property.
When I set Product.Multibar = Multibar.Stacked, the temperature series acts like 0 is the origin.
I messed around and determined the issue is related to the mutibar property.
My origin code snippet left out some details, that in retrospect I should have included.
I actually have 5 series: Product, SP1, SP2, SP3 alll with Multibar = Multibar.Stacked & StackGroup = 1
The last series is the temperature series.
I need the first 4 series to be stacked together and use the left axis.
I need the temp series to stand alone and use the right axis (-40 to 160)
When I remove the SP1 SP2 and SP3 series and change the Mutibar property on the product seriers to MultiBars.Side, the Temperature series responds correctly to the origin property.
When I set Product.Multibar = Multibar.Stacked, the temperature series acts like 0 is the origin.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Using none zero Origin on a bar series.
Just to confirm exactly what the issue is. I think I can reproduce the problem using this code:tms4000 wrote:When I remove the SP1 SP2 and SP3 series and change the Mutibar property on the product seriers to MultiBars.Side, the Temperature series responds correctly to the origin property.
When I set Product.Multibar = Multibar.Stacked, the temperature series acts like 0 is the origin.
Code: Select all
private void InitializeChart()
{
Random rnd = new Random();
tChart1.Axes.Right.Grid.Visible = false;
tChart1.Axes.Right.Maximum = 160.0;
tChart1.Axes.Right.Minimum = -40;
tChart1.Axes.Right.Increment = 40;
tChart1.Axes.Right.Automatic = false;
tChart1.Axes.Right.AutomaticMinimum = false;
tChart1.Axes.Right.AutomaticMaximum = false;
tChart1.Aspect.View3D = false;
tChart1.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
tChart1.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
tChart1.Axes.Left.Grid.Visible = false;
tChart1.Axes.Bottom.Grid.Centered = false;
tChart1.Axes.Bottom.Ticks.Visible = false;
tChart1.Axes.Left.Automatic = false;
tChart1.Axes.Left.Minimum = 0;
tChart1.Axes.Left.Maximum = 100;
tChart1.Axes.Right.Visible = true;
for (int j = 0; j < 3; j++)
{
var barProduct = new Steema.TeeChart.Styles.Bar();
barProduct.MultiBar = MultiBars.Stacked;
barProduct.Color = Color.Green;
barProduct.StackGroup = 0;
barProduct.Marks.Visible = false;
barProduct.Title = "% Vol";
barProduct.ShowInLegend = true;
for (int i = 0; i < 10; i++)
{
barProduct.Add(rnd.Next(0, 100));
}
tChart1.Series.Add(barProduct);
}
var barTemperature = new Steema.TeeChart.Styles.Bar();
barTemperature.MultiBar = MultiBars.Stacked;
barTemperature.Color = Color.FromArgb(153, 74, 11);
barTemperature.StackGroup = 1;
barTemperature.Marks.Visible = false;
barTemperature.VertAxis = VerticalAxis.Right;
barTemperature.UseOrigin = true;
barTemperature.Origin = -40;
barTemperature.Title = "Temperature";
barTemperature.ShowInLegend = true;
for (int i = 0; i < 10; i++)
{
barTemperature.Add(rnd.Next(-40, 160));
}
tChart1.Series.Add(barTemperature);
tChart1.Panel.Gradient.Visible = false;
tChart1.Walls.Back.Gradient.Visible = false;
tChart1.Panel.Color = Color.White;
tChart1.Walls.Back.Color = Color.White;
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Using none zero Origin on a bar series.
Yes, that's the issue I'm seeing.
I have not posted it to your bug tracker. Could I be informed when this issue is addressed?
I have not posted it to your bug tracker. Could I be informed when this issue is addressed?
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Using none zero Origin on a bar series.
The bug is has been posted here and has already been fixed; the fix will become publicly available in the next maintenance release, due out mid-summer.tms4000 wrote:Yes, that's the issue I'm seeing.
I have not posted it to your bug tracker. Could I be informed when this issue is addressed?
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |