echarts4r icon indicating copy to clipboard operation
echarts4r copied to clipboard

The width of the errorbars

Open barveaditya opened this issue 4 years ago • 3 comments

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?

barveaditya avatar Nov 27 '20 11:11 barveaditya

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.

JohnCoene avatar Nov 27 '20 11:11 JohnCoene

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

barveaditya avatar Nov 27 '20 15:11 barveaditya

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.

helgasoft avatar Nov 29 '20 08:11 helgasoft