Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] yLabel type in toopltipItem object #5830

Closed
monstasat opened this issue Nov 12, 2018 · 0 comments
Closed

[BUG] yLabel type in toopltipItem object #5830

monstasat opened this issue Nov 12, 2018 · 0 comments

Comments

@monstasat
Copy link

I have a line chart with numeric y axis. To implement a custom tooltip for this chart, I have attached a custom callback to tooltips section of chart options. As it mentioned in docs, this callback receives a tooltipModel object, with dataPoints object of type tooltipItem[] inside. Chartjs doc says that xLabel and yLabel fields of tooltipItem must be of type string. But in fact I have yLabel field of type number.
Here is one of the received tooltipItem object:

{ x: 29.3583984375
xLabel: undefined
y: 46.2
yLabel: 15 
}

Expected Behavior

xLabel and yLabel fields must be of type string

Current Behavior

yLabel field is of type number

Context

As I am writing OCaml bindings for Chartjs, types of object fields matter. Are there any reasons why these fields are of the same type as they are stored in a dataset or it is just a bug? At least, I think it is not good that there is some discrepancy between documentation and actual behaviour.

Sorry for not attaching a live example or code to reproduce a bug. If it is essential, I will attach it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants