From 8dccf50222078953bbe07cba3361fe6d98a82852 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Sun, 7 Dec 2025 20:56:23 +0000 Subject: [PATCH] fix(highcharts): improve area-basic screenshot rendering - Add explicit labels enabled for x-axis - Add tickmarkPlacement for better axis rendering - Use container element screenshot instead of full page - Adjust window size for proper rendering --- plots/highcharts/area/area-basic/default.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plots/highcharts/area/area-basic/default.py b/plots/highcharts/area/area-basic/default.py index 1ea598e60b..d963fbca57 100644 --- a/plots/highcharts/area/area-basic/default.py +++ b/plots/highcharts/area/area-basic/default.py @@ -38,9 +38,10 @@ chart.options.x_axis = { "title": {"text": "Month", "style": {"fontSize": "40px"}}, "categories": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - "labels": {"style": {"fontSize": "32px"}}, + "labels": {"style": {"fontSize": "32px"}, "enabled": True}, "gridLineWidth": 1, "gridLineColor": "rgba(0, 0, 0, 0.1)", + "tickmarkPlacement": "on", } chart.options.y_axis = { @@ -93,12 +94,16 @@ chrome_options.add_argument("--no-sandbox") chrome_options.add_argument("--disable-dev-shm-usage") chrome_options.add_argument("--disable-gpu") -chrome_options.add_argument("--window-size=4800,2700") +chrome_options.add_argument("--window-size=4800,2800") driver = webdriver.Chrome(options=chrome_options) +driver.set_window_size(4800, 2800) driver.get(f"file://{temp_path}") time.sleep(5) -driver.save_screenshot("plot.png") + +# Get the container element and screenshot it directly +container = driver.find_element("id", "container") +container.screenshot("plot.png") driver.quit() Path(temp_path).unlink()