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 2478

Summary: XValues change when exporting to Javascript
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: ExportAssignee: yeray alonso <yeray>
Status: RESOLVED FIXED    
Severity: enhancement CC: yeray
Priority: ---    
Version: 33.210915   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
URL: https://www.steema.com/support/viewtopic.php?f=3&t=17563&p=78116#p78116
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: screenshot

Description yeray alonso 2021-10-28 07:33:26 EDT
Exporting a chart with datetimes to javascript, the values are modified.
This example creates xvalues starting at 0:00 but the xvalues in the javascript side start at 02:00.

procedure TForm1.LocalDatetimeToJavascript;
const fileName='test';
var i: Integer;
    tmp: TDateTime;
begin
  with Chart1.AddSeries(TBarSeries) do
  begin
    XValues.DateTime:=True;
    FillSampleValues;
    Marks.Hide;
    tmp:=Today;

    for i:=0 to Count-1 do
    begin
      XValue[i]:=tmp;
      tmp:=IncHour(tmp,1);
    end;
  end;

  TeeSaveToJavascriptFile(Chart1, fileName+'.html');
  TeeGoToURL(Handle,fileName+'.html');
end;
Comment 1 yeray alonso 2021-10-28 07:35:11 EDT
Created attachment 989 [details]
screenshot