You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jumpserver/templates/test2.html

86 lines
3.0 KiB

9 years ago
<html>
9 years ago
<body>
<div id="main" style="height:400px;"></div>
...
<script src="/static/js/echarts/echarts.js"></script>
<script type="text/javascript">
require.config({
paths: {
9 years ago
'echarts': '/static/js/echarts/chart',
'echarts/chart/line': '/static/js/echarts/chart/line'
9 years ago
}
});
require(
[
9 years ago
'echarts',
'echarts/chart/line'
9 years ago
],
function (ec) {
var myChart = ec.init(document.getElementById('main'));
var option = {
title : {
9 years ago
text: '某楼盘销售情况',
9 years ago
subtext: '纯属虚构'
},
tooltip : {
trigger: 'axis'
},
legend: {
9 years ago
data:['意向','预购','成交']
9 years ago
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
9 years ago
magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
9 years ago
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
xAxis : [
{
type : 'category',
boundaryGap : false,
data : ['周一','周二','周三','周四','周五','周六','周日']
}
],
yAxis : [
{
9 years ago
type : 'value'
9 years ago
}
],
series : [
{
9 years ago
name:'成交',
9 years ago
type:'line',
9 years ago
smooth:true,
itemStyle: {normal: {areaStyle: {type: 'default'}}},
data:[10, 12, 21, 54, 260, 830, 710]
9 years ago
},
{
9 years ago
name:'预购',
9 years ago
type:'line',
9 years ago
smooth:true,
itemStyle: {normal: {areaStyle: {type: 'default'}}},
data:[30, 182, 434, 791, 390, 30, 10]
},
{
name:'意向',
type:'line',
smooth:true,
itemStyle: {normal: {areaStyle: {type: 'default'}}},
data:[1320, 1132, 601, 234, 120, 90, 20]
9 years ago
}
]
};
9 years ago
9 years ago
myChart.setOption(option);
}
);
</script>
</body>
</html>