Page 1 of 1

No width with multi-series one point bar charts.

Posted: Wed Feb 22, 2017 3:43 pm
by 15048900
I have a problem with bars in multiple series bar charts where each series has only one point in them.

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NoThicknessInSingleDataPointBarChart
{
    public partial class Form1 : Form
    {
        const int NUMBER_OF_POINTS = 1;
        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = true;
            for (int i = 0; i < 4; i++)
            {
                Steema.TeeChart.Styles.Bar TheSeries = new Steema.TeeChart.Styles.Bar();
                TheSeries.MultiBar = Steema.TeeChart.Styles.MultiBars.None;
                TheSeries.Title = "Series-" + i.ToString();
                TheSeries.Marks.Visible = false;

                tChart1.Series.Add(TheSeries);

                for (int j = 0; j < NUMBER_OF_POINTS; j += 1)
                {
                    TheSeries.Add(j + 1, "Label-" + j.ToString());
                }
            }
        }
    }
}
If NUMBER_OF_POINTS is set to 2 then you get:
TwoPointsMultipleSeries.PNG
TwoPointsMultipleSeries.PNG (13.72 KiB) Viewed 5795 times
If NUMBER_OF_POINTS is set to 1 then you get:
OnePointMultipleSeries.PNG
OnePointMultipleSeries.PNG (10.74 KiB) Viewed 5794 times
This is using the "Steema TeeChart for .NET 2016 4.1.2016.10260" of the library.
The "Steema TeeChart for .NET 2016 4.1.2016.05120" version of the library does not have this problem.

Re: No width with multi-series one point bar charts.

Posted: Wed Feb 22, 2017 4:04 pm
by Christopher
Hello,

Unfortunately a similar issue has already been reported and fixed in id=1794. In the meantime, you should be able to set the CustomBarWidth to ameliorate the rendering in these particular cases:

Code: Select all

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = true;
      for (int i = 0; i < 4; i++)
      {
        Steema.TeeChart.Styles.Bar TheSeries = new Steema.TeeChart.Styles.Bar();
        TheSeries.MultiBar = Steema.TeeChart.Styles.MultiBars.None;
        TheSeries.Title = "Series-" + i.ToString();
        TheSeries.Marks.Visible = false;

        tChart1.Series.Add(TheSeries);

        TheSeries.CustomBarWidth = 150;


        for (int j = 0; j < NUMBER_OF_POINTS; j += 1)
        {
          TheSeries.Add(j + 1, "Label-" + j.ToString());
        }
      }
    }