go-echarts / snapshot-chromedp

⚔️ The extension for render image in go-echarts.
MIT License
12 stars 1 forks source link

Can not render image from manually output stream bytes content. #15

Closed hw524926 closed 1 month ago

hw524926 commented 1 month ago

barTitleChart := DysSafetyAssessmentService.PieTitle(dangerMap, title) // barTooltipChart := barTooltip() barTitleChartBuf := new(bytes.Buffer) err := barTitleChart.Render(barTitleChartBuf) if err != nil { return err } err = render.MakeChartSnapshot(barTitleChartBuf.Bytes(), filePath) if err != nil { return err } return nil

Koooooo-7 commented 1 month ago

Hi @hw524926 , you could have a try like this:

// I suppose it is your bar chat
barTooltipChart := barTooltip()
render.MakeChartSnapshot(barTooltipChart.RenderContent(), "my-chart.png")