pablofrommars / GGNet

GG.Net Data Visualization
https://pablofrommars.github.io
MIT License
80 stars 11 forks source link

Bug: CSS should be generated culture invariant #6

Closed jan-ai closed 4 years ago

jan-ai commented 4 years ago

CSS requires numbers using dots (instead of commas). The code just uses standard number to string conversions (implicitly ToString ()) without setting any culture Information. Therefore the svgs generated do not work, when cultures are used which have numbers using commas instead of dots. E.g. style="width: 578,15" instead of corretly generating "width: 578.15"

I've done all the nessecary work on my local repository, but can't create a pull request on your project. Let me know the way in case I should share the code with your project.

pablofrommars commented 4 years ago

Hi,

Thanks for reporting. I have been working on this particular issue, the fix will be pushed shortly.

For the time being, it’s recommended to set:

CultureInfo.CurrentCulture = new CultureInfo("en-GB");

I know it’s not ideal but does the job. FYI, there is a big push being done by the blazor team to improve SVG support, hopefully this issue will be addressed.

jan-ai commented 4 years ago

As setting the CurrentCulture will also influence other input, I changed the followings:

pablofrommars commented 4 years ago

Duplicate #1