Histogram series like MACD

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
PeteM
Newbie
Newbie
Posts: 6
Joined: Fri Apr 25, 2008 12:00 am

Histogram series like MACD

Post by PeteM » Mon Mar 16, 2009 6:16 pm

Hello,

I'm trying to use a Histogram series to create a display like the MACD Histogram where the bars are "anchored" to the zero line, and go up for positive and down for negative values.

Is there a way to do this with the Histogram series, or should I use Bars instead?

Thanks!

-pete-

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

Post by Sandra » Tue Mar 17, 2009 9:14 am

Hello Pete,
Is there a way to do this with the Histogram series, or should I use Bars instead?
Is not possible create an Histogram where the bars go up for positive and down for negative values, but you can produce same effect using Bars series, as you can see next code for example:

Code: Select all

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            Steema.TeeChart.Styles.Bar b = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            b.Marks.Visible = false;
            b.Add(-5, -3);
            b.Add(-10, -9);
            b.Add(-13, -5);
            b.Add(-8, -10);
            b.Add(-7, -15);
            b.Add(-15, -8);
            b.Add( 5, 9);
            b.Add(4, 10);
            b.Add(8, 15);
            b.Add(12, 11);
            b.BarWidthPercent = 100;
        }
You set that if we use the SeriesBar, we must add property BarWidthPercent=100 for get same result that an Histogram.
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