defaults sets defaults if unset values are present.
()
| 80 | |
| 81 | // defaults sets defaults if unset values are present. |
| 82 | func (po *PlotOptions) defaults() { |
| 83 | if po.LineWidth == 0 { |
| 84 | po.LineWidth = 1 |
| 85 | po.Lines = true |
| 86 | po.Points = false |
| 87 | po.PointSize = 3 |
| 88 | po.BarWidth = .8 |
| 89 | po.LegendPosition.Defaults() |
| 90 | } |
| 91 | if po.Scale == 0 { |
| 92 | po.Scale = 1 |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | // fromMeta sets plot options from meta data. |
| 97 | func (po *PlotOptions) fromMeta(dt *table.Table) { |