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

Datalabels suffix with different styling #334

Open
madsh93 opened this issue Aug 23, 2022 · 1 comment
Open

Datalabels suffix with different styling #334

madsh93 opened this issue Aug 23, 2022 · 1 comment

Comments

@madsh93
Copy link

madsh93 commented Aug 23, 2022

Hi

I want to end up with a result like this:
CleanShot 2022-08-23 at 09 08 15

Using:

anchor: 'end',
align: 'top'

And then to add the suffix I can use the formatter

formatter: (value, ctx) => {
  const label = ctx.chart.data.labels[ctx.dataIndex] + '  kr./år'
}

Great. So far so good. Here is where I run in to trouble. How do I style the suffix differently?

Creating multiple labels, makes styling possible, but it makes it difficult/impossible to center the label correctly.

Do you have any tips?

@johnzzon
Copy link

I have a similar usecase and haven't found a solution. Would love to have support for this.

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

No branches or pull requests

2 participants