CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

TIWCGJQPlot and the Decimal Symbol

by XenoG » 07 Sep 2018 20:31

Hi, I'm having problems with one of my TIWCGJQPlot charts. When I change Windows to French locale, the Decimal Symbol is changed from a full-stop (period) to a comma. This causes one of my TIWCGJQPlot charts to break. All the other TIWCGJQPlot charts then break due to the first one breaking. All charts are shown completely blank. If I change the Decimal Separator back to a full-stop, everything works perfectly.

Do you have any ideas where I should look to find the problem? There are no decimal values in the JSON that I apply to the JQPlotData member.

Thanks in advance.

Richard
XenoG
 
Posts: 36
Joined: 15 Nov 2016 15:04

by Alexander Bulei » 10 Sep 2018 10:49

Hi XenoG,

Please send us the simple testcase. TIA

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by XenoG » 10 Sep 2018 20:07

Hi Alexander,

I built a test example to send to you, but whilst making the test example I discovered where the problem is.

There is a property of TIWCGJQPlotOptionsSeriesDefaults called FillAlpha. I had assumed that this property was a float/double, but I now know it is a UnicodeString.

I was applying a value of 50% to the FillAlpha using the following C++ code

jqSeries->FillAlpha = 0.5;

On servers that use the full-stop (period) as the decimal separator, this code works fine. On servers that use a comma as the decimal separator the results are catastrophic. Not only does the relevant chart go blank, but all other charts on the page also go blank.

I assume that the compiler is converting my float (0.5) into a UnicodeString ("0.5") at compile-time, which is invalid on French servers.

I found a simple way round the problem. I get the program to convert from float to UnicodeString at run-time by using

jqSeries->FillAlpha = 1/2;

This ensures that the cast to UnicodeString is done with the correct decimal separator for the server that the software is running on.

I'm not sure why the FillAlpha property is a UnicodeString as there would not be a string that could be applied at compile-time that would be valid on English and French servers. The property ShadowAlpha in the same class is a double, which seems more sensible.

Best regards,

Richard
XenoG
 
Posts: 36
Joined: 15 Nov 2016 15:04

by Alexander Bulei » 12 Sep 2018 18:16

Hi XenoG,

I'm glad that you've resolved your problem.
Relatively to the property type, well, maybe you're right, but in original documentation it was identified as string, and now I can't change it.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by XenoG » 12 Sep 2018 20:00

Hi Alexander,

Thanks for looking into this and I understand that there's nothing you can do if the JQPlot documentation specifies a string. Hopefully Google will help anyone else with a similar problem find this solution.

Best regards,

Richard
XenoG
 
Posts: 36
Joined: 15 Nov 2016 15:04


Return to JQPlot

cron

Who is online

Users browsing this forum: No registered users and 3 guests

Contact Us.