首页 > 其他分享 >折线图

折线图

时间:2023-02-13 20:13:07浏览次数:35  
标签:color rgba 折线图 FFF echarts 2022.01 255

<!--折线图-->
<template>
<div class="chartBox">
<!--echart图标-->
<div id="lineChart" ref="lineChart"></div>
</div>

</template>

<script>
// 引入基本模板
// const echarts = require('echarts');
import * as echarts from 'echarts' // 注意此处echarts高版本中需要使用此方式才可引入
export default {
name: "scatterDiagram",
props:{
//折线是否平滑
smooth:{
type:Boolean,
default:false
},
//填充的颜色
areaColor:{
type:String,
default:'transparent'
}
},
data() {
return {
lineChart: null,
}
},
mounted() {
this.initEchart();

},
methods: {
initEchart() {
// 基于准备好的dom,初始化echarts实例
this.lineChart = echarts.init(this.$refs.lineChart);

let option = {
textStyle:{
color:'#FFF',
fontSize:12,
},
grid: {
left:40,
right:30,
top:40,
bottom:25
},
title: {
subtext: "时长/h",
top: -15,
left: 0,
subtextStyle: { // 设置二级标题的样式
color: "#FFF"
}
},
xAxis: {
type: 'category',
data: ['2022.01.02', '2022.01.03', '2022.01.04', '2022.01.05', '2022.01.06', '2022.01.07'],
nameTextStyle:{
color:'#FFF',
fontSize:12
},
axisLine:{
onZero: false,
lineStyle:{
color:'rgba(255,255,255,0.2)'
}
},
axisLabel: {
interval: 0,
margin: 15
},

axisTick:{
lineStyle:{
color:'rgba(255,255,255,0.2)'
}
},
// boundaryGap:false
},
yAxis: {
type: 'value',
splitLine:{
lineStyle:{
color:'rgba(255,255,255,0.2)'
}
},
},
series: [
{
data: [321, 624, 738, 922, 500,200],
smooth: this.smooth,
label:{
show:true,
position: 'top' ,

distance: 14,
textStyle:{
color:'#FFF',
fontSize:12
}
},
symbolSize: 10, //折线点的大小
symbol: 'circle', //折线点设置为实心点
type: 'line',
areaStyle: {
color:this.areaColor
},
itemStyle: {
normal: {
shadowColor: 'rgba(83,206,253,0.2)',
color:'#F8D501', //折线点的颜色
borderColor: '#FFF', //拐点边框颜色
borderWidth: 1, //拐点边框大小
},
},
lineStyle: {
color:'#53CEFD', //折线的颜色
},
emphasis:{
disabled:false,
focus:'series',

itemStyle:{
shadowColor: 'rgba(248,213,1, 0.5)',
shadowBlur: 1000
},
areaStyle: {
shadowColor: 'rgba(248,213,1, 0.5)',
shadowBlur: 1000
}
},
}
]
};

// 使用刚指定的配置项和数据显示图表。
this.lineChart.setOption(option);
}
}
}
</script>

<style scoped lang="scss">
.chartBox {
width: 100%;
box-sizing: border-box;
padding: 1.6rem 1.6rem 0;
flex: 1;

#lineChart {

height: calc(100% - 16px);

}
}
</style>

标签:color,rgba,折线图,FFF,echarts,2022.01,255
From: https://www.cnblogs.com/connie256/p/17117662.html

相关文章

  • python的折线图实现的具体案例
    #导入包frompyecharts.chartsimportLinefrompyecharts.optionsimportTitleOpts,ToolboxOpts,LegendOpts,VisualMapOpts,LabelOptsimportjson#处理数据f_us=open("D......
  • vue+echarts实现疫情折线图
    效果:代码:<<template><div><divid="left1"style="height:800px;width:100%"></div></div></template><script>//疫情数据//exportdefault{data()......
  • python绘制折线图
    importdatetimeimportmatplotlib.pyplotaspltimportpylabasmplimportnumpyasnp#数据源list_date=['20191005','20191014','20191021','20191217','20......
  • 如何在Python Plotly中使用Plotly Express绘制多折线图?
    Plotly是Python中的开源绘图库。Python用户可以使用Plotly生成不同类型的交互式基于Web的图表,包括科学图表,3D图形,统计图表,财务图表等。在本教程中,我们将展示如何使用Plotly......
  • Matplotlib 绘制折线图
    Matplotlibmatplotlib:最流行的Python底层绘图库,主要做数据可视化图表,名字取材于MATLAB,模仿MATLAB构建绘制折线图绘制两小时的温度变化frommatplotlibimportpyplo......
  • exel中做折线图,编辑图例
      1、选择做折线图的内容, 2、插入折线图  选择一个图例,右键选择数据源 选择修改项,点击编辑  ......
  • echarts柏拉图,柱状图和折线图结合使用,双纵坐标轴展示
    效果如图:          //柏拉图分析lineOption2:{tooltip:{trigger:'axis',axisPointer:{......
  • 折线图配置
    1varoption={2//折线对应的标题3legend:{4data:['总收入','订单笔数'],5right:10,6top:37......
  • Python+matplotlib实现折线图的美化
    1.导入包importpandasaspdimportmatplotlib.pyplotaspltimportmatplotlib.tickerastickerimportmatplotlib.gridspecasgridspec2.获得数据file_i......
  • WPF+ASP.NET SignalR实现动态折线图
    在实际业务中,当后台数据发生变化,客户端能够实时的收到通知,而不是由用户主动的进行页面刷新才能查看,这将是一个非常人性化的设计。有没有那么一种场景,后台数据明明已经发生......