折线图
color:
调色盘颜色列表
。如果系列没有设置颜色,则会依次循环从该列表中取颜色作为系列颜色在案例中的作用:
改变标题线条颜色和折线颜色 使其能保持一致
legend:
图例组件(标题)展现了不同系列的标记(symbol),颜色和名字
textStyle:
图例的公用文本样式
可改字体颜色和大小
orient:改变标题的布局 (垂直or水平)
top、right、bottom、left :标题离容器左侧的距离
itemGap:标题每项的间距
grid:可以控制
直角坐标系内绘图网格,单个 grid 内最多可以放置上下两个 X 轴,左右两个 Y 轴。可以在网格上绘制折线图,柱状图,散点图(气泡图)。
top、right、bottom、left :图表离容器左侧的距离
xAxis yAxis 对x、y轴进行设置
axisLine
lineStyle:可以改坐标轴线条颜色
series
系列列表。每个系列通过 type 决定自己的图表类型
type:指定图表的类型
name:系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
stack数据堆叠,同个类目轴上系列配置相同的stack值后,后一个系列的值会在前一个系列的值上相加。
smooth:是否平滑曲线显示。
data:数据
lineOption: {
color:['rgb(255,185,128)','rgb(90,177,239)','rgb(253,34,216)', 'rgb(24,185,154)'],
legend: {
data: ['告警信息总量', '违规信息总量', '红头信息总量', '涉密信息总量'],
textStyle: {
color: '#fff'
}
},
tooltip: {
trigger: 'axis'
},
textStyle: {
color: '#fff'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['1/1', '1/2', '1/3', '1/4', '1/5', '1/6', '1/7'],
axisLine: {
lineStyle: {
color: '#fff'
}
}
},
yAxis: {
type: 'value',
axisLine: {
lineStyle: {
color: '#fff'
}
}
},
series: [
{
name: '告警信息总量',
type: 'line',
stack: '总量',
// smooth: true,
data: [2820, 182, 191, 234, 290, 330, 310],
},
{
name: '违规信息总量',
type: 'line',
stack: '总量',
// smooth: true,
data: [1570, 2320, 2010, 1540, 1900, 3300, 4100],
lineStyle: {
color: 'rgb(90,177,239)'
}
},
{
name: '红头信息总量',
type: 'line',
stack: '总量',
// smooth: true,
data: [3210, 3302, 3001, 3340, 3900, 3300, 3210],
},
{
name: '涉密信息总量',
type: 'line',
stack: '总量',
// smooth: true,
data: [2800, 1932, 1901, 1934, 1290, 1830, 1920],
}
]
}
};