Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A negative number with space is treated as text in data module. #19017

Closed
ddragula opened this issue May 17, 2023 · 2 comments · Fixed by #19032
Closed

A negative number with space is treated as text in data module. #19017

ddragula opened this issue May 17, 2023 · 2 comments · Fixed by #19032

Comments

@ddragula
Copy link
Member

Expected behaviour

Text describing a number containing a space as a thousand separator should be treated by the data module as a number regardless of whether it is positive or negative.

Actual behaviour

Text describing a number containing a space as a thousand separator is not treated by the data module as a number when it is negative.

Live demo with steps to reproduce

https://jsfiddle.net/BlackLabel/9rh4uz2v/

Product version

Highcharts v11.0.1

Workaround

https://jsfiddle.net/BlackLabel/v5ndkfgh/

@AmoghAnantha
Copy link

Hi Vazonik,
#19017:
You can use beforeParse callback function now,
Solution : https://jsfiddle.net/tse1zyu6/3/

beforeParse: Highcharts.DataBeforeParseCallbackFunctionSince 6.1.0
A callback function to modify the CSV before parsing it. Return the modified string.

Defaults to undefined.

Try it
Modify CSV before parse

@ddragula
Copy link
Member Author

Hi @AmoghAnantha, thanks for the suggestion. However, beforeParse works only for CSV, and the problem is general in the data module, e.g. for tables:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants