How to style ticks in Observable HQ?

256 Views Asked by At

Chart with code and wrong data display

I have a problem styling the x-axis of a simple line chart in Observable HQ so that it displays years. Currently, it only shows the years with decimal separators.

I have tried different styling options with plot.axisX but it did not work.

1

There are 1 best solutions below

0
Rachel Weissman-Hohler On

You can set the tick format like so:

Plot.plot({
  x: {tickFormat: ""},
  marks: [
  ...