Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1232 - Histogram series with a single values makes wrong axis range.
Summary: Histogram series with a single values makes wrong axis range.
Status: RESOLVED NOTABUG
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- major
Target Milestone: ---
Assignee: Steema Issue Manager
URL: http://www.teechart.net/directline/vi...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-10 05:26 EDT by narcís calvet
Modified: 2015-07-29 09:33 EDT (History)
2 users (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description narcís calvet 2015-06-10 05:26:15 EDT
In the code snippet below, adding one single value to the second Histogram series completely breaks bottom axis scale.

      Steema.TeeChart.Styles.Histogram histogram1 = new Steema.TeeChart.Styles.Histogram(tChart1.Chart);
      Steema.TeeChart.Styles.Histogram histogram2 = new Steema.TeeChart.Styles.Histogram(tChart1.Chart);

      for (int i = 0; i < 24; i++)
      {
        histogram1.Add(i);
      }

      double tmp = histogram1.MaxYValue() + 1;

      histogram1.Add(tmp);      
      histogram2.Add(tmp);
Comment 1 narcís calvet 2015-06-10 05:46:16 EDT
Something similar occurs when adding a 2nd point to the 2nd series:

      Steema.TeeChart.Styles.Histogram histogram1 = new Steema.TeeChart.Styles.Histogram(tChart1.Chart);
      Steema.TeeChart.Styles.Histogram histogram2 = new Steema.TeeChart.Styles.Histogram(tChart1.Chart);

      for (int i = 0; i < 24; i++)
      {
        histogram1.Add(i);
      }

      double tmp = histogram1.MaxYValue() + 1;

      histogram1.Add(tmp);      
      histogram2.Add(tmp);
      histogram2.Add(tmp);
Comment 2 narcís calvet 2015-06-10 05:52:01 EDT
A workaround to the problem is adding a negative MinimumOffset value to the bottom axis:

tChart1.Axes.Bottom.MinimumOffset = -1;
Comment 3 christopher ireland 2015-06-10 06:14:46 EDT
Similar problem in VCL:
http://bugs.teechart.net/show_bug.cgi?id=1233
Comment 4 christopher ireland 2015-07-29 09:32:59 EDT
This issue can be fixed by the addition of null points, e.g.

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;

      Steema.TeeChart.Styles.Histogram histogram1 = new Steema.TeeChart.Styles.Histogram(tChart1.Chart);
      Steema.TeeChart.Styles.Histogram histogram2 = new Steema.TeeChart.Styles.Histogram(tChart1.Chart);

      for (int i = 0; i < 24; i++)
      {
        histogram1.Add(i);
        histogram2.Add();
      }

      double tmp = histogram1.MaxYValue() + 1;

      histogram1.Add(tmp);
      histogram2.Add(tmp);
    }