question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] labelColor when rendering an array of labels is not working

See original GitHub issue

Expected Behavior

When returning an array of objects from labelColor on tooltips.callbacks, the squares should get the colour returned from the function.

Current Behavior

When returning an array from labelColor on tooltips callbacks, all squares appear black.

Possible Solution

N/A

Steps to Reproduce (for bugs)

http://jsbin.com/xuqalax/edit?html,js,output

Context

I was trying to add thousand separators, and for that I needed to edit the label callback on tooltips. I then realized I would also need to override labelColor in order to get the previous behaviour, but it didn’t work as expected.

Environment

  • Chart.js version: 2.5.0
  • Browser name and version: Google Chrome Version 56.0.2924.87 (64-bit)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
aoifefcommented, Aug 15, 2019

I’m also experiencing this same issue, all label colours are the same even though I am specifying an array of different colours.

2reactions
rwwagner90commented, Aug 5, 2019

This is still an issue, I believe. If you return an array in the label callback, it makes multiple labels, but there is no way to define multiple colors. They all have to be the same color.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ChartJs error in displaying my array data - Stack Overflow
I have an error when I display my array with chartjs. its does not display my values ​​in the graph but its does...
Read more >
Using the labels layer - Napari
The labels layer allows you to take an array of integers and display each integer as a different random color, with the background...
Read more >
(To be removed) Display labeled volume - MATLAB - MathWorks
A labelvolshow object displays labeled volumetric data and enables you to modify the appearance of the display.
Read more >
Customising Doughnut Charts - AG Grid
Customising Doughnut Charts. This sections details how to customise doughnut charts in your applications. Doughnut Chart Option Interfaces.
Read more >
GetMetricWidgetImage: Metric Widget Structure and Syntax
One metrics array can include 1–100 metrics and expressions. ... If this is not specified, the metric is given an auto-generated label that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found