Skip to content

Commit edbf734

Browse files
authored
Merge pull request #31 from andipabst/alternative-echarts-versions
[JENKNIS-60770] provide alternative echars versions
2 parents 2eee671 + 9de836e commit edbf734

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ Then you can use ECharts in your jelly files using the following snippet:
2323
```xml
2424
<st:adjunct includes="io.jenkins.plugins.echarts"/>
2525
```
26+
If you don't need all charts, you can also use one of
27+
```xml
28+
<st:adjunct includes="io.jenkins.plugins.echarts-common"/>
29+
<st:adjunct includes="io.jenkins.plugins.echarts-simple"/>
30+
```
31+
which provide smaller .js files, but also fewer charts. See the [echarts documentation](https://echarts.apache.org/en/tutorial.html#Create%20Custom%20Build%20of%20ECharts)
32+
for more information.
2633

2734
You can find several examples of Jenkins views that use ECharts in the
2835
[Warnings Next Generation plugin](https://github.com/jenkinsci/warnings-ng-plugin).
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?jelly escape-by-default='true'?>
2+
<!--
3+
Use it like <st:adjunct includes="io.jenkins.plugins.echarts-common"/>
4+
-->
5+
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
6+
7+
<j:new var="h" className="hudson.Functions" />
8+
${h.initPageVariables(context)}
9+
10+
<script type="text/javascript" src="${resURL}/plugin/echarts-api/webjars/echarts-en.common.min.js" />
11+
12+
<st:adjunct includes="io.jenkins.plugins.jquery3"/>
13+
14+
<script type="text/javascript" src="${resURL}/plugin/echarts-api/js/trend-chart.js"/>
15+
<script type="text/javascript" src="${resURL}/plugin/echarts-api/js/zoomable-trend-chart.js"/>
16+
<script type="text/javascript" src="${resURL}/plugin/echarts-api/js/pie-chart.js"/>
17+
18+
</j:jelly>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?jelly escape-by-default='true'?>
2+
<!--
3+
Use it like <st:adjunct includes="io.jenkins.plugins.echarts-simple"/>
4+
-->
5+
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
6+
7+
<j:new var="h" className="hudson.Functions" />
8+
${h.initPageVariables(context)}
9+
10+
<script type="text/javascript" src="${resURL}/plugin/echarts-api/webjars/echarts-en.simple.min.js" />
11+
12+
<st:adjunct includes="io.jenkins.plugins.jquery3"/>
13+
14+
<script type="text/javascript" src="${resURL}/plugin/echarts-api/js/trend-chart.js"/>
15+
<script type="text/javascript" src="${resURL}/plugin/echarts-api/js/zoomable-trend-chart.js"/>
16+
<script type="text/javascript" src="${resURL}/plugin/echarts-api/js/pie-chart.js"/>
17+
18+
</j:jelly>

src/main/resources/io/jenkins/plugins/echarts.jelly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Use it like <st:adjunct includes="io.jenkins.plugins.echarts"/>
77
<j:new var="h" className="hudson.Functions" />
88
${h.initPageVariables(context)}
99

10-
<script type="text/javascript" src="${resURL}/plugin/echarts-api/webjars/echarts-en.common.min.js" />
10+
<script type="text/javascript" src="${resURL}/plugin/echarts-api/webjars/echarts-en.min.js" />
1111

1212
<st:adjunct includes="io.jenkins.plugins.jquery3"/>
1313

0 commit comments

Comments
 (0)