MCPcopy Create free account
hub / github.com/cpmech/plotpy / options

Method options

src/barplot.rs:291–316  ·  view source on GitHub ↗

Returns options for barplot

(&self)

Source from the content-addressed store, hash-verified

289
290 /// Returns options for barplot
291 fn options(&self) -> String {
292 let mut opt = String::new();
293 if self.label != "" {
294 write!(&mut opt, ",label=r'{}'", self.label).unwrap();
295 }
296 if self.colors.len() > 0 {
297 write!(&mut opt, ",color=colors").unwrap();
298 }
299 if self.width > 0.0 {
300 write!(&mut opt, ",width={}", self.width).unwrap();
301 }
302 if self.bottom.len() > 0 {
303 write!(&mut opt, ",bottom=bottom").unwrap();
304 }
305 if self.errors.len() > 0 {
306 if self.horizontal {
307 write!(&mut opt, ",xerr=err").unwrap();
308 } else {
309 write!(&mut opt, ",yerr=err").unwrap();
310 }
311 }
312 if self.extra != "" {
313 write!(&mut opt, ",{}", self.extra).unwrap();
314 }
315 opt
316 }
317}
318
319impl GraphMaker for Barplot {

Callers 2

drawMethod · 0.45
draw_with_strMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected