chartjs / chartjs/chartjs-plugin-datalabels

Alignment and offset aren't enough for label positioning

Open
#419 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
920
Forks
507
PR merge metrics
No merged PRs in 30d

Description

I have a challange where a data point is on the top right of the graph. I need to prevent the label from cutting off with 2 challenges:

1. Multiple lines in the label so I need to offset the vertical position to stop it clipping the top
2. Wide label so I need to offset the horizontal position to stop it clipping the right

I can do 1. but not combined with 2.

Especially if the dynamic data is a tall wide line, I can have a large offset at 240degrees to solve the horizontal clipping, but then the top of the label is too far away from the point.

![image](https://github.com/user-attachments/assets/9a70f207-3097-4cca-a40f-42f02af27b56)

Ideally we'd have an offset top,right,left,bottom to have more flexibility.

Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.