Space between bar series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
wakewakeup
Newbie
Newbie
Posts: 6
Joined: Fri Feb 19, 2016 12:00 am

Space between bar series

Post by wakewakeup » Thu Mar 03, 2016 8:28 am

Hi,

I have just upgraded teechart from a 2 years old version, and it is shown different for bar series.

I attached two charts, one is how it was seen in the previous version, and the other with the bars over other bars.

How can I configurate the distance between bars?

Thanks
Attachments
Now.png
Now.png (79.19 KiB) Viewed 8075 times
previous.png
previous.png (73.08 KiB) Viewed 8068 times

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

Re: Space between bar series

Post by Christopher » Thu Mar 03, 2016 9:50 am

Hello,
wakewakeup wrote: I have just upgraded teechart from a 2 years old version, and it is shown different for bar series.

I attached two charts, one is how it was seen in the previous version, and the other with the bars over other bars.

How can I configurate the distance between bars?
Would you be so kind as to post here a "Short, Self Contained, Correct (Compilable), Example" of the code used to generate the images and also the two version numbers of TeeChart.dll in which the difference can be seen?

Thank you.
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

wakewakeup
Newbie
Newbie
Posts: 6
Joined: Fri Feb 19, 2016 12:00 am

Re: Space between bar series

Post by wakewakeup » Tue Apr 12, 2016 9:55 am

Please find attached the example.

You can change the variable numberofvalues from 2 to 3 and see how if you have 3 values it is show with spaces and with 2 they are one over other. I would like to be always like the 3 values example.

Thanks
Attachments
3values.png
3values.png (9.38 KiB) Viewed 8036 times
2values.png
2values.png (8.43 KiB) Viewed 8037 times
TestTeechart.zip
(16.9 KiB) Downloaded 667 times

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

Re: Space between bar series

Post by Christopher » Tue Apr 12, 2016 1:38 pm

Thank you for your example.

I think you should be able to use the BarWidthPercent property to change this behaviour, e.g.

Code: Select all

      int numberofvalues = 2;

      for (int i = 0; i < numberofvalues; i++)
      {
        Steema.TeeChart.Styles.Bar barra = new Steema.TeeChart.Styles.Bar(chart.Chart);
        barra.BarWidthPercent = 60;

        for (int j = 0; j < numberofvalues; j++)
        {
          barra.Labels[j] = "Label " + j.ToString();
          barra.Add(j, j * 10 + 1);
        }
      }
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