Init initializes a new chart with the specified width and height It is normally used to initialize a Chart embedded in a struct
(width float32, height float32)
| 66 | // Init initializes a new chart with the specified width and height |
| 67 | // It is normally used to initialize a Chart embedded in a struct |
| 68 | func (ch *Chart) Init(width float32, height float32) { |
| 69 | |
| 70 | ch.Panel.Initialize(ch, width, height) |
| 71 | ch.left = 40 |
| 72 | ch.bottom = 20 |
| 73 | ch.top = 10 |
| 74 | ch.firstX = 0 |
| 75 | ch.stepX = 1 |
| 76 | ch.countStepX = 1 |
| 77 | ch.minY = -10.0 |
| 78 | ch.maxY = 10.0 |
| 79 | ch.autoY = false |
| 80 | ch.formatX = "%v" |
| 81 | ch.formatY = "%v" |
| 82 | ch.fontSizeX = 14 |
| 83 | ch.fontSizeY = 14 |
| 84 | ch.Subscribe(OnResize, ch.onResize) |
| 85 | } |
| 86 | |
| 87 | // SetTitle sets the chart title text and font size. |
| 88 | // To remove the title pass an empty string |
no test coverage detected