123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431 |
- var quxianChart = function(options){
- var series0data = options.series[0].data || [];
- var yAxisData = options.xAxis[0].data;
- var option = {
- "title": {
- "text": "区县分布",
- "x": "center",
- "textStyle": {
- color: ['#b5e1fc']
- },
- "padding": [10, 0, 0, 0]
- },
- "tooltip": {
- "trigger": "axis"
- },
- grid: {
- top: 80,
- bottom: 30,
- left: 80
- },
- "yAxis": [{
- "type": "category",
- "name": "人次",
- "data": yAxisData,
- axisPointer: {
- type: 'shadow'
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc'
- },
- nameTextStyle: {
- color: '#b5e1fc'
- }
- }],
- "xAxis": [{
- "type": "value",
- axisPointer: {
- type: 'shadow'
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#fff'
- },
- splitLine: {
- show: false // 不显示坐标轴刻度
- }
- }],
- "series": [{
- "smooth": true,
- "name": "区县分布",
- "type": "bar",
- barWidth: 20,
- "label": {
- show: false,
- position: "right"
- },
- "itemStyle": {
- "normal": {
- "lineStyle": {
- "shadowColor": "rgba(0,0,0,0.4)"
- },
- barBorderRadius: [0, 8, 8, 0],
- color: '#00e6f3'
- }
- },
- "data": series0data
- }, ]
- }
- return option
- },
- xingbieChart = function(options){
- console.log(options)
- var title = options.title.text;
- var data = options.series[0].data;
- var legend = data.map(function(item){
- return item.name;
- })
- var option = {
- "title": {
- "text": title,
- "x": "center",
- "textStyle": {
- color: ['#b5e1fc']
- },
- "padding": [10, 0, 0, 0]
- },
- "tooltip": {
- "trigger": "item"
- },
- legend: {
- orient: 'vertical',
- // x: 'right',
- data: legend,
- right: '25%',
- top: '40%',
- textStyle: {
- color: ['#b5e1fc']
- }
- },
- "series": [{
- "center": [
- "35%",
- "50%"
- ],
- radius: ['30%', '40%'],
- "name": "",
- "type": "pie",
- "itemStyle": {
- "normal": {
- "label": {
- "show": false
- },
- "labelLine": {
- "show": false
- }
- }
- },
- "data": data
- }]
- }
- return option
- },
- jibingTopChart = function(options){
- debugger
- var title = options.title.text;
- var yAxisData = (options.xAxis[0].data && options.xAxis[0].data.reverse()) || [];
- var xAxisData = (options.series[0].data && options.series[0].data.reverse()) || [];
- var option = {
- "title": {
- "text": title,
- "x": "center",
- "textStyle": {
- color: ['#b5e1fc']
- },
- "padding": [10, 0, 0, 0]
- },
- "tooltip": {
- "trigger": "axis"
- },
- grid: {
- top: 40,
- bottom: 30,
- left: 80,
- right:20
- },
- "yAxis": [{
- "type": "category",
- "name": "",
- "data": yAxisData,
- axisPointer: {
- type: 'shadow'
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc',
- formatter(v){
- return getBrStr(v,5,true);
- }
- },
- nameTextStyle: {
- color: '#b5e1fc'
- },
- }],
- "xAxis": [{
- "type": "value",
- axisPointer: {
- type: 'shadow'
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#fff'
- },
- splitLine: {
- show: false // 不显示坐标轴刻度
- }
- }],
- "series": [{
- "smooth": true,
- "name": "并发症排行",
- "type": "bar",
- barWidth: 20,
- "label": {
- show: false,
- position: "right"
- },
- "itemStyle": {
- "normal": {
- "lineStyle": {
- "shadowColor": "rgba(0,0,0,0.4)"
- },
- barBorderRadius: [0, 8, 8, 0],
- color: '#00e6f3'
- }
- },
- "data": xAxisData
- }, ]
- }
- return option
- },
- qushiChart = function(options){
- debugger
- console.log(options);
- var title = options.title.text;
- var xAxisData = options.xAxis[0].data;
- var series0data = options.series[0].data || [];
- var series1data = options.series[1].data || [];
- var option = {
- "title": {
- "text": title,
- "x": "center",
- textStyle: {
- color: '#b5e1fc',
- fontSize: 16,
- fontWeight: 'bold'
- },
- "padding": [10, 0, 0, 0]
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- crossStyle: {
- color: '#fff'
- }
- }
- },
- "grid": {
- top: '90',
- left: '60',
- bottom:'25',
- right:'60'
- },
- legend: {
- data: ['新增人数', '环比'],
- textStyle: {
- color: '#b5e1fc'
- },
- top: '45'
- },
- xAxis: [{
- type: 'category',
- "data": xAxisData,
- axisPointer: {
- type: 'shadow'
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc'
- }
- }],
- yAxis: [{
- type: 'value',
- name: '新增人数',
- nameTextStyle: {
- color: '#b5e1fc' // 坐标轴名称颜色
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc'
- }
- },
- {
- type: 'value',
- name: '环比',
- nameTextStyle: {
- color: '#b5e1fc' // 坐标轴名称颜色
- },
- splitLine: {
- show: false // 不显示坐标轴刻度
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e' // 坐标轴轴线颜色
- }
- },
- axisLabel: {
- color: '#b5e1fc' // 坐标轴刻度标签文本颜色
- }
- }
- ],
- series: [{
- name: '新增人数',
- type: 'bar',
- "data":series0data,
- barWidth: 20,
- label: {
- normal: {
- show: true,
- position: 'top', // 在柱状图上方显示
- color: '#fff' // 柱状图上方显示的数值颜色
- }
- },
- itemStyle: {
- barBorderRadius: [8, 8, 0, 0],
- color: '#00e6f3'
- }
- },
- {
- name: '环比',
- type: 'line',
- yAxisIndex: 1,
- "data": series1data,
- itemStyle: {
- color: '#03fa6d'
- }
- }
- ]
- }
- return option
- },
- nianlingChart = function(options){
- var title = options.title.text;
- var data = options.series[0].data
- var legend = data.map(function(item){
- return item.name;
- })
- var option = {
- "title": {
- "text": title,
- "x": "center",
- "textStyle": {
- color: ['#b5e1fc']
- },
- "padding": [10, 0, 0, 0]
- },
- "tooltip": {
- "trigger": "item"
- },
- legend: {
- orient: 'vertical',
- data: legend,
- right: '15%',
- top: '25%',
- textStyle: {
- color: ['#b5e1fc']
- }
- },
- "series": [{
- "center": [
- "35%",
- "50%"
- ],
- radius: ['30%', '40%'],
- "name": "",
- "type": "pie",
- "itemStyle": {
- "normal": {
- "label": {
- "show": false
- },
- "labelLine": {
- "show": false
- }
- }
- },
- "data": data
- }]
- }
- return option
- }
- function getBrStr(str,num,yRoute2){
- if(!str)return ''
- var newParamsName = "";// 最终拼接成的字符串
- var provideNumber = num || 10;// 每行能显示的字的个数
- var strArr=str.split('');
- if(strArr.length>15 && num && !yRoute2) { //如果是Y轴 TOP5的 最多显示两行 然后用省略号
- strArr = strArr.slice(0,9)
- strArr.push('...')
- }
- else if(yRoute2 && strArr.length >5){
- strArr = strArr.slice(0,4)
- strArr.push('...');
- }
- strArr.map((v,i)=>{
- var str =v;
- if(i!=0 && (i+1)%provideNumber == 0 && !yRoute2){
- str+='\n';
- num++;
- }
-
- newParamsName+=str
- })
- return newParamsName
- }
|