一:要实现的效果
二:代码分析
1.需求分析
(1)数据以字典形式表示
var dataset=[
{
country:"china",
gdp:[[2000,11920],[2001,13170],[2002,14550],[2003,16500],
[2004,19440],[2005,22870],[2006,27930],[2007,35040],[2008,45470],
[2009,51050],[2010,59490],[2011,73140],[2012,83860],[2013,103550]
]
},
{
country:"japan",
gdp:[[2000,47310],[2001,41590],[2002,39800],[2003,43020],
[2004,46550],[2005,45710],[2006,43560],[2007,43560],[2008,48490],
[2009,50350],[2010,54950],[2011,59050],[2012,59370],[2013,48980]
]
}
];
(2)坐标轴样式设置
<style>
.axis path,
.axis line{
fill:none;
stroke:black;
shap