Date formatting options
In Table charts and on x-axis labels, Chartio automatically formats dates into a more legible format when detected. Formatted date labels will be spaced evenly along the x-axis. In order for Chartio to recognize dates, they need to be formatted in a certain way in your query.
This formatting is automatically applied in Interactive Mode. In SQL Mode, please use the following input formats:
Date Bucket | Input Format | Default Output Format* |
---|---|---|
Second | 2014-03-01T12:01:01 | Mar 01, 2014 12:01:01 |
Minute | 2014-03-01T12:01 | Mar 01, 2014 12:01 |
Hour | 2014-03-01T12 | Mar 01, 2014 12:00 |
Day | 2014-03-01 | Mar 01, 2014 |
Week | 2014-W09 | Feb 24-Mar 2, 2014 |
Month | 2014-03 | Mar 2014 |
Quarter | 2014-Q1 | 2014 Q1 |
Year | Y2014, 2014 | 2014 |
Note: X-axis label format will vary based on the width of your chart and the number of data points. For example, in a Line chart with dates bucketed by day, the labels may be grouped by month to save space.
For more information on SQL date formatting syntax, please see the documentation specific to your database type.
Custom date formats in Table charts
For Table charts, the date format can be set in your Chart Settings, under the Columns tab.
Check out the chart settings for Table charts to learn more about the different datetime formats.
Note: It is currently not possible to customize the auto-generated date formatting on the x-axis under Columns. For chart types other than Table charts, dates on the x-axis can be formatted under the Axis tab. From there, select either Default or ISO-8601 from the Label Format dropdown.