refactor: add examples of chart

This commit is contained in:
vicanso 2022-02-12 11:22:08 +08:00
parent e558634dda
commit 4262b148ca
10 changed files with 796 additions and 100 deletions

View file

@ -40,6 +40,16 @@ type XAxisOption struct {
SplitNumber int
}
func NewXAxisOption(data []string, boundaryGap ...*bool) XAxisOption {
opt := XAxisOption{
Data: data,
}
if len(boundaryGap) != 0 {
opt.BoundaryGap = boundaryGap[0]
}
return opt
}
// drawXAxis draws x axis, and returns the height, range of if.
func drawXAxis(p *Draw, opt *XAxisOption, yAxisCount int) (int, *Range, error) {
if opt.Hidden {