Skip to content

X-range: Tooltip loses default data formatting #19362

Closed

Description

@madepiet

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

Activity

  1. karolkolodziej commented on Jul 14, 2023

    @karolkolodziej
    Member

    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.

  2. self-assigned this
    on Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions