JohnCoene / echarts4r

🐳 ECharts 5 for R
http://echarts4r.john-coene.com/
Other
600 stars 81 forks source link

The width of the errorbars #241

Open barveaditya opened 3 years ago

barveaditya commented 3 years ago

This probably seems like a waste of time, but the width of the error bars really bugs me to no end, they look really ugly. Any way to fix that? Ideally they should be about 50-60% of the width. Is there an option for it to be customisable? or not have the horizontal lines in the errorbar at all? I won't mind that as well.

Screenshot 2020-11-27 at 11 22 24

On a related note - have you thought about allowing scatter points with error bars?

JohnCoene commented 3 years ago

I'd love @helgasoft's opinion here since they worked on error bars more than I have.

One possibility would be to change this line https://github.com/JohnCoene/echarts4r/blob/c30c8b5282c8fd7f34370129d10b78dea3efddc8/inst/htmlwidgets/lib/echarts-4.8.0/custom/renderers.js#L67

to something like let halfWidth = api.size([1, 0])[0] * 0.05;

image

Ideally this should be exposed to the user so it can be set as one wishes but I'm not sure how to go about it.

barveaditya commented 3 years ago

Thanks @JohnCoene . However the solution only works for ungrouped data. Does not work if the data is grouped.

helgasoft commented 3 years ago

width of the error bars - yes, it can and will be made customizable for grouped/ungrouped data. allowing scatter points with error bars - I already added a note for that in the PR, but it didn't make it to the final code.