Page 1 of 1

Space between bar series

Posted: Thu Mar 03, 2016 8:28 am
by 15677720
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

Re: Space between bar series

Posted: Thu Mar 03, 2016 9:50 am
by Christopher
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.

Re: Space between bar series

Posted: Tue Apr 12, 2016 9:55 am
by 15677720
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

Re: Space between bar series

Posted: Tue Apr 12, 2016 1:38 pm
by Christopher
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);
        }
      }