The shape of the plot. Default is `Shape::Lines`, but also includes `Shape::Bars` and `Shape::Steps`.
(
steps: bool,
bars: bool,
points: bool,
call: &EvaluatedCall,
v: &'a [(f32, f32)],
)
| 99 | /// The shape of the plot. Default is `Shape::Lines`, |
| 100 | /// but also includes `Shape::Bars` and `Shape::Steps`. |
| 101 | fn chart_shape<'a>( |
| 102 | steps: bool, |
| 103 | bars: bool, |
| 104 | points: bool, |
| 105 | call: &EvaluatedCall, |
| 106 | v: &'a [(f32, f32)], |
| 107 | ) -> Result<Shape<'a>, LabeledError> { |
| 108 | match (steps, bars, points) { |
| 109 | (true, false, false) => Ok(Shape::Steps(v)), |
| 110 | (false, true, false) => Ok(Shape::Bars(v)), |
| 111 | (false, false, true) => Ok(Shape::Points(v)), |
| 112 | (false, false, false) => Ok(Shape::Lines(v)), |
| 113 | _ => Err(LabeledError::new("Shape must be either steps or bars or points, not more than one. Check your flags!").with_label("Chart shape error", call.head)), |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | /// Check the chart shape is Okay. If not returns an error. |
| 118 | fn check_chart_shape<'a>( |
no outgoing calls
no test coverage detected