Waterfall with different series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
zems
Newbie
Newbie
Posts: 3
Joined: Fri Apr 09, 2010 12:00 am

Waterfall with different series

Post by zems » Mon May 03, 2010 10:52 am

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

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

Re: Waterfall with different series

Post by Sandra » Tue May 04, 2010 9:58 am

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,
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