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

X-range: Tooltip loses default data formatting #19362

Closed
madepiet opened this issue Jul 13, 2023 · 1 comment · Fixed by #19451
Closed

X-range: Tooltip loses default data formatting #19362

madepiet opened this issue Jul 13, 2023 · 1 comment · Fixed by #19451

Comments

@madepiet
Copy link
Contributor

Expected behaviour

After adding API-compliant properties like name the tooltip should not lose its default datatime formatting.

Actual behaviour

As you can see in the demo below, for data with a name set, the tooltip does not recognize datatime formatting, and for data without name, it formats the data correctly. It would be necessary to standardize this behavior also for the axis standard data type in the X-range series.

Live demo with steps to reproduce

https://jsfiddle.net/BlackLabel/ohxp34qt/

Product version

7.0.0

@highsoft-bot highsoft-bot added this to To do in Development-Flow via automation Jul 13, 2023
@karolkolodziej
Copy link
Contributor

Internal note:
It happens because the key is replaced by the point name. Not saying that the fix should be here, probably not ;)

/**
* Return the configuration hash needed for the data label and tooltip
* formatters.
*
* @function Highcharts.Point#getLabelConfig
*
* @return {Highcharts.PointLabelObject}
* Abstract object used in formatters and formats.
*/
public getLabelConfig(): Point.PointLabelObject {
return {
x: this.category,
y: this.y,
color: this.color,
colorIndex: this.colorIndex,
key: this.name || this.category,
series: this.series,
point: this as any,
percentage: this.percentage,
total: this.total || (this as any).stackTotal
};
}

As a workaround, you can use a custom formatter.

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

Successfully merging a pull request may close this issue.

3 participants