charts.gno
1.26 Kb · 51 lines
1package charts
2
3func Render(path string) string {
4 // Handle subroutes for specific chart types
5 switch path {
6 case "piechart":
7 return RenderPieChart()
8 case "gauge":
9 return RenderGauge()
10 default:
11 return RenderMainDocs()
12 }
13}
14
15// RenderMainDocs renders the main charts documentation page
16func RenderMainDocs() string {
17 // Generate live examples
18 pieChartExample := RenderPieChartExample()
19 gaugeExample := RenderGaugeExample()
20
21 return `
22# Chart Packages Documentation
23
24## Available Packages
25
26- **[Piechart](/p/samcrew/piechart)** - SVG Pie Charts
27 - [View All Examples](/r/docs/charts:piechart) - Detailed documentation with multiple examples
28- **[Gauge](/p/samcrew/gauge)** - SVG Gauge Charts
29 - [View All Examples](/r/docs/charts:gauge) - Detailed documentation with multiple examples
30
31## Examples
32
33### [Piechart](/p/samcrew/piechart) - SVG Pie Charts
34Generate pie charts with label as SVG images .
35
36` + pieChartExample + `
37
38[→ View all Piechart examples](/r/docs/charts:piechart)
39
40### [Gauge](/p/samcrew/gauge) - SVG Gauge Charts
41Generate progress bars and gauges as SVG images with customizable styling and labels.
42
43` + gaugeExample + `
44
45[→ View all Gauge examples](/r/docs/charts:gauge)
46
47---
48
49*For complete API documentation, visit the individual package pages.*
50`
51}