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 1753 - Add function PeriodAligns.Last not plotting accurately
Summary: Add function PeriodAligns.Last not plotting accurately
Status: CONFIRMED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Chart (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-17 05:20 EST by christopher ireland
Modified: 2017-01-17 05:20 EST (History)
0 users

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


Attachments
screenshot (35.07 KB, image/png)
2017-01-17 05:20 EST, christopher ireland
Details

Note You need to log in before you can comment on or make changes to this bug.
Description christopher ireland 2017-01-17 05:20:20 EST
Created attachment 697 [details]
screenshot

vcl equivalent of: http://bugs.teechart.net/show_bug.cgi?id=1752

TeeFunci

procedure TForm1.InitializeChart;
var funcSeries, series : TFastLineSeries;
    chartTotalFunction: TAddTeeFunction;
    today: TDateTime;
    t: Integer;
begin
   Chart1.View3D:=false;

   funcSeries:=TFastLineSeries(Chart1.AddSeries(TFastLineSeries));
   funcSeries.Marks.Visible:=true;
   chartTotalFunction:=TAddTeeFunction.Create(Chart1);
   chartTotalFunction.Period:=0.5; //12 hours
   chartTotalFunction.PeriodAlign:=paLast;
   chartTotalFunction.PeriodStyle:=psRange;
   funcSeries.FunctionType:=chartTotalFunction;

   series:=TFastLineSeries(Chart1.AddSeries(TFastLineSeries));
   series.Marks.Visible:=true;
   series.XValues.DateTime:=true;
   today:=StrToDate('16/01/2017');

   for t:=0 to 19 do
   begin
     series.AddXY(today, t);
     today:=today + (1 / 8); //3 hours
   end;

   funcSeries.DataSource:=series;
   Chart1.Axes.Bottom.LabelsAngle:=90;
   Chart1.Axes.Bottom.Increment:=(1 / 8);
   Chart1.Axes.Bottom.DateTimeFormat:='dd/MM/yy hh:mm';

   Chart1.Title.Text.Add('funcSeries total: ' + FloatToStr(funcSeries.YValues.Total));
   Chart1.Title.Text.Add('series total: ' + FloatToStr(series.YValues.Total));
end;