Page 1 of 1

Bar series spacing

Posted: Tue May 31, 2016 1:39 pm
by 15673848
Hello,

I have a question about bar series. I have the following code:

Code: Select all

Steema.TeeChart.Styles.Bar bar = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar.FillSampleValues(10);
bar.Marks.Visible = false;
bar.MultiBar = Steema.TeeChart.Styles.MultiBars.None;
bar.BarWidthPercent = 65;
bar.Color = Color.FromArgb(100, 49, 130, 189);

Steema.TeeChart.Styles.Bar bar2 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar2.FillSampleValues(10);
bar2.Marks.Visible = false;
bar2.BarWidthPercent = 30;
This results in the following chart:
TeeChart1.jpg
TeeChart1.jpg (30.3 KiB) Viewed 7974 times
For “bar1” the first and last bar are not shown completely.
If I change the order of the series it looks ok:
TeeChart2.jpg
TeeChart2.jpg (36.97 KiB) Viewed 7973 times
Is there a way to also show the first chart with the extra space next to the first and the last bar without having to change the offset or min/max values manually?

Thanks in advance!

Re: Bar series spacing

Posted: Wed Jun 01, 2016 10:45 am
by Christopher
Hello,
OMP wrote: Is there a way to also show the first chart with the extra space next to the first and the last bar without having to change the offset or min/max values manually?
Yes, you should be able to use Axis offsets, e.g.

Code: Select all

    private void InitializeChart()
    {
      Steema.TeeChart.Styles.Bar bar = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
      bar.FillSampleValues(10);
      bar.Marks.Visible = false;
      bar.MultiBar = Steema.TeeChart.Styles.MultiBars.None;
      bar.BarWidthPercent = 65;
      bar.Color = Color.FromArgb(100, 49, 130, 189);

      Steema.TeeChart.Styles.Bar bar2 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
      bar2.FillSampleValues(10);
      bar2.Marks.Visible = false;
      bar2.BarWidthPercent = 30;
      

      tChart1.Axes.Bottom.MinimumOffset = 50;
      tChart1.Axes.Bottom.MaximumOffset = 50;
    }

Re: Bar series spacing

Posted: Thu Jun 02, 2016 8:08 am
by Christopher
Christopher wrote:
OMP wrote: Is there a way to also show the first chart with the extra space next to the first and the last bar without having to change the offset or min/max values manually?
Yes, you should be able to use Axis offsets, e.g.
Ah, sorry, I now see that maybe you didn't want to use Axis offsets, my apologies. To answer your question then - no, there is nothing automatic that can be set manually to resolve this issue, so to speak.