refactor: add examples of chart
This commit is contained in:
parent
e558634dda
commit
4262b148ca
10 changed files with 796 additions and 100 deletions
11
legend.go
11
legend.go
|
|
@ -49,6 +49,17 @@ type LegendOption struct {
|
|||
// The layout orientation of legend, it can be horizontal or vertical, default is horizontal.
|
||||
Orient string
|
||||
}
|
||||
|
||||
func NewLegendOption(data []string, position ...string) LegendOption {
|
||||
opt := LegendOption{
|
||||
Data: data,
|
||||
}
|
||||
if len(position) != 0 {
|
||||
opt.Left = position[0]
|
||||
}
|
||||
return opt
|
||||
}
|
||||
|
||||
type legend struct {
|
||||
d *Draw
|
||||
opt *LegendOption
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue