Skip to content

x axis label is inconsistent for different range of duration in line chart #7397

Open
@Swathi-ext

Description

@Swathi-ext

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, range is picked dynamically.
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": "X1 Leakage Current" } ]

Image ,

Image

Looking out for help here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions