Data Labels overlaps with the Legends
Make sure these boxes are checked before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if any
- [x] I have reproduced the issue with at least the latest released version of superset
- [x] I have checked the issue tracker for the same issue and I haven't found one similar
Hi, the bar values in the stacked bar charts of time series bar chart overlaps with the legends . I know i can fix this by providing the y-axis bounds , but the issue is that the data for the dashboards are loaded and viewed on a daily basis where , if i provide the time bound to be 1 Million and if the end user sees the previous day data which is 10k , then the stacked bar is hardly visible as the y-axis scale is fixed to 1 million .
It would be helpfull if there is a default spacing between the legends and bar values
Superset version
20.4
Expected results
I need the bar values to be visible clearly and should not overlap with the legends . something like this , here the bar size is small so it is visible clearly .

Actual results
The Values in the stacked bar overlaps with the legends .

Steps to reproduce
create a stacked bar chart in the visualization time series - bar chart with bar values and legends options in the chart option being checked .
@mistercrunch , @xrmx Is there anyway to fix this ?
There's always a way. Somehow the Values feature (which is a community-contributed hack on top of nvd3) should call for more top margin.
@mistercrunch we can have the legends to have a bottom margin , g.nv-legendWrap.nvd3-svg this is the class provided in legend but unable to do the styling .
Added the below code in nvd3_vis.js , this fixed the issue .
if ('showLegend' in chart && typeof fd.show_legend !== 'undefined') {
if (width < BREAKPOINTS.small && vizType !== 'pie') {
chart.showLegend(false);
} else {
chart.showLegend(fd.show_legend);
chart.legend.margin({top: 5, right:30, left:80, bottom: 30});
}
}
@shyam2794 the issues closes when it's fixed in master, not on your fork... please send a PR
Fixed by #6145
https://github.com/apache/superset/issues/8480#issuecomment-783968579