JS Export missing labels

TeeChart for ActiveX, COM and ASP
Post Reply
Jared Cooper
Newbie
Newbie
Posts: 2
Joined: Mon Dec 02, 2013 12:00 am

JS Export missing labels

Post by Jared Cooper » Fri Jan 10, 2014 5:01 pm

Using TC Pro Ax v2013, when exporting a line chart with a date x axis, the axis labels disappear. Exporting to the HTML5/Canvas version includes the labels, but we don't want to use this as we want the interactivity (pan/zoom) the JS version allows. I've attached a ZIP file containing three sample files, all exported from the same source chart: A native .TEE file, the JS version and the Canvas version. You can see that x-axis labels (formatted dates) are missing the from JS version.

I exported these using the chart editor UI, so if there's a way to accomplish this through code, please let me know.

Otherwise, is there any other way I can export to JS and ensure that the labels are included in the output - or is this not (yet?) supported?


Thanks,

Jared
Attachments
samples.zip
(62.89 KiB) Downloaded 712 times

Yeray
Site Admin
Site Admin
Posts: 9534
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: JS Export missing labels

Post by Yeray » Mon Jan 13, 2014 3:41 pm

Hi Jared,

I think this is due to the differences between the "zero" date in VB6 and JavaScript.
If I'm not wrong, in VB6 the zero corresponds to 12/30/1899 while in Javascript the zero corresponds to 1/1/1970.
So, converting the doubles to Dates as follows isn't enough:

Code: Select all

  msecsInADay=86400000; //24*60*60*1000
  for (s=0; s<Chart1.series.count(); s++) {
    for (t=0; t<Chart1.series.items[s].count(); t++) {
	  Chart1.series.items[s].data.x[t] = new Date(Chart1.series.items[s].data.x[t]*msecsInADay);
    }
  }
Don't hesitate to let us know if you still find problems with it
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply