Segmented Bar Cart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
tms4000
Newbie
Newbie
Posts: 17
Joined: Mon Jun 02, 2014 12:00 am

Segmented Bar Cart

Post by tms4000 » Tue Jul 15, 2014 8:48 pm

I'm wondering if there is any way to create a bar chart similar to the one in the attached PNG file? With each bar segmented?
Attachments
BandedBarChart.png
BandedBarChart.png (1.82 KiB) Viewed 4400 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Segmented Bar Cart

Post by Christopher » Wed Jul 16, 2014 8:23 am

tms4000 wrote:I'm wondering if there is any way to create a bar chart similar to the one in the attached PNG file? With each bar segmented?
You could try using stacked series with null values, e.g.

Code: Select all

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;

      Bar bar1 = new Bar(tChart1.Chart);
      Bar bar2 = new Bar(tChart1.Chart);
      Bar bar3 = new Bar(tChart1.Chart);

      bar1.Marks.Visible = false;
      bar2.Marks.Visible = false;
      bar3.Marks.Visible = false;

      bar1.Add(1);
      bar1.Add(2);
      bar1.Add(3);

      bar2.Add(1, Color.Transparent);
      bar2.Add(1, Color.Transparent);
      bar2.Add(1, Color.Transparent);

      bar3.Add(1);
      bar3.Add(2);
      bar3.Add(3);

      bar1.MultiBar = MultiBars.Stacked;
    }
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

Post Reply