Skip to content

[BUG] Value in Tooltip undefined when using category scale y Axis. #5708

@gravian

Description

@gravian

Expected Behavior

Tooltip should show actual dataset value.

Current Behavior

Tooltip for point on Y Axis with category scale and custom labels shows undefined instead of value.

Possible Solution

There is something wrong in category scale. We can provide not null object in config like yLabels: ['whatever'] to make it work but it looks like temporary fix.
file: scale.category.js
method: getLabelForIndex

if (data.yLabels && !isHorizontal) {
	return me.getRightValue(data.datasets[datasetIndex].data[index]);
}

Steps to Reproduce (for bugs)

https://codepen.io/anon/pen/jvraNR

Context

I'm trying to show category scale y axis in multi axis chart and have correct tooltip value.

Environment

  • Chart.js version: 2.7.2
  • Browser name and version: any

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions