Skip to content

Dates on X-axis #80

Answered by LukaOber
Aankhen asked this question in Q&A
Sep 20, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

I think this should work. It is poorly documented here and in echarts.

let mut chart = Chart::new()
    .legend(Legend::new())
    .y_axis(Axis::new().type_(AxisType::Value));

chart = chart.x_axis(Axis::new().type_(AxisType::Time));

chart = chart.series(Line::new().data(vec![
    vec!["2024/11/01T00:00:00", "30"],
    vec!["2024/11/02T00:00:00", "34"],
    vec!["2024/11/03T00:00:00", "5"],
]));

Edit: Removed unnecessary tuple data

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Aankhen
Comment options

@LukaOber
Comment options

LukaOber Oct 2, 2024
Collaborator

Answer selected by LukaOber
@Aankhen
Comment options

@LukaOber
Comment options

LukaOber Oct 3, 2024
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants