| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056 |
- // 近七日出入库数据折线图
- const drawDaysChart = () => {
- const option = {
- color: ['#23CF9C', '#578FFB'],
- legend: {
- show: true,
- top: '6%',
- itemWidth: 30, // 图例标记的图形宽度。
- // itemGap: 20, // 图例每项之间的间隔。
- itemHeight: 10, // 图例标记的图形高度。
- textStyle: {
- color: '#fff',
- fontSize: 14,
- padding: [0, 8, 0, 8]
- }
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow',
- },
- },
- grid: {
- top: '20%',
- left: '4%',
- right: '4%',
- bottom: '10%',
- containLabel: true,
- },
- xAxis: [
- {
- type: 'category',
- boundaryGap: false,
- axisLine: {
- //坐标轴轴线相关设置。数学上的x轴
- show: true,
- lineStyle: {
- color: 'rgb(41,188,245)',
- },
- },
- axisLabel: {
- //坐标轴刻度标签的相关设置
- textStyle: {
- color: '#FFFFFF',
- fontSize: 12,
- },
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: '#233653',
- },
- },
- axisTick: {
- show: false,
- },
- data: [],
- },
- ],
- yAxis: [
- {
- name: "",
- nameTextStyle: {
- color: "#fff",
- fontSize: 12,
- padding: [0, 60, 0, 0]
- },
- // minInterval: 1,
- type: 'value',
- splitLine: {
- show: true,
- lineStyle: {
- color: '#1160a0',
- type: 'dashed'
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#008de7',
- },
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: '#fff',
- fontSize: 14
- }
- },
- axisTick: {
- show: false,
- },
- },
- ],
- series: [
- {
- name: '出库',
- type: 'line',
- smooth: true,
- showSymbol: false,
- symbol: 'circle',
- zlevel: 3,
- areaStyle: {
- color: {
- type: 'linear',
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- colorStops: [ // 渐变颜色
- {
- offset: 0,
- color: 'rgba(36, 214, 214, 0.6)',
- },
- {
- offset: 1,
- color: 'rgba(36, 214, 214, 0)',
- },
- ],
- global: false,
- },
- },
- data: [],
- },
- {
- name: '入库',
- type: 'line',
- smooth: true,
- showSymbol: false,
- symbol: 'circle',
- zlevel: 3,
- areaStyle: {
- color: {
- type: 'linear',
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- colorStops: [ // 渐变颜色
- {
- offset: 0,
- color: 'rgba(61, 132, 247, 0.6)',
- },
- {
- offset: 1,
- color: 'rgba(61, 132, 247, 0)',
- },
- ],
- global: false,
- },
- },
- data: [],
- },
- ],
- }
- return option
- }
- // 今日出入库按货位分柱状图
- const drawPositionChart = () => {
- const option = {
- xAxis: [//x轴
- {
- type: 'category',//坐标轴类型 离散
- data: ['工装', '设备', '成品', '立体', '地面'],//数据
- axisTick: false,//是否显示刻度
- axisLine: {//坐标轴样式
- show: true,//是否显示
- lineStyle: {
- color: 'rgb(41,188,245)',
- },
- },
- axisLabel: {
- color: "#DEDEDE"
- }
- },
- ],
- yAxis: [//y轴
- {
- name: '',//名称
- type: 'value',//连续类型
- axisLine: {//坐标轴样式
- show: false, //不显示
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#1160a0',
- type: 'dashed'
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#008de7',
- },
- },
- },
- ],
- series: [//系统列表
- {
- name: '出库',//名称
- type: 'bar',//类型
- barWidth: 11,//宽度
- z: 2,
- itemStyle: {
- color: {//渐变色
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- type: 'linear',
- global: false,
- colorStops: [
- {
- offset: 0,
- color: 'rgba(6, 244, 231)',
- },
- {
- offset: 1,
- color: 'rgba(6, 244, 231,0)',
- },
- ],
- },
- },
- data: [],//数值
- },
- {
- name: '入库',
- type: 'bar',
- barWidth: 11,
- z: 1,
- itemStyle: {
- color: {
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- type: 'linear',
- global: false,
- colorStops: [
- {
- offset: 0,
- color: 'rgba(3, 181, 243)',
- },
- {
- offset: 1,
- color: 'rgba(2, 190, 251,0)',
- },
- ],
- },
- },
- data: [],
- },
- ],
- legend: {
- show: true,
- top: '1%',
- itemWidth: 30, // 图例标记的图形宽度。
- // itemGap: 20, // 图例每项之间的间隔。
- itemHeight: 10, // 图例标记的图形高度。
- textStyle: {
- color: '#fff',
- fontSize: 14,
- padding: [0, 8, 0, 8]
- }
- },
- }
- return option
- }
- // 年领用统计柱折图
- const drawYearChart = () => {
- const option = {
- color: ['#3398DB'],
- legend: {
- show: true,
- top: '8%',
- itemWidth: 30, // 图例标记的图形宽度。
- // itemGap: 20, // 图例每项之间的间隔。
- itemHeight: 10, // 图例标记的图形高度。
- textStyle: {
- color: '#fff',
- fontSize: 14,
- padding: [0, 8, 0, 8]
- }
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [
- {
- type: 'category',
- data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
- axisTick: {
- alignWithLabel: true
- },
- //x底部文字
- axisLabel: {
- textStyle: {
- color: '#fff'
- }
- },
- axisLine: {//坐标轴样式
- show: true,//是否显示
- lineStyle: {
- color: 'rgb(41,188,245)',
- },
- },
- }
- ],
- yAxis: [
- {
- type: 'value',
- //y右侧文字
- axisLabel: {
- textStyle: {
- color: '#fff'
- }
- },
- // y轴的分割线
- splitLine: {
- show: true,
- lineStyle: {
- color: '#1160a0',
- type: 'dashed'
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#008de7',
- },
- },
- }
- ],
- series: [
- {
- name: '总领用',
- type: 'line',
- smooth: true,
- showSymbol: false,
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: 'line' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- areaStyle: {
- opacity: 0.2,
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#36d9ab'
- },
- {
- offset: 1,
- color: '#02137c'
- }
- ])
- },
- data: []
- },
- {
- name: '设备领用',
- type: 'bar',
- barWidth: '15',
- itemStyle: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- { offset: 0, color: 'rgba(68,182,131, 0.9)' },
- { offset: 0.5, color: 'rgba(92,218,248, 0.5)' },
- ])
- },
- data: []
- },
- {
- name: '工装领用',
- type: 'bar',
- barWidth: '15',
- itemStyle: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- { offset: 0, color: '#6a8ffd' },
- { offset: 1, color: '#56cbfe' }
- ])
- },
- data: []
- },
- ]
- }
- return option
- }
- // 今日出入库数据按类型分
- const drawTypeChart = () => {
- var colorList = ['#7ed4ac', '#fe9c3a', '#ebd571', '#eb7c6f', '#0bb4d7', '#8fcde5', '#00c973'];
- var seriesData = [
- {
- name: '工装入库数', //模块名称
- value: '0', //占比
- },
- {
- name: '工装出库数', //模块名称
- value: '0', //占比
- },
- {
- name: '设备入库数', //模块名称
- value: '0', //占比
- },
- {
- name: '设备出库数', //模块名称
- value: '0', //占比
- },
- {
- name: '成品入库数', //模块名称
- value: '0', //占比
- },
- {
- name: '成品出库数', //模块名称
- value: '0', //占比
- },
- ];
- const option = {
- color: colorList,
- title: [
- {
- text: '今日出\n入库数据',
- left: 'center',
- top: 'center',
- textStyle: {
- color: '#fff',
- fontSize: 16,
- fontWeight: 'bold'
- }
- }
- ],
- tooltip: {
- trigger: 'item',
- borderColor: 'rgba(255,255,255,.3)',
- backgroundColor: 'rgba(13,5,30,.6)',
- borderWidth: 1,
- padding: 5,
- textStyle: {
- fontSize: 14,
- color: '#fff',
- },
- },
- series: [
- {
- name: '类型',
- type: 'pie',
- radius: ['25%', '45%'],
- center: ['50%', '50%'],
- data: seriesData,
- hoverAnimation: true,
- itemStyle: {
- normal: {
- borderColor: colorList,
- borderWidth: 0,
- },
- },
- labelLine: {
- normal: {
- lineStyle: {
- color: '#e6e6e6',
- },
- },
- },
- label: {
- normal: {
- show: true,
- position: 'outside',
- formatter: function (params) {
- const color = colorList[params.dataIndex % colorList.length];
- return `{name|${params.name}}\n{value${params.dataIndex}|${params.value}件}`;
- },
- rich: {
- name: {
- fontSize: 14,
- fontWeight: 'bold',
- padding: [0, 0, 5, 0],
- color: '#fff',
- align: 'center'
- },
- value0: {
- fontSize: 16,
- fontWeight: 'bold',
- color: colorList[0],
- align: 'center',
- padding: [5, 0, 0, 0]
- },
- value1: {
- fontSize: 16,
- fontWeight: 'bold',
- color: colorList[1],
- align: 'center',
- padding: [5, 0, 0, 0]
- },
- value2: {
- fontSize: 16,
- fontWeight: 'bold',
- color: colorList[2],
- align: 'center',
- padding: [5, 0, 0, 0]
- },
- value3: {
- fontSize: 16,
- fontWeight: 'bold',
- color: colorList[3],
- align: 'center',
- padding: [5, 0, 0, 0]
- },
- value4: {
- fontSize: 16,
- fontWeight: 'bold',
- color: colorList[4],
- align: 'center',
- padding: [5, 0, 0, 0]
- },
- value5: {
- fontSize: 16,
- fontWeight: 'bold',
- color: colorList[5],
- align: 'center',
- padding: [5, 0, 0, 0]
- }
- },
- },
- },
- },
- ],
- };
- return option
- }
- // Top5
- const drawTopChart = () => {
- var yData = [
- '',
- '',
- '',
- '',
- '',
- ];
- var data = [0, 0, 0, 0, 0];
- const option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'none',
- },
- formatter: function (params) {
- if (!params || !params.length || !params[0] || !params[0].name) return '';
- return params[0].name + ' : ' + params[0].value;
- },
- },
- xAxis: {
- show: false,
- type: 'value',
- },
- grid: {
- right: '12%',
- left: '30%',
- top: '14%',
- bottom: '20%',
- },
- yAxis: [
- {
- name: '',
- type: 'category',
- inverse: true,
- boundaryGap: false,
- offset: 100,
- axisLabel: {
- show: true,
- align: 'left',
- textStyle: {
- color: '#fff',
- fontSize: '14',
- },
- formatter: function (value, index) {
- if (!value) return '';
-
- // 对value进行长度限制,小于5个字符完整显示,否则截取前5个字符并添加省略号
- var formattedValue = value.length < 5 ? value : value.substring(0, 5) + '...';
-
- var num = '';
- var str = '';
- num = index + 1;
- if (index === 0) {
- str = '{no1|' + '} {num1|' + num + '} {title1| ' + formattedValue + '}';
- } else if (index === 1) {
- str = '{no2|' + '} {num2|' + num + '} {title2| ' + formattedValue + '}';
- } else if (index === 2) {
- str = '{no3|' + '} {num3|' + num + '} {title3| ' + formattedValue + '}';
- } else {
- str = ' {num|' + num + '} {title| ' + formattedValue + '}';
- }
- return str;
- },
- rich: {
- num: {
- color: '#387ec1',
- width: 10,
- height: 10,
- fontSize: 14,
- padding: [6, 5, 3, 5],
- align: 'center',
- shadowColor: '#3374ba',
- borderColor: '#3374ba',
- borderWidth: 1,
- },
- num1: {
- color: '#51aff8',
- backgroundColor: '#112b67',
- width: 10,
- height: 10,
- fontSize: 14,
- padding: [7, 5, 3, 5],
- align: 'center',
- shadowColor: '#4db2ff',
- borderColor: '#4db2ff',
- borderWidth: 1,
- },
- num2: {
- color: '#51aff8',
- backgroundColor: '#112b67',
- width: 10,
- height: 10,
- fontSize: 14,
- padding: [7, 5, 3, 5],
- align: 'center',
- shadowColor: '#4db2ff',
- borderColor: '#4db2ff',
- borderWidth: 1,
- },
- num3: {
- color: '#51aff8',
- backgroundColor: '#112b67',
- width: 10,
- height: 10,
- fontSize: 14,
- padding: [7, 5, 3, 5],
- align: 'center',
- shadowColor: '#4db2ff',
- borderColor: '#4db2ff',
- borderWidth: 1,
- },
- },
- },
- splitLine: {
- show: false,
- },
- axisTick: {
- show: false,
- },
- axisLine: {
- show: false,
- },
- data: yData,
- },
- ],
- series: [
- {
- name: '值',
- type: 'bar',
- zlevel: 1,
- barCategoryGap: '20%',
- itemStyle: {
- normal: {
- // barBorderRadius: 30,
- color: {
- type: 'linear',
- x: 0,
- y: 0,
- x2: 1,
- y2: 0,
- colorStops: [
- { offset: 0, color: '#2770a2' },
- { offset: 1, color: '#00d0ff' },
- ],
- global: false,
- },
- },
- },
- label: {
- normal: {
- show: true,
- position: "right",
- valueAnimation: true,
- offset: [5, -2],
- textStyle: {
- color: "#F5F5F5",
- fontSize: 13,
- },
- formatter: function (params) {
- if (!params || !params.name || params.value === 0 || params.value === '0') return '';
- return params.value;
- }
- },
- },
- barWidth: 22,
- data: data,
- },
- ],
- };
- return option
- }
- // 工装设备检验图表
- const drawCheckoutChart = () => {
- const option = {
- color: ['#e8bc64', '#2c90ee'],
- legend: {
- show: true,
- top: '6%',
- itemWidth: 30, // 图例标记的图形宽度。
- // itemGap: 20, // 图例每项之间的间隔。
- itemHeight: 10, // 图例标记的图形高度。
- textStyle: {
- color: '#fff',
- fontSize: 14,
- padding: [0, 8, 0, 8]
- }
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow',
- },
- },
- grid: {
- top: '20%',
- left: '4%',
- right: '4%',
- bottom: '10%',
- containLabel: true,
- },
- xAxis: [
- {
- type: 'category',
- boundaryGap: false,
- axisLine: {
- //坐标轴轴线相关设置。数学上的x轴
- show: true,
- lineStyle: {
- color: 'rgb(41,188,245)',
- },
- },
- axisLabel: {
- //坐标轴刻度标签的相关设置
- textStyle: {
- color: '#FFFFFF',
- fontSize: 12,
- },
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: '#233653',
- },
- },
- axisTick: {
- show: false,
- },
- data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
- },
- ],
- yAxis: [
- {
- name: "",
- nameTextStyle: {
- color: "#fff",
- fontSize: 12,
- padding: [0, 60, 0, 0]
- },
- // minInterval: 1,
- type: 'value',
- splitLine: {
- show: true,
- lineStyle: {
- color: '#1160a0',
- type: 'dashed'
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#008de7',
- },
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: '#fff',
- fontSize: 14
- }
- },
- axisTick: {
- show: false,
- },
- },
- ],
- series: [
- {
- name: '工装',
- type: 'line',
- smooth: true,
- showSymbol: false,
- symbol: 'circle',
- zlevel: 3,
- areaStyle: {
- color: {
- type: 'linear',
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- colorStops: [ // 渐变颜色
- {
- offset: 0,
- color: 'rgba(225, 188, 69)',
- },
- {
- offset: 1,
- color: 'rgba(66, 78, 65)',
- },
- ],
- global: false,
- },
- },
- data: [],
- },
- {
- name: '设备',
- type: 'line',
- smooth: true,
- showSymbol: false,
- symbol: 'circle',
- zlevel: 3,
- areaStyle: {
- color: {
- type: 'linear',
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- colorStops: [ // 渐变颜色
- {
- offset: 0,
- color: 'rgba(61, 132, 247, 0.6)',
- },
- {
- offset: 1,
- color: 'rgba(61, 132, 247, 0)',
- },
- ],
- global: false,
- },
- },
- data: [],
- },
- ],
- }
- return option
- }
- // Agv年任务统计图
- const drawAgvYearChart = () => {
- const option = {
- xAxis: [//x轴
- {
- type: 'category',//坐标轴类型 离散
- data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
- axisTick: false,//是否显示刻度
- axisLine: {//坐标轴样式
- show: true,//是否显示
- lineStyle: {
- color: 'rgb(41,188,245)',
- },
- },
- axisLabel: {
- color: "#DEDEDE"
- }
- },
- ],
- yAxis: [//y轴
- {
- name: '',//名称
- type: 'value',//连续类型
- axisLine: {//坐标轴样式
- show: false, //不显示
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#1160a0',
- type: 'dashed'
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#008de7',
- },
- },
- },
- ],
- series: [//系统列表
- {
- name: '地面库',//名称
- type: 'bar',//类型
- barWidth: 11,//宽度
- z: 2,
- itemStyle: {
- color: {//渐变色
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- type: 'linear',
- global: false,
- colorStops: [
- {
- offset: 0,
- color: '#dbcc5b',
- },
- {
- offset: 1,
- color: '#393218',
- },
- ],
- },
- },
- data: [],//数值
- },
- {
- name: '立体库',
- type: 'bar',
- barWidth: 11,
- z: 1,
- itemStyle: {
- color: {
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- type: 'linear',
- global: false,
- colorStops: [
- {
- offset: 0,
- color: '#2891ed',
- },
- {
- offset: 1,
- color: '#132243',
- },
- ],
- },
- },
- data: [],
- },
- ],
- legend: {
- show: true,
- top: '1%',
- itemWidth: 30, // 图例标记的图形宽度。
- // itemGap: 20, // 图例每项之间的间隔。
- itemHeight: 10, // 图例标记的图形高度。
- textStyle: {
- color: '#fff',
- fontSize: 14,
- padding: [0, 8, 0, 8]
- }
- },
- }
- return option
- }
- // AGV任务执行统计
- const drawAgvTotalChart = () => {
- option = {
- color: ['#e1c838', '#208ff8'],
- tooltip: {
- trigger: 'item',
- },
- legend: {
- type: "scroll",
- orient: 'vertical',
- left: '1%',
- top: '15%',
- align: 'left',
- textStyle: {
- color: '#fff'
- },
- },
- series: [
- {
- name: '任务统计',
- type: 'pie',
- radius: [30, 98],
- center: ['50%', '50%'],
- roseType: 'area',
- label: {
- show: true, // 是否显示
- position: 'outside', // 标签的位置
- formatter: function (params) { // 标签内容格式器
- return `{a|${params.name}(${params.value})}`
- },
- rich: { // 自定义富文本样式
- a: {
- padding: [10, -10, -50, -1], // 边距
- fontSize: '0.16rem', // 字号
- color: '#fff', // 字体颜色
- },
- b: {
- padding: [0, -80, 55, -80], // 边距
- fontSize: '0.16rem', // 字号
- color: '#ffff', // 字体颜色
- },
- }
- },
-
- data: [
- { value: 0, name: '未完成' },
- { value: 0, name: '已完成' },
- ],
- },
- ],
- }
- return option
- }
- // 初始化图表
- const initChart = (chart, chartOption) => {
- chart && chart.resize();
- chart && chart.clear(); // 清除上次的数据
- chart && chart.setOption(chartOption, true); // 参数配置
- }
|