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 1752

Summary: Add function PeriodAligns.Last not plotting accurately
Product: .NET TeeChart Reporter: christopher ireland <chris>
Component: ChartAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: normal    
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: screenshot

Description christopher ireland 2017-01-17 04:57:22 EST
Created attachment 696 [details]
screenshot

See screenshot ...

note the first point of Series1, the funcSeries, which has a value of 6 which equals (0+1+2+3) - BUT- this value 6 is not plotted on the last point in this group with value 3. It is plotted on the first point of the next group with value 4. Again, the second point of Series has a value of 22 which equals (4+5+6+7) - again, the last point in this series is 7, but funcSeries plots the value 22 on point 8.

code:
    Line series;
    FastLine funcSeries;
    Add chartTotalFunction;
    private void InitializeChart()
    {
      funcSeries = new FastLine(tChart1.Chart);
      funcSeries.Marks.Visible = true;
      chartTotalFunction = new Add();
      chartTotalFunction.Period = new TimeSpan(0, 12, 0, 0).TotalDays;
      chartTotalFunction.PeriodAlign = Steema.TeeChart.Functions.PeriodAligns.Last;
      chartTotalFunction.PeriodStyle = Steema.TeeChart.Functions.PeriodStyles.Range;
      funcSeries.Function = chartTotalFunction;


      series = new Line(tChart1.Chart);
      DateTime today = DateTime.Today;

      for (int i = 0; i < 20; i++)
      {
        series.Add(today, i);
        today = today.AddHours(3);
      }

      funcSeries.Marks.Visible = true;
      series.Marks.Visible = true;
      funcSeries.DataSource = series;

      tChart1.Axes.Bottom.Labels.Angle = 90;
      tChart1.Axes.Bottom.Increment = new TimeSpan(0, 3, 0, 0).TotalDays;
      tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/MM/yy hh:mm";
    }