From 92230c9a97dc9ce9df3313d11d26999c04bb6b26 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期二, 15 七月 2025 13:12:48 +0800 Subject: [PATCH] 项目初始化 --- src/components/qiun-data-charts/js_sdk/u-charts/config-ucharts.js | 606 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 606 insertions(+), 0 deletions(-) diff --git a/src/components/qiun-data-charts/js_sdk/u-charts/config-ucharts.js b/src/components/qiun-data-charts/js_sdk/u-charts/config-ucharts.js new file mode 100644 index 0000000..17b28b3 --- /dev/null +++ b/src/components/qiun-data-charts/js_sdk/u-charts/config-ucharts.js @@ -0,0 +1,606 @@ +/* + * uCharts庐 + * 楂樻�ц兘璺ㄥ钩鍙板浘琛ㄥ簱锛屾敮鎸丠5銆丄PP銆佸皬绋嬪簭锛堝井淇�/鏀粯瀹�/鐧惧害/澶存潯/QQ/360锛夈�乂ue銆乀aro绛夋敮鎸乧anvas鐨勬鏋跺钩鍙� + * Copyright (c) 2021 QIUN庐绉嬩簯 https://www.ucharts.cn All rights reserved. + * Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) + * 澶嶅埗浣跨敤璇蜂繚鐣欐湰娈垫敞閲婏紝鎰熻阿鏀寔寮�婧愶紒 + * + * uCharts庐瀹樻柟缃戠珯 + * https://www.uCharts.cn + * + * 寮�婧愬湴鍧�: + * https://gitee.com/uCharts/uCharts + * + * uni-app鎻掍欢甯傚満鍦板潃锛� + * http://ext.dcloud.net.cn/plugin?id=271 + * + */ + +// 涓婚棰滆壊閰嶇疆锛氬姣忎釜鍥捐〃绫诲瀷闇�瑕佷笉鍚屼富棰橈紝璇峰湪瀵瑰簲鍥捐〃绫诲瀷涓婃洿鏀筩olor灞炴�� +const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc']; + +//浜嬩欢杞崲鍑芥暟锛屼富瑕佺敤浣滄牸寮忓寲x杞翠负鏃堕棿杞达紝鏍规嵁闇�姹傝嚜琛屼慨鏀� +const formatDateTime = (timeStamp, returnType)=>{ + var date = new Date(); + date.setTime(timeStamp * 1000); + var y = date.getFullYear(); + var m = date.getMonth() + 1; + m = m < 10 ? ('0' + m) : m; + var d = date.getDate(); + d = d < 10 ? ('0' + d) : d; + var h = date.getHours(); + h = h < 10 ? ('0' + h) : h; + var minute = date.getMinutes(); + var second = date.getSeconds(); + minute = minute < 10 ? ('0' + minute) : minute; + second = second < 10 ? ('0' + second) : second; + if(returnType == 'full'){return y + '-' + m + '-' + d + ' '+ h +':' + minute + ':' + second;} + if(returnType == 'y-m-d'){return y + '-' + m + '-' + d;} + if(returnType == 'h:m'){return h +':' + minute;} + if(returnType == 'h:m:s'){return h +':' + minute +':' + second;} + return [y, m, d, h, minute, second]; +} + +const cfu = { + //demotype涓鸿嚜瀹氫箟鍥捐〃绫诲瀷锛屼竴鑸笉闇�瑕佽嚜瀹氫箟鍥捐〃绫诲瀷锛屽彧闇�瑕佹敼鏍硅妭鐐逛笂瀵瑰簲鐨勭被鍨嬪嵆鍙� + "type":["pie","ring","rose","word","funnel","map","arcbar","line","column","mount","bar","area","radar","gauge","candle","mix","tline","tarea","scatter","bubble","demotype"], + "range":["楗肩姸鍥�","鍦嗙幆鍥�","鐜懓鍥�","璇嶄簯鍥�","婕忔枟鍥�","鍦板浘","鍦嗗姬杩涘害鏉�","鎶樼嚎鍥�","鏌辩姸鍥�","灞卞嘲鍥�","鏉$姸鍥�","鍖哄煙鍥�","闆疯揪鍥�","浠〃鐩�","K绾垮浘","娣峰悎鍥�","鏃堕棿杞存姌绾�","鏃堕棿杞村尯鍩�","鏁g偣鍥�","姘旀场鍥�","鑷畾涔夌被鍨�"], + //澧炲姞鑷畾涔夊浘琛ㄧ被鍨嬶紝濡傛灉闇�瑕乧ategories锛岃鍦ㄨ繖閲屽姞鍏ユ偍鐨勫浘琛ㄧ被鍨嬶紝渚嬪鏈�鍚庣殑"demotype" + //鑷畾涔夌被鍨嬫椂闇�瑕佹敞鎰�"tline","tarea","scatter","bubble"绛夋椂闂磋酱锛堢煝閲弜杞达級绫诲浘琛紝娌℃湁categories锛屼笉闇�瑕佸姞鍏ategories + "categories":["line","column","mount","bar","area","radar","gauge","candle","mix","demotype"], + //instance涓哄疄渚嬪彉閲忔壙杞藉睘鎬э紝涓嶈鍒犻櫎 + "instance":{}, + //option涓簅pts鍙奺opts鎵胯浇灞炴�э紝涓嶈鍒犻櫎 + "option":{}, + //涓嬮潰鏄嚜瀹氫箟format閰嶇疆锛屽洜闄5绔鐨勫叾浠栫鏃犳硶閫氳繃props浼犻�掑嚱鏁帮紝鍙兘閫氳繃姝ゅ睘鎬у搴斾笅鏍囩殑鏂瑰紡鏉ユ浛鎹� + "formatter":{ + "yAxisDemo1":function(val, index, opts){return val+'鍏�'}, + "yAxisDemo2":function(val, index, opts){return val.toFixed(2)}, + "xAxisDemo1":function(val, index, opts){return val+'骞�';}, + "xAxisDemo2":function(val, index, opts){return formatDateTime(val,'h:m')}, + "seriesDemo1":function(val, index, series, opts){return val+'鍏�'}, + "tooltipDemo1":function(item, category, index, opts){ + if(index==0){ + return '闅忎究鐢�'+item.data+'骞�' + }else{ + return '鍏朵粬鎴戞病鏀�'+item.data+'澶�' + } + }, + "pieDemo":function(val, index, series, opts){ + if(index !== undefined){ + return series[index].name+'锛�'+series[index].data+'鍏�' + } + }, + }, + //杩欓噷婕旂ず浜嗚嚜瀹氫箟鎮ㄧ殑鍥捐〃绫诲瀷鐨刼ption锛屽彲浠ラ殢鎰忓懡鍚嶏紝涔嬪悗鍦ㄧ粍浠朵笂 type="demotype" 鍚庯紝缁勪欢浼氳皟鐢ㄨ繖涓姳鎷彿閲岀殑option锛屽鏋滅粍浠朵笂杩樺瓨鍦╫pts鍙傛暟锛屼細灏哾emotype涓巓pts涓璷ption鍚堝苟鍚庢覆鏌撳浘琛ㄣ�� + "demotype":{ + //鎴戣繖閲屾妸鏇茬嚎鍥惧綋鍋氫簡鑷畾涔夊浘琛ㄧ被鍨嬶紝鎮ㄥ彲浠ユ牴鎹渶瑕侀殢鎰忔寚瀹氱被鍨嬫垨閰嶇疆 + "type": "line", + "color": color, + "padding": [15,10,0,15], + "xAxis": { + "disableGrid": true, + }, + "yAxis": { + "gridType": "dash", + "dashLength": 2, + }, + "legend": { + }, + "extra": { + "line": { + "type": "curve", + "width": 2 + }, + } + }, + //涓嬮潰鏄嚜瀹氫箟閰嶇疆锛岃娣诲姞椤圭洰鎵�闇�鐨勯�氱敤閰嶇疆 + "pie":{ + "type": "pie", + "color": color, + "padding": [5,5,5,5], + "extra": { + "pie": { + "activeOpacity": 0.5, + "activeRadius": 10, + "offsetAngle": 0, + "labelWidth": 15, + "border": true, + "borderWidth": 3, + "borderColor": "#FFFFFF" + }, + } + }, + "ring":{ + "type": "ring", + "color": color, + "padding": [5,5,5,5], + "rotate": false, + "dataLabel": true, + "legend": { + "show": true, + "position": "right", + "lineHeight": 25, + }, + "title": { + "name": "鏀剁泭鐜�", + "fontSize": 15, + "color": "#666666" + }, + "subtitle": { + "name": "70%", + "fontSize": 25, + "color": "#7cb5ec" + }, + "extra": { + "ring": { + "ringWidth":30, + "activeOpacity": 0.5, + "activeRadius": 10, + "offsetAngle": 0, + "labelWidth": 15, + "border": true, + "borderWidth": 3, + "borderColor": "#FFFFFF" + }, + }, + }, + "rose":{ + "type": "rose", + "color": color, + "padding": [5,5,5,5], + "legend": { + "show": true, + "position": "left", + "lineHeight": 25, + }, + "extra": { + "rose": { + "type": "area", + "minRadius": 50, + "activeOpacity": 0.5, + "activeRadius": 10, + "offsetAngle": 0, + "labelWidth": 15, + "border": false, + "borderWidth": 2, + "borderColor": "#FFFFFF" + }, + } + }, + "word":{ + "type": "word", + "color": color, + "extra": { + "word": { + "type": "normal", + "autoColors": false + } + } + }, + "funnel":{ + "type": "funnel", + "color": color, + "padding": [15,15,0,15], + "extra": { + "funnel": { + "activeOpacity": 0.3, + "activeWidth": 10, + "border": true, + "borderWidth": 2, + "borderColor": "#FFFFFF", + "fillOpacity": 1, + "labelAlign": "right" + }, + } + }, + "map":{ + "type": "map", + "color": color, + "padding": [0,0,0,0], + "dataLabel": true, + "extra": { + "map": { + "border": true, + "borderWidth": 1, + "borderColor": "#666666", + "fillOpacity": 0.6, + "activeBorderColor": "#F04864", + "activeFillColor": "#FACC14", + "activeFillOpacity": 1 + }, + } + }, + "arcbar":{ + "type": "arcbar", + "color": color, + "title": { + "name": "鐧惧垎姣�", + "fontSize": 25, + "color": "#00FF00" + }, + "subtitle": { + "name": "榛樿鏍囬", + "fontSize": 15, + "color": "#666666" + }, + "extra": { + "arcbar": { + "type": "default", + "width": 12, + "backgroundColor": "#E9E9E9", + "startAngle": 0.75, + "endAngle": 0.25, + "gap": 2 + } + } + }, + "line":{ + "type": "line", + "color": color, + "padding": [15,10,0,15], + "xAxis": { + "disableGrid": true, + }, + "yAxis": { + "gridType": "dash", + "dashLength": 2, + }, + "legend": { + }, + "extra": { + "line": { + "type": "straight", + "width": 2, + "activeType": "hollow" + }, + } + }, + "tline":{ + "type": "line", + "color": color, + "padding": [15,10,0,15], + "xAxis": { + "disableGrid": false, + "boundaryGap":"justify", + }, + "yAxis": { + "gridType": "dash", + "dashLength": 2, + "data":[ + { + "min":0, + "max":80 + } + ] + }, + "legend": { + }, + "extra": { + "line": { + "type": "curve", + "width": 2, + "activeType": "hollow" + }, + } + }, + "tarea":{ + "type": "area", + "color": color, + "padding": [15,10,0,15], + "xAxis": { + "disableGrid": true, + "boundaryGap":"justify", + }, + "yAxis": { + "gridType": "dash", + "dashLength": 2, + "data":[ + { + "min":0, + "max":80 + } + ] + }, + "legend": { + }, + "extra": { + "area": { + "type": "curve", + "opacity": 0.2, + "addLine": true, + "width": 2, + "gradient": true, + "activeType": "hollow" + }, + } + }, + "column":{ + "type": "column", + "color": color, + "padding": [15,15,0,5], + "xAxis": { + "disableGrid": true, + }, + "yAxis": { + "data":[{"min":0}] + }, + "legend": { + }, + "extra": { + "column": { + "type": "group", + "width": 30, + "activeBgColor": "#000000", + "activeBgOpacity": 0.08 + }, + } + }, + "mount":{ + "type": "mount", + "color": color, + "padding": [15,15,0,5], + "xAxis": { + "disableGrid": true, + }, + "yAxis": { + "data":[{"min":0}] + }, + "legend": { + }, + "extra": { + "mount": { + "type": "mount", + "widthRatio": 1.5, + }, + } + }, + "bar":{ + "type": "bar", + "color": color, + "padding": [15,30,0,5], + "xAxis": { + "boundaryGap":"justify", + "disableGrid":false, + "min":0, + "axisLine":false + }, + "yAxis": { + }, + "legend": { + }, + "extra": { + "bar": { + "type": "group", + "width": 30, + "meterBorde": 1, + "meterFillColor": "#FFFFFF", + "activeBgColor": "#000000", + "activeBgOpacity": 0.08 + }, + } + }, + "area":{ + "type": "area", + "color": color, + "padding": [15,15,0,15], + "xAxis": { + "disableGrid": true, + }, + "yAxis": { + "gridType": "dash", + "dashLength": 2, + }, + "legend": { + }, + "extra": { + "area": { + "type": "straight", + "opacity": 0.2, + "addLine": true, + "width": 2, + "gradient": false, + "activeType": "hollow" + }, + } + }, + "radar":{ + "type": "radar", + "color": color, + "padding": [5,5,5,5], + "dataLabel": false, + "legend": { + "show": true, + "position": "right", + "lineHeight": 25, + }, + "extra": { + "radar": { + "gridType": "radar", + "gridColor": "#CCCCCC", + "gridCount": 3, + "opacity": 0.2, + "max": 200, + "labelShow": true + }, + } + }, + "gauge":{ + "type": "gauge", + "color": color, + "title": { + "name": "66Km/H", + "fontSize": 25, + "color": "#2fc25b", + "offsetY": 50 + }, + "subtitle": { + "name": "瀹炴椂閫熷害", + "fontSize": 15, + "color": "#1890ff", + "offsetY": -50 + }, + "extra": { + "gauge": { + "type": "default", + "width": 30, + "labelColor": "#666666", + "startAngle": 0.75, + "endAngle": 0.25, + "startNumber": 0, + "endNumber": 100, + "labelFormat": "", + "splitLine": { + "fixRadius": 0, + "splitNumber": 10, + "width": 30, + "color": "#FFFFFF", + "childNumber": 5, + "childWidth": 12 + }, + "pointer": { + "width": 24, + "color": "auto" + } + } + } + }, + "candle":{ + "type": "candle", + "color": color, + "padding": [15,15,0,15], + "enableScroll": true, + "enableMarkLine": true, + "dataLabel": false, + "xAxis": { + "labelCount": 4, + "itemCount": 40, + "disableGrid": true, + "gridColor": "#CCCCCC", + "gridType": "solid", + "dashLength": 4, + "scrollShow": true, + "scrollAlign": "left", + "scrollColor": "#A6A6A6", + "scrollBackgroundColor": "#EFEBEF" + }, + "yAxis": { + }, + "legend": { + }, + "extra": { + "candle": { + "color": { + "upLine": "#f04864", + "upFill": "#f04864", + "downLine": "#2fc25b", + "downFill": "#2fc25b" + }, + "average": { + "show": true, + "name": ["MA5","MA10","MA30"], + "day": [5,10,20], + "color": ["#1890ff","#2fc25b","#facc14"] + } + }, + "markLine": { + "type": "dash", + "dashLength": 5, + "data": [ + { + "value": 2150, + "lineColor": "#f04864", + "showLabel": true + }, + { + "value": 2350, + "lineColor": "#f04864", + "showLabel": true + } + ] + } + } + }, + "mix":{ + "type": "mix", + "color": color, + "padding": [15,15,0,15], + "xAxis": { + "disableGrid": true, + }, + "yAxis": { + "disabled": false, + "disableGrid": false, + "splitNumber": 5, + "gridType": "dash", + "dashLength": 4, + "gridColor": "#CCCCCC", + "padding": 10, + "showTitle": true, + "data": [] + }, + "legend": { + }, + "extra": { + "mix": { + "column": { + "width": 20 + } + }, + } + }, + "scatter":{ + "type": "scatter", + "color":color, + "padding":[15,15,0,15], + "dataLabel":false, + "xAxis": { + "disableGrid": false, + "gridType":"dash", + "splitNumber":5, + "boundaryGap":"justify", + "min":0 + }, + "yAxis": { + "disableGrid": false, + "gridType":"dash", + }, + "legend": { + }, + "extra": { + "scatter": { + }, + } + }, + "bubble":{ + "type": "bubble", + "color":color, + "padding":[15,15,0,15], + "xAxis": { + "disableGrid": false, + "gridType":"dash", + "splitNumber":5, + "boundaryGap":"justify", + "min":0, + "max":250 + }, + "yAxis": { + "disableGrid": false, + "gridType":"dash", + "data":[{ + "min":0, + "max":150 + }] + }, + "legend": { + }, + "extra": { + "bubble": { + "border":2, + "opacity": 0.5, + }, + } + } +} + +export default cfu; \ No newline at end of file -- Gitblit v1.9.3