X axis label is inconsistent for different range of duration in line chart

Hello,
I tried many ways to make the x axis value consistent with the time and font in line chart like using this.layout.xaxis[“dtick”]= “M1”
this.layout.xaxis[“tickmode”]= “auto”,
tickformat= ‘%d-%b-%y \n %H:%M’,
but nothing worked


Looking out for help here.

Hi @Swathi
Welcome to the community. Can you please share your code: a minimal reproducible example with sample data so we can reproduce this error locally?

Sure, please find the sample code details below
layout = {
“showlegend”: true,
“xaxis”: {
“showline”: true,
“showgrid”: false,
“zeroline”: false,
“automargin”: true,
“tickformat”: “%d-%b-%y \n %H:%M”,
“tickangle”: 0,
“dtick”: “M1”,
“tickmode”: “auto”,
“range”: [
“2025-03-28 03:44:59.999”,
“2025-03-28 03:45:00.001”
],
“type”: “date”,
“autorange”: true
},
“yaxis”: {
“showline”: true,
“showgrid”: true,
“automargin”: true,
“title”: {
“text”: “abc Change [%]”,
“font”: {
“size”: 10
}
}
},
“legend”: {
“orientation”: “h”,
“x”: 0,
“y”: 2
},
“displayModeBar”: false,
“margin”: {
“l”: 50,
“b”: 45,
“t”: 10,
“r”: 10,
“pad”: 4
}
};
config={
“scrollZoom”: false,
“displayModeBar”: true,
“editable”: false,
“zooming”: true,
“displaylogo”: false,
“responsive”: true
},
data=[ { “x”: , “y”: , “line”: { “dash”: “dot” }, “name”: “Trace” }, { “x”: [ “2025-03-28 03:45:00” ], “y”: [ 1 ], “line”: { “dash”: “dot” }, “name”: “Current” } ]