Skip to content

Conversation

@henryjameslau
Copy link
Contributor

First attempt at customTimeAxis for economist style ticks

@broadpeter
Copy link
Contributor

Ultimately we want to allow users to switch between Economist-style and specific points (using getXAxisTicks)

@henryjameslau
Copy link
Contributor Author

henryjameslau commented Nov 13, 2025

Ultimately we want to allow users to switch between Economist-style and specific points (using getXAxisTicks)

You mean in the config? @broadpeter
I was doing it as an alternative to d3.axisBottom(x) so customTimeAxis(x) rather than using getXAxisTicks

@henryjameslau
Copy link
Contributor Author

henryjameslau commented Nov 14, 2025

OK added the option into the config, although I did an alternative where I just use getXAxisTicks to get an array to pass into .tickValues and set the tickFormat to make the labels blank and then add labels between the ticks afterwards.

Copy link
Contributor

@nrennie nrennie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong opinions on economist style axes, but whatever is decided - can you also add it to the two line-chart-sm, line chart dropdown, and two line chart with ci-area when it's ready?

Should getXAxisTicks() in the line-chart template be moved into the helpers.js file?

See also #361

@henryjameslau henryjameslau marked this pull request as draft November 21, 2025 15:06
@henryjameslau henryjameslau marked this pull request as ready for review January 2, 2026 10:37
@henryjameslau
Copy link
Contributor Author

Ready for review

@henryjameslau
Copy link
Contributor Author

image Need this for later

@henryjameslau henryjameslau marked this pull request as draft January 16, 2026 11:34
@henryjameslau henryjameslau marked this pull request as ready for review January 16, 2026 15:51
@henryjameslau
Copy link
Contributor Author

henryjameslau commented Jan 16, 2026

@nrennie @broadpeter @sam-ctrl Ready to review and merge. Column charts all work, custom starting months work. Had to put the readme in the lib folder as I didn't know where else to put it.

Copy link
Contributor

@sam-ctrl sam-ctrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh slick, I had a test and it's really nice. Technically it all looks good to me. I will leave it to others (@broadpeter) to comment on style etc. but to my layman's eyes that all looks good too.

@sam-ctrl sam-ctrl merged commit d9e861f into main Jan 21, 2026
1 check passed
@sam-ctrl sam-ctrl deleted the economist-ticks branch January 21, 2026 11:22
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.

5 participants