Skip to content

Conversation

@Manahil-Afzal
Copy link
Contributor

@Manahil-Afzal Manahil-Afzal commented Jan 15, 2026

Description

This PR enhances the Basic Line Chart and Smoothed Line Chart examples in the echarts-examples repository by adding interactive tooltips.

Currently, the examples display static data but do not allow users to easily see the corresponding X-axis category and Y-axis value for each point.

Before

  • Basic Line Chart: [150, 230, 224, 218, 135, 147, 260]
    (Static, no tooltip interactivity)

Basic Line Chart

  • Smoothed Line Chart: [820, 932, 901, 934, 1290, 1330, 1320]
    (Static, no tooltip interactivity)

Smooth Line Chart

Added/Changes

  • Implemented a tooltip formatter to show the category (X-axis) and value (Y-axis) when hovering or clicking on a point.
  • Applied this functionality to both Basic and Smoothed Line Chart examples.
  • Updated line-simple.ts and line-smooth.ts files with the tooltip logic.
  • Added symbolSize and emphasis options to highlight points on hover.

After

  • Users can now hover over any data point on the chart and see its category and value instantly.
  • Both line charts are interactive, making them more informative for developers.

. Basic Line Chart:
After Basic Line

. Smooth Line Chart:
After Smooth Line

More Clarification

  • This PR does not modify any unrelated files; only the two line chart examples were updated.
  • The tooltip enhancement is consistent with ECharts’ best practices for chart interactivity.

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.

1 participant