Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add labels plugin #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add labels plugin #78

wants to merge 1 commit into from

Conversation

noraj
Copy link
Contributor

@noraj noraj commented Mar 18, 2024

Awesome Contribution Checklist:

  • I have read, and re-read the Contributing Guidelines
  • I have searched to ensure the suggested item doesn't exist on this list
  • This PR contains only one item

Please Describe Your Addition

An (now old) plugin I used to add labels on my pie charts.

@etimberg etimberg requested a review from kurkle March 19, 2024 00:12
Copy link
Collaborator

@LeeLenaleee LeeLenaleee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a good idea to add plugins that only work on outdated versions of chart.js.

Chart.js version 2 is old and if the plugin does not support newer versions it's likely it won't be maintained and its use for new users is verry limited.

They are then better off using the data labels plugin that is already listed

@noraj
Copy link
Contributor Author

noraj commented Jun 4, 2024

Chart.js version 2 is old and if the plugin does not support newer versions it's likely it won't be maintained and its use for new users is verry limited.

They are then better off using the data labels plugin that is already listed

I disagree. I use this plugin for https://noraj.github.io/XSS-classification-model/ and that's the only label plugin that works well with arc labels.

I have been stuck with Chart.js 2.9.1 because this is the only plugin working for this use case.

https://github.com/noraj/XSS-classification-model/blob/46e072b6dce5270a8e0f2508cec4479dcc6bb45e/docs/index.html#L10C3-L11

I have spent hours trying to upgrade to Chat.js 4, but the issue is not Chat.js but the replacement plugin chartjs-plugin-datalabels doesn't behave properly for arcs. So rather than ChartJS 4 and ugly labels I preferred to stick to ChartJS 2 and emn178/chartjs-plugin-labels waiting for a better plugin working with newer versions of ChartJS.

https://github.com/noraj/XSS-classification-model/blob/0125eb01aead52c26a68ff6d3f56bf7868f01cd1/docs/index.html#L10-L11

So I think this plugin is worth being listed since it supports unique feature not working for other labels plugins.

@stockiNail
Copy link
Contributor

Hi guys, let me jump in this thread, if I may.

In principal, I agree with @LeeLenaleee . Doesn't make much sense to publish now a plugin which is clearly unmaintained and not complaint with last 2 major versions of Chart.js.

@noraj I know what you meant. In fact, in my library where I'm wrapping Chart.js, the lib is providing both datalabels and labels plugins.

But my lib is based currently on Chart.js 4.4.x and the labels plugin is not working with that. And then I have decided, several years ago, when the lib wrapped Chart.js 3, to change the plugin adapting it to new Chart.js version.

I didn't create a fork to new repo because I don't have time to maintain it for JS guys, currently the adapted plugin is working with CHart.js 4.4.x.

Here you can take/see the code. The code has been a bit updated to better integrate the J2CL/GWT lib (mainly for events) but you can change it as you want.: https://github.com/pepstock-org/Charba/blob/master/src/org/pepstock/charba/client/resources/js/chartjs-plugin-labels.js

Feel free to create a repo and maintain it if you want.

And here the doc (even if it is for java developers) but you can see the options: https://pepstock-org.github.io/Charba-Wiki/docs/extensions/Labels#options

I hope it can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants