blob: db2b0410e8d7f2392f790074160eca9525bd86ee [file] [log] [blame]
<html>
<head>
<meta charset="utf-8">
<script src="http://requirejs.org/docs/release/2.2.0/minified/require.js"></script>
<script src="lib/config.js"></script>
<meta name="viewport" content="user-scalable=no,width=device-width,height=device-height">
</head>
<body>
<style>
html, body, #main {
width: 100%;
height: 100%;
}
</style>
<div id="main"></div>
<script>
require([
'echarts'
// 'echarts/chart/line',
// 'echarts/component/legend',
// 'echarts/component/gridSimple',
// 'echarts/component/tooltip',
// 'zrender/vml/vml'
], function (echarts) {
var chart = echarts.init(document.getElementById('main'), null, {
// renderer: 'svg'
});
var data = [
[0, 0]
[1, 1],
[2, 4],
[3, 3],
[4, 3],
[5, 3],
[6, 7],
[7, 7]
];
option = {
color: ['#4ea397', '#d0648a', '#f5b841'],
animation: false,
title: {
text: '光滑曲线新老算法对比',
left: '50%',
textAlign: 'center'
},
legend: {
top: 30,
data: ['非单调光滑(老算法)','单调光滑(新算法)', '不光滑']
},
xAxis: {
type: 'value'
},
yAxis: {
type: 'value'
},
grid: {
left: 30,
right: 30
},
series: [{
name: '非单调光滑(老算法)',
type: 'line',
smoothMonotone: 'none',
smooth: true,
showSymbol: false,
connectNulls: true,
data: data,
lineStyle: {
width: 1
},
areaStyle: {
opacity: 0.4
}
}, {
name: '单调光滑(新算法)',
type: 'line',
smooth: true,
showSymbol: false,
connectNulls: true,
data: data,
lineStyle: {
width: 1
},
areaStyle: {
opacity: 0.4
}
}, {
name: '不光滑',
type: 'line',
smooth: false,
symbol: 'circle',
symbolSize: 6,
connectNulls: true,
data: data,
lineStyle: {
width: 3,
type: 'dashed'
}
}]
};
chart.setOption(option);
})
</script>
</body>
</html>