I am using a d3 chart in my project, In my chart I am formatToDateAndTime
formatting my xAxis
tick to show date in particular format.
My Issue what I am seeing is my xAxis tick text is not coming fully, It's cutting from starting.
Image below show's for the first value should come 'oct 16 12:00 AM
' like this but, it's only showing '16 12:00 AM
' in ticks.
This is my code -
var xAxis = d3
.axisBottom(xScale)
.ticks(5);
const formatToDateAndTime = d3.timeFormat("%b %d %I:%M %p"); // e.g.Sep 18 02:30 PM
xAxis.tickFormat((d, index) => {
return formatToDateAndTime(d);
});
Please guide me how to fix this.