版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。

效果:

//设置X轴

var XAxis=[
{
type:"category",
data:['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
axisLabel: {
textStyle: {color: '#a2d4e6'
}
},
axisTick: {
alignWithLabel: true
}

}

]
pkchart.setXAxis("chart1",XAxis);

//设置y轴
var yAxis= [
{
type: 'value',
name: '三舱人数',
axisLine: {
lineStyle: {
color: '#a2d4e6'
}},
splitLine: {
show: true,
lineStyle:{
color: ['#05133c'],
width: 1,
type: 'solid'
}
  }
// axisLabel: {textStyle: {color: '#fff'}}

},
{
type: 'value',
name: '总人数',
axisLine: {
lineStyle: {
color: '#a2d4e6'
}},
splitLine: {
show: true,
lineStyle:{
color: ['#05133c'],
width: 1,
type: 'solid'
}
  }
}
]
pkchart.setYAxis("chart1",yAxis);

//设置图例
pkchart.setLegend("chart1",{orient: 'horizontal',top:10,right:0,textStyle:{color:'white'},data: ['电力舱', '综合舱', '燃气舱','人数']}); // 设置图例


//设置数据
var series= [
{
name: '人数',
type: 'line',
yAxisIndex: 1,
color:'#44f0ff',
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#6fecf7" },
{ offset: 0.5, color: "#8eecf5" },
{ offset: 1, color: "#eef2f2" }
])
}
}

...