feat: support bar chart render
This commit is contained in:
parent
8a5990fe8f
commit
b69728dd12
11 changed files with 408 additions and 50 deletions
6
yaxis.go
6
yaxis.go
|
|
@ -39,12 +39,12 @@ type YAxisOption struct {
|
|||
FontColor Color
|
||||
}
|
||||
|
||||
func (opt *YAxisOption) ToAxisPainterOption() AxisPainterOption {
|
||||
func (opt *YAxisOption) ToAxisOption() AxisOption {
|
||||
position := PositionLeft
|
||||
if opt.Position == PositionRight {
|
||||
position = PositionRight
|
||||
}
|
||||
return AxisPainterOption{
|
||||
return AxisOption{
|
||||
Theme: opt.Theme,
|
||||
Data: opt.Data,
|
||||
Position: position,
|
||||
|
|
@ -62,5 +62,5 @@ func NewLeftYAxis(p *Painter, opt YAxisOption) *axisPainter {
|
|||
p = p.Child(PainterPaddingOption(Box{
|
||||
Bottom: defaultXAxisHeight,
|
||||
}))
|
||||
return NewAxisPainter(p, opt.ToAxisPainterOption())
|
||||
return NewAxisPainter(p, opt.ToAxisOption())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue