feat: support bar chart render
This commit is contained in:
parent
8a5990fe8f
commit
b69728dd12
11 changed files with 408 additions and 50 deletions
6
xaxis.go
6
xaxis.go
|
|
@ -62,12 +62,12 @@ func NewXAxisOption(data []string, boundaryGap ...*bool) XAxisOption {
|
|||
return opt
|
||||
}
|
||||
|
||||
func (opt *XAxisOption) ToAxisPainterOption() AxisPainterOption {
|
||||
func (opt *XAxisOption) ToAxisOption() AxisOption {
|
||||
position := PositionBottom
|
||||
if opt.Position == PositionTop {
|
||||
position = PositionTop
|
||||
}
|
||||
return AxisPainterOption{
|
||||
return AxisOption{
|
||||
Theme: opt.Theme,
|
||||
Data: opt.Data,
|
||||
BoundaryGap: opt.BoundaryGap,
|
||||
|
|
@ -84,5 +84,5 @@ func NewBottomXAxis(p *Painter, opt XAxisOption) *axisPainter {
|
|||
p = p.Child(PainterPaddingOption(Box{
|
||||
Top: p.Height() - defaultXAxisHeight,
|
||||
}))
|
||||
return NewAxisPainter(p, opt.ToAxisPainterOption())
|
||||
return NewAxisPainter(p, opt.ToAxisOption())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue