latuannetnam / grafana-dashboard-screenshot

Screenshot grafana dashboard to PNG, PDF vv.
Mozilla Public License 2.0
0 stars 0 forks source link

Capture entire page #1

Open mehrdad2000 opened 9 months ago

mehrdad2000 commented 9 months ago

Hi I have grafana dashboard contain 4 columns panel, 10 rows panel, when i run grafana-dashboard-screenshot it only capture top 5 rows!

try to increase these parameters but neither work:

chromedp.WindowSize(1920, 4000), chromedp.EmulateViewport(1920, 1080), WithPaperWidth(16.5). WithPaperHeight(23.4). WithPageRanges("1-2").

chromedp.FullScreenshot(&buf, 90), runtime.Evaluate(window.scrollTo(0,document.body.scrollHeight);).Do(ctx)

any idea? Thanks

latuannetnam commented 9 months ago

Hi, It appears that there is an issue with Grafana's dynamic content mechanism, causing Chrome to be unable to print the entire dashboard content, especially when dealing with multiple pages. Despite trying various settings, none of them have resolved the problem.

mehrdad2000 commented 9 months ago

@latuannetnam is there any way to fix this?

latuannetnam commented 9 months ago

I have found solution from this repo: https://github.com/kartik468/grafana-generate-pdf-nodejs