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.

Activity

gvwilson

gvwilson commented on Mar 31, 2025

@gvwilson
Contributor

thanks for filing the issue @Swathi-ext - we are trying to keep the issues and PRs in Plotly's public repositories tidy so that we can focus on things that are most important to our community. For tech support and "how-to" questions, please post in our community forum https://community.plotly.com/. Thank you - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @gvwilson@Swathi-ext

        Issue actions

          x axis label is inconsistent for different range of duration in line chart · Issue #7397 · plotly/plotly.js