Search code examples
xamarin.iosteechart

Teechart Mobile - Column3DStacked graph


I would like to create a graph that looks similar to the following: enter image description here

However I can't find anything in TeeChart that would produce a similar result. I have tried to create a Bar3D series and set it's MultiBar property to different values but the closest one that I found was MultiBars.None.

Any suggestions?


Solution

  • Yes, this is possible with standard Bar series setting the MultiBar property to Stacked, for example:

      Steema.TeeChart.Themes.ExcelTheme excelTheme = new Steema.TeeChart.Themes.ExcelTheme(tChart1.Chart);
      excelTheme.Apply();
    
      tChart1.Aspect.View3D = true;
      tChart1.Axes.Bottom.Grid.Visible = false;
    
      tChart1.Legend.Pen.Visible = false;
    
      Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
      bar1.Marks.Visible = false;
      bar1.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
      bar1.BarWidthPercent = 50;
      bar1.Title = "Net personally receivable";
    
      Steema.TeeChart.Styles.Bar bar2 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
      bar2.Marks.Visible = false;
      bar2.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
      bar2.BarWidthPercent = 50;
      bar2.Title = "Tax and costs";
    
      Random rnd = new Random();
    
      bar1.Add(rnd.Next(), "Do Nothing");
      bar1.Add(rnd.Next(), "Bonus");
      bar1.Add(rnd.Next(), "Dividend");
      bar1.Add(rnd.Next(), "Interest");
      bar1.Add(rnd.Next(), "Alpha Index\nTrades");
    
      bar2.Add(rnd.Next(), "Do Nothing");
      bar2.Add(rnd.Next(), "Bonus");
      bar2.Add(rnd.Next(), "Dividend");
      bar2.Add(rnd.Next(), "Interest");
      bar2.Add(rnd.Next(), "Alpha Index\nTrades");
    

    Produces this chart:

    enter image description here