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?
to your account
Hello! Thank you for the wrapper for echarts, things are looking great.
I noticed that when I try to plot certain X and Y values, the chart reorders the data, so that lower X values are always plotted before higher X values.
For example, if I try to plot
data.frame(x = c(20, 50, 40),
y = c(120, 200, 50)) %>%
I get the following
However, when I see a plot with the same data at the echarts site https://www.echartsjs.com/examples/en/editor.html?c=line-in-cartesian-coordinate-system you can see that the chart is different.
Basically, the chart done natively with JS follows the order of the data, while the chart done with the R wrapper reorders the data. This is confirmed by inspecting the resulting code:
> data.frame(x = c(20, 50, 40),
+ y = c(120, 200, 50)) %>%
+ e_charts(x) %>%
+ e_line(y) %>%
+ json = TRUE,
+ pretty = TRUE
"value": [20, 120]
"value": [40, 50]
"value": [50, 200]
Is there a way to override this type of behaviour? Thank you!
The text was updated successfully, but these errors were encountered:
add reorder argument to address #126
update news #126
I had not anticipated people needing to do this.
I have just added a reorder argument to the e_charts function to address this, reinstall the Github version.
x = c(20, 50, 40),
y = c(120, 200, 50)
e_charts(x, reorder = FALSE) %>%
Let me know if this works.
Sorry, something went wrong.
Perfect, it works as expected. That was a crazy quick response, thank you very much for your help.
Thank you for submitting this please don't hesitate to share any other issue you run into.
No branches or pull requests