摘要:需求如图用实现,代码如下,无注释。指定图表的配置项和数据总量是否平滑显示
需求如图:
用echarts实现,代码如下,无注释。
</>复制代码
var myChart = echarts.init(document.getElementById("main"));
var x = new Array();
var optionx = new Array();
var y = new Array();
for(var i = 0; i < chartData.length; i++){
for (item in chartData[i]){
x.push(item);
y.push(chartData[i][item]);
}
}
for(var i = 0; i < x.length; i++){
var index1 = x[i].indexOf("-") + 1;
optionx.push(x[i].substring(index1,x[i].length));
}
// 指定图表的配置项和数据
var option = {
backgroundColor: "#FCFCFC",
tooltip : {
backgroundColor: "#17191D",
trigger: "axis",
axisPointer: {
type: "none",
label: {
backgroundColor: "#6a7985"
}
},
formatter: function(params, ticket, callback) {
return "";
}
},
grid: {
top: 0,
bottom: 36,
left: -20,
right: -20
},
xAxis :{
type : "category",
boundaryGap : false,
axisLine : {
show: false,
lineStyle :{
color : "#C6D2DD"
}
},
axisLabel: {
color : "#666"
},
splitLine : {
show: true,
lineStyle :{
color : "#D7D8DA",
type : "dashed"
}
},
axisTick : {
show: false,
lineStyle :{
color : "#EBEBEB"
}
},
data : optionx
},
yAxis : {
type : "value",
axisLine :{
show: false
},
axisLabel : {
show: false
},
splitLine : {
show: false
},
axisTick : {
show: false
}
},
series : [
{
type:"line",
stack: "总量",
smooth : true, //是否平滑显示
symbolSize : 6,
itemStyle : {
color: "#FFD205",
borderColor : "#FFD205",
borderWidth : 2
},
lineStyle : {
color : "#FFD205",
width : 4
},
areaStyle : {
color : "#FFF",
origin : "end",
opacity : 1
},
data:y
}
]
};
myChart.setOption(option);
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/54040.html
摘要:需求如图用实现,代码如下,无注释。指定图表的配置项和数据总量是否平滑显示 需求如图:showImg(https://segmentfault.com/img/bVbtS5r?w=824&h=541); 用echarts实现,代码如下,无注释。 var myChart = echarts.init(document.getElementById(main)); var x = n...
摘要:七月份的下半个月,有幸做了奔驰年新官网,包括手机端和端的宣传页,地址端手机端这里,为了证明这个是一个事实,我还特意的留存了两张截图这里只想说明这么几个问题这东西确实是我做了,而且是那种创意天,开发两天,三天测试,天的时候就要上线的奥美负责创 七月份的下半个月,有幸做了奔驰 Smart 2015年新官网,包括手机端和PC端的宣传页,地址: PC端 手机端 这里,为了证明这个是一个事...
阅读 2374·2023-04-26 00:28
阅读 3120·2019-08-30 15:55
阅读 2782·2019-08-30 12:47
阅读 1604·2019-08-29 11:04
阅读 3287·2019-08-28 18:14
阅读 990·2019-08-28 18:11
阅读 1712·2019-08-26 18:36
阅读 3431·2019-08-23 18:21