Page 1 of 1
Waterfall with different series
Posted: Mon May 03, 2010 10:52 am
by 15655593
Hello,
I am using TChart .Net 2009.
I want to create a Waterfall-chart with different series:
For the first series I have add a 3D-waterfull-series with the toolbox.
The other series I add in my coding by:
TChart1.Series(0).clone
To put data in the series I will do it by:
TChart1.Series(0).add(x,y)
Tchart1.Series(1).add(x,y)
....
Now my problem is, that this series are not show in different Z-axis.
The code:
TChart1.Series(0).ZOrder = 0
TChart1.Series(1).ZOrder = 1
takes no effect !
What can I do ?
Thank you
Jochen
Re: Waterfall with different series
Posted: Tue May 04, 2010 9:58 am
by 10050769
Hello Jochen,
I have made different test, and I think that your problem is that, ZValues have same value in Series1 and Series2. I recommend that add data manually, using method Series1.Add( x,y,z) and assign different valuesZ, for each group of values of Series. You could do similar code as next example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Waterfall waterfall1;
private void InitializeChart()
{
waterfall1= new Steema.TeeChart.Styles.Waterfall(tChart1.Chart);
waterfall1.Clone();
Random rnd = new Random();
for (int i = 0; i < 10; i++)
{
if (i < 4)
{
(tChart1[0]as Steema.TeeChart.Styles.Waterfall).Add(i, (double)(rnd.Next(100) * 0.01), 1);
}
else if (i >= 6)
{
(tChart1[0]as Steema.TeeChart.Styles.Waterfall).Add(i, (double)(rnd.Next(100) * 0.01), 2);
}
else
{
(tChart1[0] as Steema.TeeChart.Styles.Waterfall).Add(i, (double)(rnd.Next(100) * 0.01), 3);
}
(tChart1[0] as Steema.TeeChart.Styles.Waterfall).Brush.Gradient.Visible = true;
(tChart1[0] as Steema.TeeChart.Styles.Waterfall).Brush.Gradient.EndColor= Color.Yellow;
(tChart1[0] as Steema.TeeChart.Styles.Waterfall).Brush.Gradient.StartColor= Color.White;
(tChart1[0] as Steema.TeeChart.Styles.Waterfall).Brush.Gradient.MiddleColor= Color.Yellow;
}
for (int i = 0; i < 10; i++)
{
if (i < 4)
{
(tChart1[1]as Steema.TeeChart.Styles.Waterfall).Add(i, (double)(rnd.Next(100) * 0.01), 4);
}
else if (i >= 6)
{
(tChart1[1]as Steema.TeeChart.Styles.Waterfall).Add(i, (double)(rnd.Next(100) * 0.01), 5);
}
else
{
(tChart1[1] as Steema.TeeChart.Styles.Waterfall).Add(i, (double)(rnd.Next(100) * 0.01), 6);
}
(tChart1[1] as Steema.TeeChart.Styles.Waterfall).Brush.Gradient.Visible = true;
(tChart1[1] as Steema.TeeChart.Styles.Waterfall).Brush.Gradient.EndColor = Color.Orange;
(tChart1[1] as Steema.TeeChart.Styles.Waterfall).Brush.Gradient.StartColor = Color.White;
(tChart1[1] as Steema.TeeChart.Styles.Waterfall).Brush.Gradient.MiddleColor = Color.Orange;
}
Please, check that previous code solves your problem and works as you want.
I hope will helps.
Thanks,