A trait that defines interaction with a data point used in a bar chart. This provides greater flexibility in using different data sources as one can simply implement this trait and be able to use that data in a bar chart.
| 2 | /// This provides greater flexibility in using different data sources as one |
| 3 | /// can simply implement this trait and be able to use that data in a bar chart. |
| 4 | pub trait BarDatum { |
| 5 | /// Return the category of the datum. |
| 6 | fn get_category(&self) -> String; |
| 7 | |
| 8 | /// Return the value of the datum. |
| 9 | fn get_value(&self) -> f32; |
| 10 | |
| 11 | /// Return the key of the datum. This is optional in a simple bar chart |
| 12 | /// (just return an empty string), but is required in a stacked bar chart |
| 13 | /// as the stacked entries are differentiated by the key. |
| 14 | fn get_key(&self) -> String; |
| 15 | } |
| 16 | |
| 17 | /// A trait that defines interaction with a data point used in a scatter/line plots. |
| 18 | pub trait PointDatum<T, U> { |
nothing calls this directly
no outgoing calls
no test coverage detected