plotly / plotly.rs

Plotly for Rust
https://docs.rs/plotly
MIT License
1.13k stars 106 forks source link

Error: consider importing this trait #139

Closed amogado closed 1 year ago

amogado commented 1 year ago

Hello Plotly.rs team,

I am trying to use Plotly.rs and I get the following issue :

:dep plotly = {version = "0.8.3"}
extern crate plotly;
use plotly::common::Mode;
use plotly::{Plot, Layout, Scatter};
let mut plot = Plot::new();
let trace1 = Scatter::new(
    vec![-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7],
    vec![10, 15, 13, 17, 15, 18, 16, 20, 18, 22, 20],
).name("First Trace");
plot.add_trace(trace1);
plot.evcxr_display();

This occurs the error message : Error: consider importing this trait

If I get rid of the name method, all works well.

I am using :

Actually, I don't even understand the error since "name" is a impl pub function and not a trait (I think).

Thank you for your work and help.

mfreeborn commented 1 year ago

See here: https://github.com/igiagkiozis/plotly/issues/137

Please re-open if that doesn't work. Also happy to accept documentation PRs.