rerun icon indicating copy to clipboard operation
rerun copied to clipboard

Allow to specify boundaries for BarChart

Open roym899 opened this issue 1 year ago • 1 comments

BarChart currently only supports discrete equal size bins starting with 0. It would be nice to support arbitrary x boundaries and hence bars of varying width.

roym899 avatar Jan 09 '24 18:01 roym899

Also interested in that feature (defining the X range to increase flexibility and specifying bar widths). Any progress towards that goal?

I found a (very limited) workaround to map each Y to a specific X value: following the documentation it says "x values will be the indices of the array, and the bar heights will be the provided values"; thus, you can create an empty array with as many positions as needed to encompass maximum positive X (e.g. 100 long array), all elements initialized to zero, and then set those elements (array[50] = 10, array[55] = 20). That way you can map X-Y (only works for positive X and would require very large unused space of memory if X values go too high).

PS: great job with rerun, looks pretty interesting and useful.

juanma-rm avatar Nov 20 '24 15:11 juanma-rm

this got fixed in 0.25 using using the abscissa component, see https://rerun.io/docs/reference/types/archetypes/bar_chart

Wumpf avatar Sep 18 '25 07:09 Wumpf