Chart.js: displayColors- add margin to tooltip label color box

Created on 22 May 2018  路  3Comments  路  Source: chartjs/Chart.js


Is there a way to add margin to the tooltip label color boxes (displayColors)? Currently I feel the box is too close to the label text and would like to push it away some (set either in pixels, ems, or rems).

Expected Behavior


Ability to add margin to any side of the label color boxes

Current Behavior



No found way to do this

Possible Solution



Control margins similar to the tooltip title, etc.

Environment

  • Chart.js version: 2.7.2
  • Browser name and version: Chrome 66, MacOs
enhancement

Most helpful comment

Any movement on this?

All 3 comments

This isn't currently possible

Any movement on this?

I used this in options, tooltips:

        label: function(tooltipItem, data) {
          const label = data.datasets[tooltipItem.datasetIndex].label || ''
          const value = tooltipItem.value
          return `  ${label} ${value}`
        },
Was this page helpful?
0 / 5 - 0 ratings

Related issues

nanospeck picture nanospeck  路  3Comments

SylarRuby picture SylarRuby  路  3Comments

benmccann picture benmccann  路  3Comments

gabrieldesouza picture gabrieldesouza  路  3Comments

joebirkin picture joebirkin  路  3Comments