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 548 - Export to Javascript uses the local decimal separator instead of "."
Summary: Export to Javascript uses the local decimal separator instead of "."
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Export (show other bugs)
Version: 131119
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-23 06:30 EST by Max
Modified: 2014-01-24 11:30 EST (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max 2014-01-23 06:30:10 EST
1. Javascript code is written using my local (german) decimal separator, which is a comma. 

Sample for wrong code, produced using the built in chart editor's export to HTML5 javascript function): 
  Chart1.axes.bottom.labels.format.font.style="10,667px Arial";
Series Data are ok in this case. 


2. Javascript data is written using my local (german) decimal separator, which is a comma. 

Sample for wrong data, produced by built in chart editor's export series data to JSON preview function: 
{ "chart": [
  {
   "series": {
   "name":"P4_NN_ROK",
   "color":"#0000FF",
   "point": [
     { "value":165,13445, "x":38831,750775463 },
     { "value":165,1343, "x":38831,7924537037 },
     { "value":165,1346, "x":38831,8341319444 },
     { "value":165,1329, "x":38831,8758101852 },

Btw: above example used a date axis. The windows date format you are writing here is pretty useless. Do you think it might be possible to export datetime data so they are automatically recognized by TeeChart Javascript?
Comment 1 david berneda 2014-01-24 11:29:36 EST
This is now fixed.
A workaround is to set DecimalSeparator to a "." and restore it again later:

var Old :Char;

  // JSON Decimal separator is always a dot "."
  Old:=FormatSettings.DecimalSeparator;
  FormatSettings.DecimalSeparator:='.';

  try

   (...use TeeJavaScript.pas  TJavascriptExportFormat class...)

  finally
   FormatSettings.DecimalSeparator:=Old;
  end;
Comment 2 david berneda 2014-01-24 11:30:30 EST
Fixed. 

FormatSettings.DecimalSeparator is now set to "." (dot), and restored after creating the JavaScript code.