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 2479 - XValues change when exporting to Javascript
Summary: XValues change when exporting to Javascript
Status: RESOLVED FIXED
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Exporting (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-28 09:15 EDT by yeray alonso
Modified: 2021-10-28 10:01 EDT (History)
0 users

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


Attachments
screenshot (48.75 KB, image/png)
2021-10-28 09:15 EDT, yeray alonso
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2021-10-28 09:15:12 EDT
Created attachment 990 [details]
screenshot

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.


  Bar bar1 = new Bar(tChart1.Chart);
  bar1.FillSampleValues();
  bar1.ColorEach = true;
  bar1.XValues.DateTime = true;
  var tmp = DateTime.Today;
  for (int i = 0; i < tChart1[0].Count; i++)
  {
    bar1.XValues[i] = Utils.DateTime(tmp);
    tmp = tmp.AddHours(1);
  }

  tChart1.Draw();

  string path = @"E:\tmp\NETChartToJS";
  string fullHtml = path + @"\index.html";
  tChart1.Export.Image.JScript.Save(fullHtml);

  Process.Start(fullHtml);