Skip to content

Commit 6571a9f

Browse files
feat(highcharts): implement area-basic (#468)
## Summary Implements `area-basic` for **highcharts** library. **Parent Issue:** #201 **Sub-Issue:** #428 **Base Branch:** `plot/area-basic` **Attempt:** 1/3 ## Implementation - `plots/highcharts/area/area-basic/default.py` ## Features - Basic area chart with monthly sales data - Python Blue (#306998) color scheme following style guide - 4800x2700 px output size - Proper axis labels with readable font sizes - Subtle grid (0.1 opacity) - Markers on data points - 50% fill opacity for area Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
1 parent bfeebe5 commit 6571a9f

1 file changed

Lines changed: 23 additions & 18 deletions

File tree

plots/highcharts/area/area-basic/default.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,50 +15,55 @@
1515
from selenium.webdriver.chrome.options import Options
1616

1717

18-
# Data
19-
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
20-
sales = [100, 150, 130, 180, 200, 220, 195, 240, 260, 230, 270, 310]
18+
# Data - Monthly sales example
19+
sales = [100, 150, 130, 180, 200, 220, 195, 240, 280, 310, 290, 350]
2120

2221
# Create chart
2322
chart = Chart(container="container")
2423
chart.options = HighchartsOptions()
2524

2625
# Chart configuration
27-
chart.options.chart = {"type": "area", "width": 4800, "height": 2700, "backgroundColor": "#ffffff"}
26+
chart.options.chart = {
27+
"type": "area",
28+
"width": 4800,
29+
"height": 2700,
30+
"backgroundColor": "#ffffff",
31+
"style": {"fontFamily": "Arial, sans-serif"},
32+
}
2833

2934
# Title
30-
chart.options.title = {"text": "Monthly Sales Overview", "style": {"fontSize": "48px"}}
35+
chart.options.title = {"text": "Monthly Sales Trend", "style": {"fontSize": "48px"}}
3136

3237
# Axes
3338
chart.options.x_axis = {
34-
"categories": months,
35-
"title": {"text": "Month", "style": {"fontSize": "36px"}},
36-
"labels": {"style": {"fontSize": "28px"}},
39+
"title": {"text": "Month", "style": {"fontSize": "40px"}},
40+
"categories": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
41+
"labels": {"style": {"fontSize": "32px"}},
42+
"gridLineWidth": 1,
43+
"gridLineColor": "rgba(0, 0, 0, 0.1)",
3744
}
3845

3946
chart.options.y_axis = {
40-
"title": {"text": "Sales ($)", "style": {"fontSize": "36px"}},
41-
"labels": {"style": {"fontSize": "28px"}},
42-
"gridLineColor": "#e0e0e0",
47+
"title": {"text": "Sales ($)", "style": {"fontSize": "40px"}},
48+
"labels": {"style": {"fontSize": "32px"}},
4349
"gridLineWidth": 1,
50+
"gridLineColor": "rgba(0, 0, 0, 0.1)",
4451
}
4552

46-
# Add series
53+
# Legend
54+
chart.options.legend = {"enabled": False}
55+
56+
# Create area series
4757
series = AreaSeries()
4858
series.data = sales
4959
series.name = "Sales"
5060
series.color = "#306998"
5161
series.fill_opacity = 0.5
5262
series.line_width = 4
63+
series.marker = {"enabled": True, "radius": 6, "fillColor": "#306998", "lineWidth": 2, "lineColor": "#ffffff"}
5364

5465
chart.add_series(series)
5566

56-
# Legend
57-
chart.options.legend = {"enabled": False}
58-
59-
# Credits
60-
chart.options.credits = {"enabled": False}
61-
6267
# Download Highcharts JS
6368
highcharts_url = "https://code.highcharts.com/highcharts.js"
6469
with urllib.request.urlopen(highcharts_url, timeout=30) as response:

0 commit comments

Comments
 (0)