Page 1 of 1
Problem with Multipe Bar series
Posted: Mon Aug 14, 2006 6:11 pm
by 9642155
I have a chart with a number of line series, and two bar series. Most of the series are on custom Y-Axes. All data series share the X-axis. I allow the user to determine the scale of the X-axis such that the chart may span multiple pages.
My problem is this: when I display both bar series (which are on separate, custom Y-axes), the bars do not draw (only the Marks are visible). Note that this only happens when I display both bar series; I can display any combination of line series with up to 1 bar series and everything works just fine.
I'm using C# .NET 2005 and TeeChart Pro Version 2.0.2306.26232.
Posted: Wed Aug 16, 2006 8:26 am
by Chris
Hello,
I'm afraid I can't reproduce this problem using the code below:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Bar bar1;
private Steema.TeeChart.Styles.Bar bar2;
private void InitializeChart()
{
bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar2 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar1.FillSampleValues();
bar2.FillSampleValues();
Steema.TeeChart.Axis custom1 = new Steema.TeeChart.Axis(tChart1.Chart);
Steema.TeeChart.Axis custom2 = new Steema.TeeChart.Axis(tChart1.Chart);
tChart1.Axes.Custom.Add(custom1);
tChart1.Axes.Custom.Add(custom2);
custom1.Horizontal = false;
custom2.Horizontal = false;
custom2.OtherSide = true;
bar1.CustomVertAxis = custom1;
bar2.CustomVertAxis = custom2;
}
Could you please modify the above code and post it back so that I can reproduce the problem here?
Many thanks!
Posted: Thu Aug 17, 2006 2:37 pm
by 9642155
Here's a modification of your code that kind of displays the behavior I see (except that one of the two series is still visible):
Code: Select all
public Form1()
{
InitializeComponent();
this.tChart1.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right);
this.WindowState = FormWindowState.Maximized;
InitializeChart();
}
private Steema.TeeChart.Styles.Bar bar1;
private Steema.TeeChart.Styles.Bar bar2;
private void InitializeChart()
{
tChart1.Legend.Visible = false;
tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar2 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
FillBar1SampleValues(bar1);
FillBar2SampleValues(bar2);
tChart1.Axes.Bottom.Automatic = false;
tChart1.Axes.Bottom.Minimum = 285;
tChart1.Axes.Bottom.Maximum = 815;
bar1.AutoMarkPosition = true;
bar1.Marks.MultiLine = true;
bar2.AutoMarkPosition = true;
bar2.Marks.MultiLine = true;
Steema.TeeChart.Axis custom1 = new Steema.TeeChart.Axis(tChart1.Chart);
Steema.TeeChart.Axis custom2 = new Steema.TeeChart.Axis(tChart1.Chart);
Steema.TeeChart.Axis custom3 = new Steema.TeeChart.Axis(tChart1.Chart);
tChart1.Axes.Custom.Add(custom1);
tChart1.Axes.Custom.Add(custom2);
tChart1.Axes.Custom.Add(custom3);
custom1.Horizontal = false;
custom2.Horizontal = false;
custom3.Horizontal = true;
custom3.RelativePosition = 50;
custom2.StartPosition = 50;
custom2.EndPosition = 100;
custom2.PositionUnits = Steema.TeeChart.PositionUnits.Percent;
custom1.PositionUnits = Steema.TeeChart.PositionUnits.Percent;
custom1.StartPosition = 0;
custom1.EndPosition = 50;
bar1.CustomVertAxis = custom1;
bar2.CustomVertAxis = custom2;
}
private void FillBar2SampleValues(Steema.TeeChart.Styles.Bar bar)
{
bar.Add((double)3, (double)8.94,
"I1" + Environment.NewLine +
"-119.427600015" + Environment.NewLine +
"49.888996996");
bar.Add((double)273, (double)0.22,
"I2" + Environment.NewLine +
"-119.427595913" + Environment.NewLine +
"49.888998383");
bar.Add((double)367, (double)0.66,
"I3" + Environment.NewLine +
"-119.427396053" + Environment.NewLine +
"49.889076888");
}
private void FillBar1SampleValues(Steema.TeeChart.Styles.Bar bar)
{
bar.Add((double)550, (double)61,
"A-I1" + Environment.NewLine +
"-119.427671568" + Environment.NewLine +
"49.888936422");
bar.Add((double)797, (double)55,
"A-I2" + Environment.NewLine +
"-119.427709578" + Environment.NewLine +
"49.888962245");
bar.Add((double)1154, (double)72,
"A-I3" + Environment.NewLine +
"-119.427600015" + Environment.NewLine+
"49.888996996");
}
I'll do a bit more to see if I can reproduce the exact problem.
Thank you for your time!
Posted: Fri Aug 18, 2006 10:17 am
by Chris
Hello,
OK, I've been able to reproduce the issue here and have added it to our defect list, meaning that a fix to it will be considered for inclusion into a future maintenance release.
Please note that this issue only occurs in a 3D and not a 2D chart.
Posted: Fri Aug 18, 2006 1:25 pm
by 9642155
I guess I don't understand the difference between a 2D chart and a 3D chart; I still have this same problem when I insert the line
Code: Select all
tChart1.Aspect.Chart3DPercent = 0;
Am I just misunderstanding the differences between 2D and 3D charts?
Also, is there any kind of a workaround for this issue in the interim between now and the maintenence release when (if) this issue will be resolved?
Posted: Fri Aug 18, 2006 2:18 pm
by Chris
Hello,
A 2D chart is:
I'm afraid that there's no workaround that I'm aware of for a 3D chart.
Posted: Fri Aug 18, 2006 2:51 pm
by 9642155
Thank you for the explanation of 2D / 3D.
Changing my chart to 2D solved my problem.
Many thanks!
I also noticed that the code from the executable demo (Welcome !\Axes\Opaque zones) seems to have a similar problem to mine with the multiple bar charts.
I don't know that it is worth looking into, but that's up to you and your schedule.
Thanks again!
Posted: Thu Jan 25, 2007 5:39 pm
by Chris
Hello,
A better solution is to set the multibar style of your bar series to None, e.g.
Code: Select all
bar1.MultiBar = Steema.TeeChart.Styles.MultiBars.None;
bar2.MultiBar = Steema.TeeChart.Styles.MultiBars.None;
This is because the bar series don't know they don't share the same vertical axis and think they have to avoid overlapping each other as they do with MultiBars.Side (default setting).