Skip to content

fix(tooltip): add space between multiline labels in tooltip title#12186

Open
jonathan-fulton wants to merge 1 commit intochartjs:masterfrom
jonathan-fulton:fix/12049-tooltip-multiline-label-space
Open

fix(tooltip): add space between multiline labels in tooltip title#12186
jonathan-fulton wants to merge 1 commit intochartjs:masterfrom
jonathan-fulton:fix/12049-tooltip-multiline-label-space

Conversation

@jonathan-fulton
Copy link

Summary

Fixes #12049

When using array labels for multiline display (e.g., ['Yellow', 'subTitle']), the tooltip was joining them with just a comma ('Yellow,subTitle') instead of a comma and space ('Yellow, subTitle').

Changes

  • Modified createTooltipItem in plugin.tooltip.js to join array labels with ', ' instead of relying on default array-to-string conversion

Testing

Added a test case verifying that multiline array labels are properly joined with comma and space in the tooltip title.

When chart labels are arrays (for multiline display on the axis),
the tooltip title was joining them with comma only (e.g., 'Yellow,subTitle')
instead of comma and space (e.g., 'Yellow, subTitle').

This fix joins array labels with ', ' for proper formatting in tooltips.

Fixes chartjs#12049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing space between multiline label inside tooltip

1 participant