-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] add simple apache echart presentation
- Loading branch information
1 parent
557365c
commit 2bcaf9c
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
{{ $id := printf "echart-%03d" .Ordinal }} | ||
{{ $width := or .Attributes.width "100%" }} | ||
{{ $height := or .Attributes.height "600px" }} | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script> | ||
<div id={{ $id }} style="width: {{ $width }};height: {{ $height }};"></div> | ||
|
||
<script type="text/javascript"> | ||
// Initialize the echarts instance based on the prepared dom | ||
var chart = echarts.init(document.getElementById({{ $id }})); | ||
|
||
// Specify the configuration items and data for the chart | ||
{{ .Inner | safeJS }} | ||
|
||
// Display the chart using the configuration items and data just specified. | ||
chart.setOption(option); | ||
</script> | ||
|
||
|
||
{{ .Page.Store.Set "hasEchart" true }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,6 +195,10 @@ | |
|
||
<!-- DocSearch --> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" /> | ||
|
||
{{ if .Page.Store.Get "hasEchart" }} | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script> | ||
{{ end }} | ||
</head> | ||
|
||
<body> | ||
|