obsidian-tracker icon indicating copy to clipboard operation
obsidian-tracker copied to clipboard

Bar Chart Overflows X-axis Limits

Open lucas-fern opened this issue 1 year ago • 3 comments

I'd be surprised if others haven't noticed this, but I couldn't find an existing issue for it.

I'm finding that bar charts (especially when they have multiple features in the dataset) get cropped at the min and max values on the X-axis. Here is an example from the documentation:

image

In the example, we can see that there should be 6 features for each date, however the left-most and right-most dates show only 3 bars since the remaining 3 fall outside of the X-axis limits.

This is also noticeable in simpler examples, even when there is only 1 bar the bars on the limits are half the width of the others.

I suggest that this could be fixed by extending the X-axis so that the first and last dates are offset from the extreme ends of the chart. If there are N observations on the X-axis, it seems possible to fix this by dividing the horizontal axis into N+1 sections and placing each tick at the halfway point between each section boundary.

Hopefully this is a relatively simple fix. Cheers!

lucas-fern avatar Jun 26 '23 15:06 lucas-fern

To be more specific, this is cutting off half of the bars in question in a bar chart. Regardless of whether or not there are multiple values per interval in the x axis Here is a single x value bar chart that demonstrates this behavior image

Bankoga avatar Jul 05 '23 22:07 Bankoga

I have the same problem and I have to make "tricky" stuff to display correctly

JuanDiegoBarrado avatar Aug 20 '23 11:08 JuanDiegoBarrado

@JuanDiegoBarrado What is this tricky stuff you are applying? I'm having this same problem.

sllide avatar Nov 26 '23 09:11 sllide