Chart.js: BUG - Tooltip label without displayColors and label in Bar Charts

Created on 21 Dec 2016  Â·  4Comments  Â·  Source: chartjs/Chart.js

Expected Behavior

Setting displayColors = false without setting a label should show only the value in the tooltip label

Current Behavior

The value in the tooltip is preceded by a colon.

Steps to Reproduce

  1. Create a bar chart
  2. Set displayColors to false
  3. Do not set a label for the dataset
  4. Hover on a bar
  5. The number is preceded by a semicolon
    See an example here http://codepen.io/anon/pen/oYVQgO

Environment

  • Chart.js version: 2.4.0
  • Browser name and version: any
help wanted bug

Most helpful comment

Exactly what I did to fix this issue, but I think it should be a default behaviour.

All 4 comments

Cause of this is: https://github.com/chartjs/Chart.js/blob/master/src/core/core.tooltip.js#L71

Work-around is to set a different callback function in the config that doesn't insert the semicolon.

Exactly what I did to fix this issue, but I think it should be a default behaviour.

Great. I'm happy to look at a PR for this if you have time :)

I'm still seeing this exact issue on the latest version.

Was this page helpful?
0 / 5 - 0 ratings