Skip to content

Commit 38372a4

Browse files
update(area-basic): highcharts — comprehensive quality review
Fix all review weaknesses: removed excessive Y-axis whitespace (min 1000→1500), ensured X-axis title visibility (increased margins), removed unnecessary plot.html output, enabled legend for series identification, reduced marker radius, added subtitle, disabled credits watermark, softened gradient fade. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 179e8d3 commit 38372a4

2 files changed

Lines changed: 36 additions & 32 deletions

File tree

plots/area-basic/implementations/highcharts.py

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
""" pyplots.ai
1+
"""pyplots.ai
22
area-basic: Basic Area Chart
33
Library: highcharts 1.10.3 | Python 3.14.2
4-
Quality: 74/100 | Created: 2025-12-23
4+
Quality: /100 | Updated: 2026-02-11
55
"""
66

77
import tempfile
@@ -31,14 +31,15 @@
3131
chart = Chart(container="container")
3232
chart.options = HighchartsOptions()
3333

34-
# Chart configuration
34+
# Chart configuration — generous bottom margin to ensure x-axis title renders fully
3535
chart.options.chart = {
3636
"type": "area",
3737
"width": 4800,
3838
"height": 2700,
3939
"backgroundColor": "#ffffff",
40-
"marginBottom": 200,
41-
"marginLeft": 200,
40+
"marginBottom": 300,
41+
"marginLeft": 220,
42+
"spacingBottom": 40,
4243
}
4344

4445
# Title
@@ -47,39 +48,58 @@
4748
"style": {"fontSize": "72px", "fontWeight": "bold"},
4849
}
4950

50-
# X-axis
51+
# Subtitle for data context
52+
chart.options.subtitle = {
53+
"text": "Daily Website Visitors Over One Month",
54+
"style": {"fontSize": "42px", "color": "#666666"},
55+
}
56+
57+
# X-axis — explicit margin and offset to prevent title clipping
5158
chart.options.x_axis = {
52-
"title": {"text": "Day of Month", "style": {"fontSize": "48px"}},
53-
"labels": {"style": {"fontSize": "36px"}},
59+
"title": {"text": "Day of Month", "style": {"fontSize": "48px"}, "margin": 30},
60+
"labels": {"style": {"fontSize": "36px"}, "y": 45},
5461
"gridLineWidth": 1,
5562
"gridLineColor": "rgba(0, 0, 0, 0.1)",
63+
"tickInterval": 1,
5664
}
5765

58-
# Y-axis — set min close to data range to avoid wasted whitespace
66+
# Y-axis — min near data floor to maximize visual resolution of the data range
5967
chart.options.y_axis = {
6068
"title": {"text": "Daily Visitors (count)", "style": {"fontSize": "48px"}},
6169
"labels": {"style": {"fontSize": "36px"}},
6270
"gridLineWidth": 1,
6371
"gridLineColor": "rgba(0, 0, 0, 0.1)",
64-
"min": 1000,
72+
"min": 1500,
73+
"startOnTick": False,
6574
}
6675

6776
# Plot options with semi-transparent fill and gradient
6877
chart.options.plot_options = {
6978
"area": {
7079
"fillColor": {
7180
"linearGradient": {"x1": 0, "y1": 0, "x2": 0, "y2": 1},
72-
"stops": [[0, "rgba(48, 105, 152, 0.5)"], [1, "rgba(48, 105, 152, 0.1)"]],
81+
"stops": [[0, "rgba(48, 105, 152, 0.5)"], [1, "rgba(48, 105, 152, 0.05)"]],
7382
},
7483
"lineWidth": 4,
75-
"marker": {"enabled": True, "radius": 8, "fillColor": "#306998"},
84+
"marker": {"enabled": True, "radius": 6, "fillColor": "#306998"},
7685
"color": "#306998",
7786
"tooltip": {"headerFormat": "<b>Day {point.x}</b><br/>", "pointFormat": "Visitors: {point.y:,.0f}"},
7887
}
7988
}
8089

81-
# Legend
82-
chart.options.legend = {"enabled": False}
90+
# Legend — enabled with styling for single series identification
91+
chart.options.legend = {
92+
"enabled": True,
93+
"itemStyle": {"fontSize": "36px", "fontWeight": "normal"},
94+
"align": "right",
95+
"verticalAlign": "top",
96+
"layout": "horizontal",
97+
"x": -40,
98+
"y": 60,
99+
}
100+
101+
# Credits off
102+
chart.options.credits = {"enabled": False}
83103

84104
# Add series
85105
series = AreaSeries()
@@ -111,22 +131,6 @@
111131
f.write(html_content)
112132
temp_path = f.name
113133

114-
# Also save HTML for interactive version
115-
with open("plot.html", "w", encoding="utf-8") as f:
116-
# For standalone HTML, use CDN link
117-
standalone_html = f"""<!DOCTYPE html>
118-
<html>
119-
<head>
120-
<meta charset="utf-8">
121-
<script src="https://code.highcharts.com/highcharts.js"></script>
122-
</head>
123-
<body style="margin:0;">
124-
<div id="container" style="width: 100%; height: 100vh;"></div>
125-
<script>{html_str}</script>
126-
</body>
127-
</html>"""
128-
f.write(standalone_html)
129-
130134
chrome_options = Options()
131135
chrome_options.add_argument("--headless")
132136
chrome_options.add_argument("--no-sandbox")

plots/area-basic/metadata/highcharts.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
library: highcharts
22
specification_id: area-basic
33
created: '2025-12-23T00:49:25Z'
4-
updated: '2026-02-11T22:27:44Z'
4+
updated: '2026-02-11T22:41:58+00:00'
55
generated_by: claude-opus-4-6
66
workflow_run: 20447991263
77
issue: 0
@@ -10,7 +10,7 @@ library_version: 1.10.3
1010
preview_url: https://storage.googleapis.com/pyplots-images/plots/area-basic/highcharts/plot.png
1111
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/area-basic/highcharts/plot_thumb.png
1212
preview_html: https://storage.googleapis.com/pyplots-images/plots/area-basic/highcharts/plot.html
13-
quality_score: 74
13+
quality_score: null
1414
impl_tags:
1515
dependencies:
1616
- selenium

0 commit comments

Comments
 (0)