I want to format the x-axis of the line chart with time I am using @nivo/line react library for charts
axisBottom={{
tickValues: 3,
tickRotation: 90,
format: (values) => `${getRequiredDateFormat(values, 'MMMM-DD')}`, // using momentjs to format
legendOffset: -80,
legendPosition: 'start',
}}
Just want to display each month to appear once based on data.
CodeSandbox Link Try Here
You can create a new array of all x-axis dates and then show the date once if it appears multiple times.
Here is a working example -