MCPcopy Create free account
hub / github.com/alceal/plotlars / timeseriesplot_example

Function timeseriesplot_example

crates/plotlars/examples/plotly_faceting.rs:533–558  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

531}
532
533fn timeseriesplot_example() {
534 let dataset = CsvReader::new("data/financial_timeseries.csv")
535 .finish()
536 .unwrap();
537
538 let facet_config = FacetConfig::new()
539 .highlight_facet(true)
540 .unhighlighted_color(Rgb(220, 220, 220));
541
542 TimeSeriesPlot::builder()
543 .data(&dataset)
544 .x("date")
545 .y("revenue")
546 .additional_series(vec!["costs"])
547 .facet("region")
548 .facet_config(&facet_config)
549 .plot_title(Text::from("Regional Financial Metrics"))
550 .x_title("Month")
551 .y_title("Amount ($)")
552 .legend_title("Metric")
553 .width(2.0)
554 .colors(vec![Rgb(255, 105, 180), Rgb(30, 144, 255)])
555 .lines(vec![Line::Solid, Line::Dash])
556 .build()
557 .plot();
558}
559
560fn surfaceplot_example() {
561 let n: usize = 50;

Callers 1

mainFunction · 0.85

Calls 8

RgbClass · 0.85
unhighlighted_colorMethod · 0.80
highlight_facetMethod · 0.80
finishMethod · 0.45
plotMethod · 0.45
widthMethod · 0.45
yMethod · 0.45
xMethod · 0.45

Tested by

no test coverage detected