Evenly Spaced Date Axis
Note: this demo uses CategoryDateAxis which is now deprecated in favor of more advanced GaplessDateAxis. Checkout the No-gap Date Axis demo to see GaplessDateAxis in action.
Sometimes you have date-based data with gaps in it. For example, you may have trading data from an exchange that doesn’t work on the weekends. In cases like this, you may not want to have a gap in your chart on those days or for a line chart to stretch over the empty days. amCharts has a solution for this issue.
Key implementation details
We use CategoryDateAxis to solve the issue of “empty” days. Note: you should use GaplessDateAxis in your newly created charts as it is a more powerful implementation of the same concept.
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 ~200 data points on a date axis that spaces dates evenly, eliminating gaps where weekend dates are missing. Include horizontal panning, mouse-wheel zoom on the X-axis, XY cursor, tooltips, horizontal scrollbar, and entrance animation. Use amCharts 5 library.
Demo source