feat: support echart options
This commit is contained in:
parent
b934b853a9
commit
519c8a492e
8 changed files with 803 additions and 2 deletions
|
|
@ -85,6 +85,10 @@ func lineChartRender(opt lineChartOption, result *basicRenderResult) ([]markPoin
|
|||
if !series.Label.Show {
|
||||
continue
|
||||
}
|
||||
distance := series.Label.Distance
|
||||
if distance == 0 {
|
||||
distance = 5
|
||||
}
|
||||
text := NewValueLabelFormater(seriesNames, series.Label.Formatter)(i, item.Value, -1)
|
||||
labelStyle := chart.Style{
|
||||
FontColor: theme.GetTextColor(),
|
||||
|
|
@ -96,7 +100,7 @@ func lineChartRender(opt lineChartOption, result *basicRenderResult) ([]markPoin
|
|||
}
|
||||
labelStyle.GetTextOptions().WriteToRenderer(r)
|
||||
textBox := r.MeasureText(text)
|
||||
d.text(text, x-textBox.Width()>>1, y-5)
|
||||
d.text(text, x-textBox.Width()>>1, y-distance)
|
||||
}
|
||||
|
||||
dotFillColor := drawing.ColorWhite
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue