var dataEcstat =[
[1990, 97.50795611],
[1991, -1.47594249]
]
init();functioninit(){
ledgerCountBar();
}functionledgerCountBar(){var ledgerCount = echarts.init(document.getElementById('showLedgerCountBar'));var regressionDemo = ecStat.regression( "linear", dataEcstat, 1);
option={
title: {
text:' 折线图',
subtext:' ',
left:'center'},
tooltip: {
trigger:'item',
formatter:'{a}
{b} : {c}'},
xAxis: {
type:'category'},
yAxis: {
type:'value'},
series: [{
name:'数据',
label: {
show:true,
position:"top",
formatter:' {c}'},
data: dataEcstat,
type:'line'},
{
name:'误差趋势拟合',
label: {
show:true,
position:"top",
formatter:' {c}'},
data: regressionDemo.points,
lineStyle: {
color:"#f00"},
type:'line'}
]
};
ledgerCount.setOption(option);
window.οnresize=ledgerCount.resize;
}