Skip to content

Tooltips with mode:'label' don't work for radar charts #2023

@timcroydon

Description

@timcroydon

Using latest v2.0-dev branch (d31db87) and following config:

var chart = new Chart(ctx, {
  data: data,
  type: 'radar',
  options: {
    tooltips: {
      mode: 'label'
    }
  }
})

I get following error when tooltip should be displayed:

Uncaught TypeError: Cannot read property 'getPixelForDecimal' of undefined

This is at https://github.com/nnnick/Chart.js/blob/d31db871158685047c2fb1b0d9323e8191e6eddf/src/core/core.tooltip.js#L268

It appears to be because it's attempting to use the ._yScale property, which does not exist. There are checks elsewhere in the method to handle this for polar/radar charts but they're not applied for this line.

(Will try and have a closer look if I get a chance)

Codepen demo here: http://codepen.io/timcroydon/pen/RrOKdq

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions