tick-values
This example demonstrates how to customize tick placement on a D3 time scale axis to avoid unwanted adjacent date labels at year boundaries. The chart uses an SVG renderer with D3 v3’s `d3.svg.axis` and `d3.time.scale`, filtering daily ticks from `d3.time.days` to show every other day. A custom `tickValues` array selects even-indexed dates, while the `is_problematic` function colors tick labels red for the 31st and 1st of the month, highlighting the end-of-year gap issue. The data is hardcoded ISO date strings, and the rendering relies on D3’s native SVG text and line elements.
AI-generated descriptionIs there a way to prevent the two subsequent odd-numbered days at the end of each year from generating adjacent ticks? In this case I would prefer a tick at Dec 29, Dec 31, Jan 2, Jan 4, etc.