Skip to content

Tool Tip isn't displaying point data correctly #7839

@PaulWieland

Description

@PaulWieland

image

image

Expected Behavior

The tool tip of a data point should show the x & y values of the data point.

Current Behavior

The tool tip's x value is being take from the series index number rather than from the data point x value.

Possible Solution

When a data set uses the point format type, the tooltip has to take the x/y coordinates from the point object rather than assuming that the point's index aligns with the x axis index.

Steps to Reproduce

Create an X axis label array with a few values, e.g. labels = ['January','February','March'].

Create a data series using format: 'point' and with the data having fewer points than the x axis labels, e.g. data = [{x: 'March', y: 10}]

Context

The wrong labels are being rendered.

Environment

  • Chart.js version: 2.9.3
  • Browser name and version: Safari & Chrome
  • Link to your project:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions