添加报表插件及示例

master
RuoYi 5 years ago committed by Limy
parent 23aa87e5bf
commit 3135123704

@ -0,0 +1,53 @@
package com.ruoyi.web.controller.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
/**
*
*
* @author ruoyi
*/
@Controller
@RequestMapping("/demo/report")
public class DemoReportController
{
private String prefix = "demo/report";
/**
* ECharts
*/
@GetMapping("/echarts")
public String echarts()
{
return prefix + "/echarts";
}
/**
*
*/
@GetMapping("/peity")
public String peity()
{
return prefix + "/peity";
}
/**
* 线
*/
@GetMapping("/sparkline")
public String sparkline()
{
return prefix + "/sparkline";
}
/**
*
*/
@GetMapping("/metrics")
public String metrics()
{
return prefix + "/metrics";
}
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,13 @@
// Peity jQuery plugin version 2.0.3
// (c) 2014 Ben Pickles
//
// http://benpickles.github.io/peity
//
// Released under MIT license.
(function(e,q,h){var o=function(a,b){var c=q.createElementNS("http://www.w3.org/2000/svg",a);e.each(b,function(a,b){c.setAttribute(a,b)});return c},t="createElementNS"in q&&o("svg",{}).createSVGRect,r=1/(window.devicePixelRatio||1),j=e.fn.peity=function(a,b){t&&this.each(function(){var c=e(this),d=c.data("peity");if(d)a&&(d.type=a),e.extend(d.opts,b);else{var f=j.defaults[a],g={};e.each(c.data(),function(a,b){a in f&&(g[a]=b)});var h=e.extend({},f,g,b),d=new s(c,a,h);c.change(function(){d.draw()}).data("peity",
d)}d.draw()});return this},s=function(a,b,c){this.$el=a;this.type=b;this.opts=c},m=s.prototype;m.draw=function(){j.graphers[this.type].call(this,this.opts)};m.fill=function(){var a=this.opts.fill,b=a;e.isFunction(b)||(b=function(b,d){return a[d%a.length]});return b};m.prepare=function(a,b){var c;this.svg?c=e(this.svg).empty():(this.svg=o("svg",{"class":"peity"}),this.$el.hide().after(this.svg),c=e(this.svg).data("peity",this));this.svg.setAttribute("height",b);this.svg.setAttribute("width",a);return c};
m.values=function(){return e.map(this.$el.text().split(this.opts.delimiter),function(a){return parseFloat(a)})};j.defaults={};j.graphers={};j.register=function(a,b,c){this.defaults[a]=b;this.graphers[a]=c};j.register("pie",{delimiter:null,diameter:16,fill:["#ff9900","#fff4dd","#ffc66e"]},function(a){if(!a.delimiter){var b=this.$el.text().match(/[^0-9\.]/);a.delimiter=b?b[0]:","}b=this.values();if("/"==a.delimiter)var c=b[0],b=[c,h.max(0,b[1]-c)];for(var d=0,c=b.length,f=0;d<c;d++)f+=b[d];for(var a=
this.prepare(a.width||a.diameter,a.height||a.diameter),d=a.width(),g=a.height(),a=d/2,g=g/2,p=h.min(a,g),e=h.PI,j=this.fill(),i=-e/2,d=0;d<c;d++){var n=b[d],l=n/f,k;if(0!=l){if(1==l)k=o("circle",{cx:a,cy:g,r:p});else{k=2*l*e;var l=i+k,m=p*h.cos(i)+a,i=p*h.sin(i)+g,q=p*h.cos(l)+a,r=p*h.sin(l)+g;k=o("path",{d:["M",a,g,"L",m,i,"A",p,p,0,k>e?1:0,1,q,r,"Z"].join(" ")});i=l}k.setAttribute("fill",j.call(this,n,d,b));this.svg.appendChild(k)}}});j.register("line",{delimiter:",",fill:"#c6d9fd",height:16,max:null,
min:0,stroke:"#4d89f9",strokeWidth:1,width:32},function(a){var b=this.values();1==b.length&&b.push(b[0]);for(var c=h.max.apply(h,b.concat([a.max])),d=h.min.apply(h,b.concat([a.min])),f=this.prepare(a.width,a.height),g=f.width(),f=f.height()-a.strokeWidth,e=g/(b.length-1),c=c-d,j=0==c?f:f/c,m=f+d*j,c=[0,m],i=0;i<b.length;i++)c.push(i*e,f-j*(b[i]-d)+a.strokeWidth/2);c.push(g,m);b=o("polygon",{fill:a.fill,points:c.join(" ")});this.svg.appendChild(b);a.strokeWidth&&(a=o("polyline",{fill:"transparent",
points:c.slice(2,c.length-2).join(" "),stroke:a.stroke,"stroke-width":a.strokeWidth,"stroke-linecap":"square"}),this.svg.appendChild(a))});j.register("bar",{delimiter:",",fill:["#4D89F9"],gap:1,height:16,max:null,min:0,width:32},function(a){for(var b=this.values(),c=h.max.apply(h,b.concat([a.max])),d=h.min.apply(h,b.concat([a.min])),f=this.prepare(a.width,a.height),g=f.width(),f=f.height(),e=c-d,j=0==e?0:f/e,a=a.gap,g=(g+a)/b.length,m=this.fill(),i=0;i<b.length;i++){var n=b[i],l=f-j*(n-d),k=j*n;if(0==
k){if(k=r,0>=d&&0<c||0==e)l-=r}else 0>k&&(l+=k,k=-k);n=o("rect",{fill:m.call(this,n,i,b),x:i*g,y:l,width:g-a,height:k});this.svg.appendChild(n)}})})(jQuery,document,Math);

File diff suppressed because one or more lines are too long

@ -0,0 +1,478 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('图表组合')" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5 class="m-b-md">Q1 销量</h5>
<h2 class="text-navy">
<i class="fa fa-play fa-rotate-270"></i> 上升
</h2>
<small>更新时间12天以前</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content ">
<h5 class="m-b-md">Q2 销量</h5>
<h2 class="text-navy">
<i class="fa fa-play fa-rotate-270"></i> 上升
</h2>
<small>更新时间12天以前</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5 class="m-b-md">Q3 销量</h5>
<h2 class="text-danger">
<i class="fa fa-play fa-rotate-90"></i> 下降
</h2>
<small>更新时间12天以前</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5 class="m-b-md">Q4 销量</h5>
<h2 class="text-danger">
<i class="fa fa-play fa-rotate-90"></i> 下降
</h2>
<small>更新时间12天以前</small>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>本日访问量</h5>
<h2>198 009</h2>
<div id="sparkline1"></div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>本周访问量</h5>
<h2>65 000</h2>
<div id="sparkline2"></div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>本月访问量</h5>
<h2>680 900</h2>
<div id="sparkline3"></div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>平均停留时间</h5>
<h2>00:06:40</h2>
<div id="sparkline4"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>使用率</h5>
<h2>65%</h2>
<div class="progress progress-mini">
<div style="width: 68%;" class="progress-bar"></div>
</div>
<div class="m-t-sm small">4:32更新</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>使用率</h5>
<h2>50%</h2>
<div class="progress progress-mini">
<div style="width: 78%;" class="progress-bar"></div>
</div>
<div class="m-t-sm small">4:32更新</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>使用率</h5>
<h2>14%</h2>
<div class="progress progress-mini">
<div style="width: 38%;" class="progress-bar progress-bar-danger"></div>
</div>
<div class="m-t-sm small">4:32更新</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>使用率</h5>
<h2>20%</h2>
<div class="progress progress-mini">
<div style="width: 28%;" class="progress-bar progress-bar-danger"></div>
</div>
<div class="m-t-sm small">4:32更新</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>百分比</h5>
<h2>42/20</h2>
<div class="text-center">
<div id="sparkline5"></div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>百分比</h5>
<h2>100/54</h2>
<div class="text-center">
<div id="sparkline6"></div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>百分比</h5>
<h2>685/211</h2>
<div class="text-center">
<div id="sparkline7"></div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>百分比</h5>
<h2>240/32</h2>
<div class="text-center">
<div id="sparkline8"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>收入</h5>
<h1 class="no-margins">886,200</h1>
<div class="stat-percent font-bold text-navy">98% <i class="fa fa-bolt"></i></div>
<small>总收入</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>本月收入</h5>
<h1 class="no-margins">1 738,200</h1>
<div class="stat-percent font-bold text-navy">98% <i class="fa fa-bolt"></i></div>
<small>总收入</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>本日收入</h5>
<h1 class="no-margins">-200,100</h1>
<div class="stat-percent font-bold text-danger">12% <i class="fa fa-level-down"></i></div>
<small>总收入</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>搜索有收入</h5>
<h1 class="no-margins">54,200</h1>
<div class="stat-percent font-bold text-danger">24% <i class="fa fa-level-down"></i></div>
<small>总收入</small>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>预警</h5>
<table class="table table-stripped small m-t-md">
<tbody>
<tr>
<td class="no-borders">
<i class="fa fa-circle text-navy"></i>
</td>
<td class="no-borders">
示例 01
</td>
</tr>
<tr>
<td>
<i class="fa fa-circle text-navy"></i>
</td>
<td>
示例 02
</td>
</tr>
<tr>
<td>
<i class="fa fa-circle text-navy"></i>
</td>
<td>
示例 03
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>项目</h5>
<table class="table table-stripped small m-t-md">
<tbody>
<tr>
<td class="no-borders">
<i class="fa fa-circle text-navy"></i>
</td>
<td class="no-borders">
示例 01
</td>
</tr>
<tr>
<td>
<i class="fa fa-circle text-navy"></i>
</td>
<td>
示例 02
</td>
</tr>
<tr>
<td>
<i class="fa fa-circle text-navy"></i>
</td>
<td>
示例 03
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>消息</h5>
<table class="table table-stripped small m-t-md">
<tbody>
<tr>
<td class="no-borders">
<i class="fa fa-circle text-danger"></i>
</td>
<td class="no-borders">
示例 01
</td>
</tr>
<tr>
<td>
<i class="fa fa-circle text-danger"></i>
</td>
<td>
示例 02
</td>
</tr>
<tr>
<td>
<i class="fa fa-circle text-danger"></i>
</td>
<td>
示例 03
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox">
<div class="ibox-content">
<h5>通知</h5>
<table class="table table-stripped small m-t-md">
<tbody>
<tr>
<td class="no-borders">
<i class="fa fa-circle text-danger"></i>
</td>
<td class="no-borders">
示例 01
</td>
</tr>
<tr>
<td>
<i class="fa fa-circle text-danger"></i>
</td>
<td>
示例 02
</td>
</tr>
<tr>
<td>
<i class="fa fa-circle text-danger"></i>
</td>
<td>
示例 03
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: peity-js" />
<th:block th:include="include :: sparkline-js" />
<script type="text/javascript">
$(document).ready(function () {
$("#sparkline1").sparkline([34, 43, 43, 35, 44, 32, 44, 52], {
type: 'line',
width: '100%',
height: '60',
lineColor: '#1ab394',
fillColor: "#ffffff"
});
$("#sparkline2").sparkline([24, 43, 43, 55, 44, 62, 44, 72], {
type: 'line',
width: '100%',
height: '60',
lineColor: '#1ab394',
fillColor: "#ffffff"
});
$("#sparkline3").sparkline([74, 43, 23, 55, 54, 32, 24, 12], {
type: 'line',
width: '100%',
height: '60',
lineColor: '#ed5565',
fillColor: "#ffffff"
});
$("#sparkline4").sparkline([24, 43, 33, 55, 64, 72, 44, 22], {
type: 'line',
width: '100%',
height: '60',
lineColor: '#ed5565',
fillColor: "#ffffff"
});
$("#sparkline5").sparkline([1, 4], {
type: 'pie',
height: '140',
sliceColors: ['#1ab394', '#F5F5F5']
});
$("#sparkline6").sparkline([5, 3], {
type: 'pie',
height: '140',
sliceColors: ['#1ab394', '#F5F5F5']
});
$("#sparkline7").sparkline([2, 2], {
type: 'pie',
height: '140',
sliceColors: ['#ed5565', '#F5F5F5']
});
$("#sparkline8").sparkline([2, 3], {
type: 'pie',
height: '140',
sliceColors: ['#ed5565', '#F5F5F5']
});
});
$(function() {
$("span.pie").peity("pie", {
fill: ['#1ab394', '#d7d7d7', '#ffffff']
})
$(".line").peity("line",{
fill: '#1ab394',
stroke:'#169c81',
})
$(".bar").peity("bar", {
fill: ["#1ab394", "#d7d7d7"]
})
$(".bar_dashboard").peity("bar", {
fill: ["#1ab394", "#d7d7d7"],
width:100
})
var updatingChart = $(".updating-chart").peity("line", { fill: '#1ab394',stroke:'#169c81', width: 64 })
setInterval(function() {
var random = Math.round(Math.random() * 10)
var values = updatingChart.text().split(",")
values.shift()
values.push(random)
updatingChart
.text(values.join(","))
.change()
}, 1000);
});
</script>
</body>
</html>

@ -0,0 +1,206 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('图表')" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInDown">
<div class="row">
<div class="col-sm-5">
<div class="jumbotron">
<h1>Peity图表</h1>
<p>是一个内嵌数据图形可视化的图表库</p>
<p><a href="http://benpickles.github.io/peity/" target="_blank" class="btn btn-primary btn-lg" role="button">了解 Peity</a>
</p>
</div>
</div>
<div class="col-sm-7">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>饼状图 <small>自定义颜色</small></h5>
<div class="ibox-tools">
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div>
<table class="table table-bordered white-bg">
<thead>
<tr>
<th>图表</th>
<th>代码</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="pie">1/5</span>
</td>
<td>
<code>&lt;span class="pie"&gt;1/5&lt;/span&gt;</code>
</td>
</tr>
<tr>
<td>
<span class="pie">226/360</span>
</td>
<td>
<code>&lt;span class="pie"&gt;226/360&lt;/span&gt;</code>
</td>
</tr>
<tr>
<td>
<span class="pie">0.52/1.561</span>
</td>
<td>
<code>&lt;span class="pie"&gt;0.52/1.561&lt;/span&gt;</code>
</td>
</tr>
<tr>
<td>
<span class="pie">1,4</span>
</td>
<td>
<code>&lt;span class="pie"&gt;1,4&lt;/span&gt;</code>
</td>
</tr>
<tr>
<td>
<span class="pie">226,134</span>
</td>
<td>
<code>&lt;span class="pie"&gt;226,134&lt;/span&gt;</code>
</td>
</tr>
<tr>
<td>
<span class="pie">0.52,1.041</span>
</td>
<td>
<code>&lt;span class="pie"&gt;0.52,1.041&lt;/span&gt;</code>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>线性图</h5>
<div class="ibox-tools">
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div>
<table class="table table-bordered white-bg">
<thead>
<tr>
<th>图表</th>
<th>代码</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span data-diameter="40" class="updating-chart">5,3,9,6,5,9,7,3,5,2,5,3,9,6,5,9,7,3,5,2</span>
</td>
<td>
<code>&lt;span class="line"&gt;5,3,9,6,5,9,7,3,5,2&lt;/span&gt;</code>
</td>
</tr>
<tr>
<td>
<span class="line">5,3,9,6,5,9,7,3,5,2</span>
</td>
<td>
<code>&lt;span class="line"&gt;5,3,9,6,5,9,7,3,5,2&lt;/span&gt;</code>
</td>
</tr>
<tr>
<td>
<span class="line">5,3,2,-1,-3,-2,2,3,5,2</span>
</td>
<td>
<code>&lt;span class="line"&gt;5,3,2,-1,-3,-2,2,3,5,2&lt;/span&gt;</code>
</td>
</tr>
<tr>
<td>
<span class="line">0,-3,-6,-4,-5,-4,-7,-3,-5,-2</span>
</td>
<td>
<code>&lt;span class="line"&gt;0,-3,-6,-4,-5,-4,-7,-3,-5,-2&lt;/span&gt;</code>
</td>
</tr>
<tr>
<td>
<span class="bar">5,3,9,6,5,9,7,3,5,2</span>
</td>
<td>
<code>&lt;span class="bar"&gt;5,3,9,6,5,9,7,3,5,2&lt;/span&gt;</code>
</td>
</tr>
<tr>
<td>
<span class="bar">5,3,2,-1,-3,-2,2,3,5,2</span>
</td>
<td>
<code>&lt;span class="bar"&gt;5,3,2,-1,-3,-2,2,3,5,2&lt;/span&gt;</code>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: peity-js" />
<script type="text/javascript">
$(function() {
$("span.pie").peity("pie", {
fill: ['#1ab394', '#d7d7d7', '#ffffff']
})
$(".line").peity("line",{
fill: '#1ab394',
stroke:'#169c81',
})
$(".bar").peity("bar", {
fill: ["#1ab394", "#d7d7d7"]
})
$(".bar_dashboard").peity("bar", {
fill: ["#1ab394", "#d7d7d7"],
width:100
})
var updatingChart = $(".updating-chart").peity("line", { fill: '#1ab394',stroke:'#169c81', width: 64 })
setInterval(function() {
var random = Math.round(Math.random() * 10)
var values = updatingChart.text().split(",")
values.shift()
values.push(random)
updatingChart
.text(values.join(","))
.change()
}, 1000);
});
</script>
</body>
</html>

@ -0,0 +1,232 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('线状图')" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInDown">
<div class="row">
<div class="col-sm-5">
<div class="jumbotron">
<h1>Sparkline</h1>
<p>这是另一个可视化图表库</p>
<p><a href="http://omnipotent.net/jquery.sparkline" target="_blank" class="btn btn-primary btn-lg" role="button">了解 Sparkline</a>
</p>
</div>
</div>
<div class="col-sm-7">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Sparkline图表 <small>自定义颜色</small></h5>
<div class="ibox-tools">
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div>
<table class="table table-bordered white-bg">
<thead>
<tr>
<th>图表</th>
<th>类型</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span id="sparkline1"></span>
</td>
<td>
内联线性图
</td>
</tr>
<tr>
<td>
<span id="sparkline2"></span>
</td>
<td>
柱状图
</td>
</tr>
<tr>
<td>
<span id="sparkline3"></span>
</td>
<td>
饼状图
</td>
</tr>
<tr>
<td>
<span id="sparkline4"></span>
</td>
<td>
长线性图
</td>
</tr>
<tr>
<td>
<span id="sparkline5"></span>
</td>
<td>
三态图
</td>
</tr>
<tr>
<td>
<span id="sparkline6"></span>
</td>
<td>
散点图
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>自定义饼状图尺寸</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="graph_sparkline.html#">
<i class="fa fa-wrench"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="graph_sparkline.html#">选项1</a>
</li>
<li><a href="graph_sparkline.html#">选项2</a>
</li>
</ul>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content text-center h-200">
<span id="sparkline7"></span>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>自定义柱状图尺寸</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="graph_sparkline.html#">
<i class="fa fa-wrench"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="graph_sparkline.html#">选项1</a>
</li>
<li><a href="graph_sparkline.html#">选项2</a>
</li>
</ul>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content text-center h-200">
<span id="sparkline8"></span>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>自定义线性图尺寸</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="graph_sparkline.html#">
<i class="fa fa-wrench"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="graph_sparkline.html#">选项1</a>
</li>
<li><a href="graph_sparkline.html#">选项2</a>
</li>
</ul>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content text-center h-200">
<span id="sparkline9"></span>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: sparkline-js" />
<script type="text/javascript">
$(function () {
$("#sparkline1").sparkline([34, 43, 43, 35, 44, 32, 44, 52, 25], {
type: 'line',
lineColor: '#17997f',
fillColor: '#1ab394',
});
$("#sparkline2").sparkline([5, 6, 7, 2, 0, -4, -2, 4], {
type: 'bar',
barColor: '#1ab394',
negBarColor: '#c6c6c6'});
$("#sparkline3").sparkline([1, 1, 2], {
type: 'pie',
sliceColors: ['#1ab394', '#b3b3b3', '#e4f0fb']});
$("#sparkline4").sparkline([34, 43, 43, 35, 44, 32, 15, 22, 46, 33, 86, 54, 73, 53, 12, 53, 23, 65, 23, 63, 53, 42, 34, 56, 76, 15, 54, 23, 44], {
type: 'line',
lineColor: '#17997f',
fillColor: '#ffffff',
});
$("#sparkline5").sparkline([1, 1, 0, 1, -1, -1, 1, -1, 0, 0, 1, 1], {
type: 'tristate',
posBarColor: '#1ab394',
negBarColor: '#bfbfbf'});
$("#sparkline6").sparkline([4, 6, 7, 7, 4, 3, 2, 1, 4, 4, 5, 6, 3, 4, 5, 8, 7, 6, 9, 3, 2, 4, 1, 5, 6, 4, 3, 7, ], {
type: 'discrete',
lineColor: '#1ab394'});
$("#sparkline7").sparkline([52, 12, 44], {
type: 'pie',
height: '150px',
sliceColors: ['#1ab394', '#b3b3b3', '#e4f0fb']});
$("#sparkline8").sparkline([5, 6, 7, 2, 0, 4, 2, 4, 5, 7, 2, 4, 12, 14, 4, 2, 14, 12, 7], {
type: 'bar',
barWidth: 8,
height: '150px',
barColor: '#1ab394',
negBarColor: '#c6c6c6'});
$("#sparkline9").sparkline([34, 43, 43, 35, 44, 32, 15, 22, 46, 33, 86, 54, 73, 53, 12, 53, 23, 65, 23, 63, 53, 42, 34, 56, 76, 15, 54, 23, 44], {
type: 'line',
lineWidth: 1,
height: '150px',
lineColor: '#17997f',
fillColor: '#ffffff',
});
});
</script>
</body>
</html>

@ -151,4 +151,19 @@
</div>
<div th:fragment="jquery-steps-js">
<script th:src="@{/ajax/libs/staps/jquery.steps.min.js}"></script>
</div>
<!-- ECharts百度统计图表插件 -->
<div th:fragment="echarts-js">
<script th:src="@{/ajax/libs/report/echarts/echarts-all.js}"></script>
</div>
<!-- peity图表组合插件 -->
<div th:fragment="peity-js">
<script th:src="@{/ajax/libs/report/peity/jquery.peity.min.js}"></script>
</div>
<!-- sparkline线状图插件 -->
<div th:fragment="sparkline-js">
<script th:src="@{/ajax/libs/report/sparkline/jquery.sparkline.min.js}"></script>
</div>

@ -120,6 +120,14 @@
<li><a class="menuItem" th:href="@{/demo/operate/other}">其他</a></li>
</ul>
</li>
<li> <a>报表<span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a class="menuItem" th:href="@{/demo/report/echarts}">百度ECharts</a></li>
<li><a class="menuItem" th:href="@{/demo/report/peity}">peity</a></li>
<li><a class="menuItem" th:href="@{/demo/report/sparkline}">sparkline</a></li>
<li><a class="menuItem" th:href="@{/demo/report/metrics}">图表组合</a></li>
</ul>
</li>
<li> <a>图标<span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li><a class="menuItem" th:href="@{/demo/icon/fontawesome}">Font Awesome</a></li>

Loading…
Cancel
Save