Skip to content

Update Chartist and add hover line and tooltip plugins - #973

Merged
giuscris merged 2 commits into
2.xfrom
feature/chartist-hover-plugins
Nov 1, 2026
Merged

giuscris merged 2 commits into
2.xfrom
feature/chartist-hover-plugins

Conversation

@giuscris

@giuscris giuscris commented Nov 1, 2026

Copy link
Copy Markdown
Member

This pull request updates the Chartist library to version 2.2.0 and introduces a new hover interaction for charts, including a vertical hover line and tooltip support. The changes modernize how tooltips are displayed on chart points, replacing manual event handling with a plugin-based approach.

Chartist Library Upgrade:

  • Upgraded chartist from version 1.5.0 to 2.2.0 in both package.json and pnpm-lock.yaml, updating all related lockfile entries. [1] [2] [3] [4]

New Hover Line and Tooltip Plugins:

  • Added a new plugin chartist-hover-line.ts that displays a vertical line on the nearest chart point and emits custom events (hover-line:change, hover-line:leave) when the pointer moves or leaves the chart area.
  • Added a new plugin chartist-hover-tooltip.ts that listens for hover events and shows a tooltip on the highlighted point using the provided rendering logic.

Refactor of Chart Tooltip Handling:

  • Refactored statistics-chart.ts to use the new Chartist plugins for hover line and tooltip, removing the old manual tooltip logic and event listeners. Now tooltips are rendered via the plugin system, improving maintainability and consistency. [1] [2] [3]

giuscris and others added 2 commits November 1, 2026 09:37
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Replace the manual mouseover tooltip with two decoupled Chartist plugins:
`hoverLine` draws a vertical line on the point nearest to the pointer and
emits `hover-line:change` and `hover-line:leave`, `hoverTooltip` shows the
tooltip in response to them. The chart is now drawn with the `lineChart`
function and works with touch input too.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@giuscris giuscris added this to the 2.4.0 milestone Nov 1, 2026
@giuscris giuscris self-assigned this Nov 1, 2026
@giuscris
giuscris merged commit 59eb443 into 2.x Nov 1, 2026
1 check passed
@giuscris
giuscris deleted the feature/chartist-hover-plugins branch November 1, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant