option =

{
tooltip: {
trigger: 'axis',
// axisPointer: {
// type: 'cross',
// label: {
// backgroundColor: '#6a7985',
// },
// },
position(pos: any, params: any, dom: any, rect: any, size: any) { // 鼠标移入时显示的框子的定位
// 鼠标在左侧时 tooltip 显示到右侧,鼠标在右侧时 tooltip 显示到左侧。
return {
top: -10,
[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]]: 10,
};
},
},
dataZoom: [  //x轴是否可以滑动
{
type: 'inside',
start: 50, //从50%开始显示
end: 100, //到100%的位置 
filterMode: 'empty',
},
],
color: ['#d77b09', '#54f0fd', '#296f04'],  //想要设置折线图的文字颜色(还是图小图标一起改动?),必须要在这里写
legend: {
data: ['名称1', '名城2', {  //这里可以单独设置图例的配置
name: '名城3',
textStyle: {
fontSize: 8,
fontWeight: 'bolder',
color: '#296f04',
},
}],
itemWidth: 6, //图例小图标的宽度,宽度和高度都为0时,小图标不显示
itemHeight: 6, //图例小图标的高度
textStyle: {
fontSize: 8, // 设置图例中文字大小
color: ['#d77b09', '#54f0fd', '#296f04'],  //设置图例文字的颜色,如果是有折线图,必须再在外面写个color,如果这里和外面写了都没效果,就单独设置图标中的data设置
},
itemGap: 0,
top: -6, },
// toolbox: {
// feature: {
// saveAsImage: {},
// },
// },
grid: {  //这个是用来设置echarts图标的位置和其他设置
left: '-5%',
// right: '4%',
bottom: '11%',
width: '110%',
top: '20%',
containLabel: true, //一般都带上这个,否则x,y轴的刻度值会被截取掉
},
xAxis: [  //x轴的设置
{
type: 'category',
boundaryGap: true, //是否将x轴的刻度显示在中间位置,false表示从0这个位置开始(最边上)
data: data,  //x轴的数据
axisTick: {  //是否显示刻度线
show: false,
},
axisLabel: {  //相关轴上的刻度值的设置,show:false,表示不显示轴上的刻度值
textStyle: { //刻度值的字体样式设置
color: '#e9ecee',
},
fontSize: 8,
margin: 2,  //刻度值离轴线多远的距离
},
},
],
yAxis: [
{
type: 'value',
// min: 0,
// max: 300, //设置轴的最大值和最小值,一般不规定,可自适应
show: false,  //设置Y轴不显示(轴线不显示)
splitNumber: 4, // 控制刻度标签的数量
axisTick: { //轴线的小刻度线
show: false, // y轴的小刻度线。这里是不显示
},
axisLabel: { //设置刻度值
show: false, //不显示刻度值,如果不显示,下面的刻度值设置就可以不用写了
textStyle: {
// color: '#e9ecee',
},
fontSize: 8,
margin: 5,
},
axisLine: { //设置轴线的配置
show: false,
lineStyle: { //轴线的线条颜色
color: '#9999ae',
},
},
splitLine: {  //设置网格线,写在哪个轴就是哪个轴的网格线
show: false,
lineStyle: {
type: 'dotted',
// color: ['#aaa', 'red'], //设置网格线的颜色,可单独设置
color: '#4c4a74',
},
},
},
],
series: [
{
name: '名称1',
type: 'line',
stack: '总量',
symbol: 'none', //取消折线上的小圆点
smooth: true, //使线条顺滑
itemStyle: { //折线的样式设置
normal: {
lineStyle: { //折线线条的设置
color: '#d77b09',
},
},
},
areaStyle: { //折线的区域样式设置
normal: {
color: new LinearGradient( //区域颜色设置
0, 0, 0, 1,
[
{ offset: 0, color: '#00c9ff' },
{ offset: 1, color: '#0065ff' },
],
),
},
},
data: data,
},
{
name: '名称2',
type: 'line',
stack: '总量',
smooth: true,
symbol: 'none',
itemStyle: {
normal: {
lineStyle: {
color: '#54f0fd',
},
},
},
areaStyle: {
normal: {
color: new LinearGradient(
0, 0, 0, 1,
[
{ offset: 0, color: '#00c9ff' },
{ offset: 1, color: '#0065ff' },
],
),
},
},
data: data,
},
{
name: '名称3',
type: 'line',
stack: '总量',
smooth: true,
itemStyle: {
normal: {
color: '296f04', //折线上的小圆点颜色设置
lineStyle: {
color: '#296f04',
// width: 1, //折线的线条宽度
},
},
},
areaStyle: {
normal: {
color: new LinearGradient(
0, 0, 0, 1,
[
{ offset: 0, color: '#00c9ff' },
{ offset: 1, color: '#0065ff' },
],
),
},
},
label: { //在折线上显示相对应的数值
normal: {
show: true,
position: 'top', //数值的位置
distance: 0,  //数值距离折线的距离
fontSize: 8, //数值的字体大小
color: '#296f04', //数值的颜色
},
},
data: data,
}, ],
};

echarts相关属性设置(1)折线图篇的更多相关文章

  1. echarts相关属性设置(2)--折线图和柱状图的结合使用

    type:bar和line的组合 option = { { tooltip: { trigger: 'axis', axisPointer: { // type: 'shadow' }, // lab ...

  2. echarts相关属性设置(3)环状图

    option = { grid: { left: '3%', top: '0%', // height: 500, right: '30%', containLabel: true, }, legen ...

  3. UILabel的相关属性设置

    在iOS编程中UILabel是一个常用的控件,下面分享一下UILabel的相关属性设置的方法. 很多学习iOS6编程都是从storyboard开始,用到UILabel时是将控件拖到storyboard ...

  4. iOS开发笔记--UILabel的相关属性设置

    在iOS编程中UILabel是一个常用的控件,下面分享一下UILabel的相关属性设置的方法. 很多学习iOS6编程都是从storyboard开始,用到UILabel时是将控件拖到storyboard ...

  5. echarts爬坑 : 怎么Line折线图设置symbol:none后Label不见了?

    用 echarts 时遇到了一个奇奇怪怪的问题. 这是一张折线图. 本来这个图是有数字显示的. series : [ { name:'搜索引擎', type:'line', stack: '总量', ...

  6. 深入浅出ECharts系列 (二) 折线图

    深入浅出ECharts系列(二) 目标 本次教程的目标是实现“折线图堆叠”折线,实现结果如图: 2. 准备工作 a)         首先下载ECharts插件,你可以根据自己的实际需求选择你想要下载 ...

  7. echarts图表属性设置

    原地址:http://blog.csdn.net/she_lover/article/details/51448967theme = { // 全图默认背景 // backgroundColor: ‘ ...

  8. echarts入门基础,画折线图

    注意:一定要自己引入echarts库 <!DOCTYPE html> <html> <head> <meta charset="UTF-8" ...

  9. 设置TextBlock默认样式后,其他控件的Text相关属性设置失效问题

    问题: 定义了默认TextBlock样式后,再次自定义下拉框 or 其他控件 ,当内部含有TextBlock时,设置控件的字体相关样式无效,系统始终使用TextBlock设置默认样式 解决方案: 为相 ...

随机推荐

  1. Android笔记之文本随滑块移动的SeekBar

    效果图 FloatingTextSeekBar.java package com.bu_ish.blog; import android.content.Context; import android ...

  2. openssl之BIO系列之20---缓冲(buffer)类型BIO

    缓冲(buffer)类型BIO ---依据openssl doc\crypto\bio_f_buffer.pod翻译和自己的理解写成 (作者:DragonKing, Mail: wzhah@263.n ...

  3. 解决express video 手机无法播放的问题

    http://stackoverflow.com/questions/24976123/streaming-a-video-file-to-an-html5-video-player-with-nod ...

  4. UIAutomator 2

    UIAutomator 2 While the API remains almost the same, the internal implementation has changed and we ...

  5. ubuntu:undefined reference to `snd_pcm_open'

    这几天在做一个局域网的对讲机和广播系统. 需要用到alsa的库来进行音频采集和播放. 但是在编译程序的时候有个比较奇怪的问题. undefined reference to `snd_pcm_open ...

  6. 卡特兰数 HDU2067 & HDU4165 & HDU1134

    题目链接:https://vjudge.net/problem/HDU-2067 小兔的棋盘 Time Limit: 1000/1000 MS (Java/Others)    Memory Limi ...

  7. linux应用之gcc编译器的安装及使用

    gcc是linux系统下功能十分强大的编译器. 本人使用的是CentOS 6.6 64位系统,由于在安装系统的时候并没有勾选安装gcc编译器,因此需要自行安装gcc编译器. 使用yum安装gcc 对于 ...

  8. 使用Dubbo实现RPC调用

    启动Dubbo服务有2个方式,1是通过xml配置,2是通过注解来实现,这点和Spring相似. 采用XML配置如下: <?xml version="1.0" encoding ...

  9. 2016.4.23浙江省赛(zoj3936 zoj3938 zoj3940 zoj3944 zoj3946 zoj3947 )

    A      Apples and Ideas Time Limit: 2 Seconds      Memory Limit: 65536 KB "If you have an apple ...

  10. Linux 命令行 Tricks

    区分文件和目录: ls -F ls -F -R:递归显示目录 仅改变文件的修改时间,而不修改文件的内容: touch filename: 使用 file 命令查看文件类型: ASCII text di ...