You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using with zoom, you have to set clip: true on datalabels, otherwise the label will overlap with the yAxis
But if did this, the first and the last bar label get cut.
Because it is beyond the chart area.
The document tells me the clip is calling CanvasRenderingContext2D.clip(), so I then took a look at the source code here:
if (model.clip) {
area = model.area;
ctx.beginPath();
ctx.rect(
area.left,
area.top,
area.right - area.left,
area.bottom - area.top);
ctx.clip();
}
I guess maybe we can allow a paddingOffset to slightly extend the rect area, to let customer to adjust? like:
See this demo: https://codesandbox.io/s/chart-js-data-labels-plugin-clip-issue-mqkrgd?file=/src/App.tsx It use zoom and datalabels
When using with zoom, you have to set
clip: true
on datalabels, otherwise the label will overlap with the yAxisBut if did this, the first and the last bar label get cut.
Because it is beyond the chart area.
The document tells me the
clip
is calling CanvasRenderingContext2D.clip(), so I then took a look at the source code here:I guess maybe we can allow a paddingOffset to slightly extend the rect area, to let customer to adjust? like:
The text was updated successfully, but these errors were encountered: