refactor: auto count the split number for x axis
This commit is contained in:
parent
3219ce521b
commit
c01f4001f1
6 changed files with 134 additions and 58 deletions
4
xaxis.go
4
xaxis.go
|
|
@ -29,6 +29,7 @@ type XAxisOption struct {
|
|||
Data []string
|
||||
Theme string
|
||||
Hidden bool
|
||||
SplitNumber int
|
||||
// TODO split number
|
||||
}
|
||||
|
||||
|
|
@ -47,11 +48,12 @@ func drawXAxis(p *Draw, opt *XAxisOption) (int, *Range, error) {
|
|||
}
|
||||
theme := NewTheme(opt.Theme)
|
||||
data := NewAxisDataListFromStringList(opt.Data)
|
||||
style := AxisStyle{
|
||||
style := AxisOption{
|
||||
BoundaryGap: opt.BoundaryGap,
|
||||
StrokeColor: theme.GetAxisStrokeColor(),
|
||||
FontColor: theme.GetAxisStrokeColor(),
|
||||
StrokeWidth: 1,
|
||||
SplitNumber: opt.SplitNumber,
|
||||
}
|
||||
|
||||
boundary := true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue