StockRange returns the minimum and maximum value on the value axis for the stock with the specified label and category.
(label string, category int)
| 73 | // StockRange returns the minimum and maximum value on the value axis |
| 74 | // for the stock with the specified label and category. |
| 75 | func (s *Sankey) StockRange(label string, category int) (min, max float64, err error) { |
| 76 | stk, ok := s.stocks[category][label] |
| 77 | if !ok { |
| 78 | return 0, 0, fmt.Errorf("plotter: sankey diagram does not contain stock with label=%s and category=%d", label, category) |
| 79 | } |
| 80 | return stk.min, stk.max, nil |
| 81 | } |
| 82 | |
| 83 | // stock represents the amount of a stock and its plotting order. |
| 84 | type stock struct { |
no outgoing calls