Manipulate chart data with mouse
Click and move mouse anywhere on plot area to change the graph.
Key implementation details
We setup pointer event handlers and on globalpointermove event handler check whether the user is dragging a graph’s point and set its value according to the pointer coordinates converted to value with the positionToValue() method.
Related tutorials
Build this chart with AI
The prompt below can be used to build this chart with AI. For best coding results, use the most advanced AI models, like Claude Opus 4.6 and GPT-5.3-Codex. For more info and tips, check out amCharts AI docs.
Create a line chart with 40 daily data points where users can click and drag data points to modify values in real time. Show white circular markers with a resize cursor on hover. Display instructional text on the plot area. Include an XY cursor, horizontal scrollbar, tooltips, minor grid lines, and entrance animation. Use amCharts 5 library.
Demo source