Page 1 of 1

Segmented Bar Cart

Posted: Tue Jul 15, 2014 8:48 pm
by 15669348
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?

Re: Segmented Bar Cart

Posted: Wed Jul 16, 2014 8:23 am
by Christopher
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;
    }