diff --git a/App.vue b/App.vue
index 7b7b95a..002072b 100644
--- a/App.vue
+++ b/App.vue
@@ -1,11 +1,13 @@
+
diff --git a/pages.json b/pages.json
index 91d3f80..03b0587 100644
--- a/pages.json
+++ b/pages.json
@@ -35,9 +35,8 @@
"path": "pages/record/drink",
"name": "Drink",
"style": {
- "navigationBarTitleText": "记录喝水",
- "navigationBarBackgroundColor": "#34CE98",
- "navigationBarTextStyle": "white"
+ "navigationBarTitleText": "记录",
+ "navigationStyle": "custom"
}
},
{
@@ -53,9 +52,8 @@
"path": "pages/record/foods",
"name": "RecordFoods",
"style": {
- "navigationBarTitleText": "食物记录",
- "navigationBarBackgroundColor": "#34CE98",
- "navigationBarTextStyle": "white"
+ "navigationBarTitleText": "",
+ "navigationStyle": "custom"
}
},
{
diff --git a/pages/auth/auth.vue b/pages/auth/auth.vue
index 33a8231..6c4cf79 100644
--- a/pages/auth/auth.vue
+++ b/pages/auth/auth.vue
@@ -83,7 +83,6 @@ export default {
mobileNo: this.phone,
code: this.code,
}).then((res) => {
- console.log(111)
this.$store.commit(
"setToken",
res.token_type + " " + res.access_token
diff --git a/pages/im/private/components/showVoice.nvue b/pages/im/private/components/showVoice.nvue
index 2686fc9..3c83771 100644
--- a/pages/im/private/components/showVoice.nvue
+++ b/pages/im/private/components/showVoice.nvue
@@ -65,7 +65,8 @@
height: 79rpx;
width: 170rpx;
padding: 0 20rpx;
- box-sizing: border-box;
+ box-sizing:border-box;
+ /* box-sizing: border-box; */
}
,
diff --git a/pages/record/addFoods.vue b/pages/record/addFoods.vue
index cf476b8..b273661 100644
--- a/pages/record/addFoods.vue
+++ b/pages/record/addFoods.vue
@@ -14,180 +14,185 @@
高等热量
-
+
-
+
-
+
diff --git a/pages/record/drink.vue b/pages/record/drink.vue
index 9bfd096..68a6caa 100644
--- a/pages/record/drink.vue
+++ b/pages/record/drink.vue
@@ -7,402 +7,544 @@
-->
-
-
-
-
- 再喝
- {{ water.lack.cup }}
- 杯
- (约{{ water.lack.value }}ml)
-
-
- 已喝
- {{ water.total }}ml
-
-
-
-
-
-
-
-
-
-
- 今日目标
-
-
-
- 水杯容量
-
-
-
-
-
-
-
-
-
-
-
- 一杯水
-
-
-
-
-
- 喝水记录
-
-
-
-
-
- 水
- {{ item.time }}
-
- {{ item.ml }}ml
-
-
-
- 今天一杯水还没有喝呢,来一杯吧~
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 再喝
+ {{ water.lack.cup }}
+ 杯
+ (约{{ water.lack.value }}ml)
+
+
+ 已喝
+ {{ water.total }}ml
+
+
+
+
+
+
+
+
+
+
+ 今日目标
+
+
+
+ 水杯容量
+
+
+
+
+
+
+
+
+
+
+
+ 一杯水
+
+
+
+
+
+ 喝水记录
+
+
+
+
+
+
+
+ 水
+ {{ item.time }}
+
+ {{ item.ml }}ml
+
+
+
+ 今天一杯水还没有喝呢,来一杯吧~
+
+
+
+
+
diff --git a/pages/record/foods.vue b/pages/record/foods.vue
index 8b1f581..c0be654 100644
--- a/pages/record/foods.vue
+++ b/pages/record/foods.vue
@@ -3,450 +3,560 @@
* @Author: Aimee·Zhang
* @Date: 2022-01-11 08:54:49
* @LastEditors: Aimee·Zhang
- * @LastEditTime: 2022-01-20 10:05:15
+ * @LastEditTime: 2022-02-08 10:41:15
-->
-
-
-
-
- 饮食摄入
- {{ calorys.intake_total }}
-
-
- {{ calorys.exceeds ? '多吃了' : '还可以吃' }}
- {{ calorys.amount }}
- 推荐预算{{ calorys.goal }}
-
-
- 运动消耗
- {{ calorys.exercise_total }}
-
- 摄入量推荐
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
- {{ it.name }}
- {{ it.remark || '' }}
-
-
- {{ it.total }}
- 千卡
-
-
-
-
-
-
-
-
-
- 运动
-
- {{ sportsTotal }}
- 千卡
-
-
-
+
+
+
+ 饮食摄入
+ {{ calorys.intake_total }}
+
+
+ {{ calorys.exceeds ? '多吃了' : '还可以吃' }}
+ {{ calorys.amount }}
+ 推荐预算{{ calorys.goal }}
+
+
+ 运动消耗
+ {{ calorys.exercise_total }}
+
+ 摄入量推荐
+
+
-
-
+
+
+
+
+
+ {{ it.name }}
+ {{ it.remark || '' }}
+
+
+ {{ it.total }}
+ 千卡
+
+
+
+
+
+
-
-
-
- 还没有添加今日饮食记录
- 请点击屏幕下方按钮来添加
-
+
+
+
+ 运动
+
+ {{ sportsTotal }}
+ 千卡
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
+
+
+
+ 还没有添加今日饮食记录
+ 请点击屏幕下方按钮来添加
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/record/index.vue b/pages/record/index.vue
index 17660b4..dfa5f76 100644
--- a/pages/record/index.vue
+++ b/pages/record/index.vue
@@ -398,9 +398,7 @@ export default {
*/
logs() {
logs().then(res => {
-
- console.log(res.is_login)
-
+ // console.log(res.is_login)
this.weight = res.weight;
this.water = res.water;
this.intake_run = res.intake_run;
diff --git a/pages/record/weight.vue b/pages/record/weight.vue
index b75cfad..1c43df8 100644
--- a/pages/record/weight.vue
+++ b/pages/record/weight.vue
@@ -8,231 +8,292 @@
-
-
-
- 斤
- 公斤
-
-
- {{weightInfo.text}}
-
- 保持 / 塑性
-
- 记录体重
- 以最后一次记录为主且每日只能更新一次
-
-
-
-
-
-
- {{item.weight}}公斤
-
- 测量结果
+
+
+
+
+ 斤 公斤
+
+ {{weightInfo.text}}
+
+ 保持 / 塑性
-
- 开始保持 / 塑性
- {{item.created_at}}
+ 记录体重
+ 以最后一次记录为主且每日只能更新一次
+
+
+
+
+
+ {{weightInfo.begin}}公斤 初始体重
+ 开始保持 / 塑性 {{weightInfo.first_weight_time}}
+
+
+ {{item.weight}}公斤 测量结果
+ 开始保持 / 塑性 {{item.created_at}}
+ 还没有体重信息,记录下呗~
+
+
+
+
+
+
+
+
+ 体重 单位:公斤
+
+
+
+
+ 记录体重
+ 只显示最近七次测量记录
+
- 还没有体重信息,记录下呗~
-
+
今天
{{weight}}公斤
-
- 确认添加
+
+ 确认添加
+
+
+
+
+
\ No newline at end of file
+
diff --git a/static/imgs/curve-1.png b/static/imgs/curve-1.png
new file mode 100644
index 0000000..0f6413e
Binary files /dev/null and b/static/imgs/curve-1.png differ
diff --git a/static/imgs/curve-2.png b/static/imgs/curve-2.png
new file mode 100644
index 0000000..a768201
Binary files /dev/null and b/static/imgs/curve-2.png differ
diff --git a/static/imgs/speed-1.png b/static/imgs/speed-1.png
new file mode 100644
index 0000000..c4c31e5
Binary files /dev/null and b/static/imgs/speed-1.png differ
diff --git a/static/imgs/speed-2.png b/static/imgs/speed-2.png
new file mode 100644
index 0000000..56ac17d
Binary files /dev/null and b/static/imgs/speed-2.png differ
diff --git a/static/imgs/water-1.png b/static/imgs/water-1.png
new file mode 100644
index 0000000..d3d7ef9
Binary files /dev/null and b/static/imgs/water-1.png differ
diff --git a/static/imgs/water-2.png b/static/imgs/water-2.png
new file mode 100644
index 0000000..50cbdb4
Binary files /dev/null and b/static/imgs/water-2.png differ
diff --git a/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js b/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js
index d36ecbc..46039c6 100644
--- a/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js
+++ b/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js
@@ -21,630 +21,639 @@ const color = ['#91CB74', '#1890FF', '#FAC858', '#EE6666', '#73C0DE', '#3CA272',
//事件转换函数,主要用作格式化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];
+ 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", "bar", "area", "radar", "gauge", "candle", "mix", "tline", "tarea", "scatter", "bubble", "demotype"],
- "range": ["饼状图", "圆环图", "玫瑰图", "词云图", "漏斗图", "地图", "圆弧进度条", "折线图", "柱状图", "条状图", "区域图", "雷达图", "仪表盘", "K线图", "混合图", "时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型"],
- //增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype"
- //自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories
- "categories": ["line", "column", "bar", "area", "radar", "gauge", "candle", "mix", "demotype"],
- //instance为实例变量承载属性,不要删除
- "instance": {},
- //option为opts及eopts承载属性,不要删除
- "option": {},
- //下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换
- "formatter": {
- "yAxisDemo1": function (val) { return val + '元' },
- "yAxisDemo2": function (val) { return val.toFixed(2) },
- "xAxisDemo1": function (val) { return val + '年' },
- "xAxisDemo2": function (val) { return formatDateTime(val, 'h:m') },
- "seriesDemo1": function (val) { return val + '元' },
- "tooltipDemo1": function (item, category, index, opts) {
- if (index == 0) {
- return '随便用' + item.data + '年'
- } else {
- return '其他我没改' + item.data + '天'
- }
- },
- "pieDemo": function (val, index, series) {
- if (index !== undefined) {
- return series[index].name + ':' + series[index].data + '元'
- }
- },
- },
- //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。
- "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
- },
- }
- },
- "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
- },
- }
- },
- "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
- },
- }
- },
- "column": {
- "type": "column",
- "color": color,
- "padding": [15, 15, 0, 5],
- "xAxis": {
- "disableGrid": true,
- },
- "yAxis": {
- "data": [{ "min": 0 }]
- },
- "legend": {
- },
- "extra": {
- "column": {
- "type": "group",
- "width": 30,
- "meterBorde": 1,
- "meterFillColor": "#FFFFFF",
- "activeBgColor": "#000000",
- "activeBgOpacity": 0.08
- },
- }
- },
- "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
- },
- }
- },
- "radar": {
- "type": "radar",
- "canvasId": "",
- "canvas2d": false,
- "background": "none",
- "animation": true,
- "timing": "easeOut",
- "duration": 1000,
- "color": [
- "#91CB74",
- "#1890FF",
- "#FAC858",
- "#EE6666",
- "#73C0DE",
- "#3CA272",
- "#FC8452",
- "#9A60B4",
- "#ea7ccc"
- ],
- "padding": [
- 5,
- 5,
- 5,
- 5
- ],
- "rotate": false,
- "errorReload": true,
- "fontSize": 10,
- "fontColor": "#666666",
- "enableScroll": false,
- "touchMoveLimit": 60,
- "enableMarkLine": false,
- "dataLabel": false,
- "dataPointShape": true,
- "dataPointShapeType": "solid",
- "tapLegend": true,
- "legend": {
- "show": false,
- "position": "bottom",
- "float": "center",
- "padding": 5,
- "margin": 5,
- "backgroundColor": "rgba(0,0,0,0)",
- "borderColor": "rgba(0,0,0,0)",
- "borderWidth": 0,
- "fontSize": 13,
- "fontColor": "#666666",
- "lineHeight": 25,
- "hiddenColor": "#CECECE",
- "itemGap": 10
- },
- "extra": {
- "radar": {
- "gridType": "radar",
- "gridColor": "#CCCCCC",
- "gridCount": 3,
- "labelColor": "#666666",
- "opacity": 0.2,
- "border": false,
- "borderWidth": 2,
- "max": 50
- },
- "tooltip": {
- "showBox": true,
- "showArrow": true,
- "showCategory": false,
- "borderWidth": 0,
- "borderRadius": 0,
- "borderColor": "#000000",
- "borderOpacity": 0.7,
- "bgColor": "#000000",
- "bgOpacity": 0.7,
- "gridType": "solid",
- "dashLength": 4,
- "gridColor": "#CCCCCC",
- "fontColor": "#FFFFFF",
- "splitLine": true,
- "horizentalLine": false,
- "xAxisLabel": false,
- "yAxisLabel": false,
- "labelBgColor": "#FFFFFF",
- "labelBgOpacity": 0.7,
- "labelFontColor": "#666666"
- }
- }
- },
- "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,
- },
- }
- }
+ //demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可
+ "type": ["pie", "ring", "rose", "word", "funnel", "map", "arcbar", "line", "column", "bar", "area", "radar",
+ "gauge", "candle", "mix", "tline", "tarea", "scatter", "bubble", "demotype"
+ ],
+ "range": ["饼状图", "圆环图", "玫瑰图", "词云图", "漏斗图", "地图", "圆弧进度条", "折线图", "柱状图", "条状图", "区域图", "雷达图", "仪表盘", "K线图",
+ "混合图", "时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型"
+ ],
+ //增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype"
+ //自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories
+ "categories": ["line", "column", "bar", "area", "radar", "gauge", "candle", "mix", "demotype"],
+ //instance为实例变量承载属性,不要删除
+ "instance": {},
+ //option为opts及eopts承载属性,不要删除
+ "option": {},
+ //下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换
+ "formatter": {
+ "yAxisDemo1": function(val) {
+ return val + '元'
+ },
+ "yAxisDemo2": function(val) {
+ return val.toFixed(2)
+ },
+ "xAxisDemo1": function(val) {
+ return val + '年'
+ },
+ "xAxisDemo2": function(val) {
+ return formatDateTime(val, 'h:m')
+ },
+ "seriesDemo1": function(val) {
+ return val + '元'
+ },
+ "tooltipDemo1": function(item, category, index, opts) {
+ if (index == 0) {
+ return '随便用' + item.data + '年'
+ } else {
+ return '其他我没改' + item.data + '天'
+ }
+ },
+ "pieDemo": function(val, index, series) {
+ if (index !== undefined) {
+ return series[index].name + ':' + series[index].data + '元'
+ }
+ },
+ },
+ //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。
+ "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
+ },
+ }
+ },
+ "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
+ },
+ }
+ },
+ "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
+ },
+ }
+ },
+ "column": {
+ "type": "column",
+ "color": color,
+ "padding": [15, 15, 0, 5],
+ "xAxis": {
+ "disableGrid": true,
+ },
+ "yAxis": {
+ "data": [{
+ "min": 0
+ }]
+ },
+ "legend": {},
+ "extra": {
+ "column": {
+ "type": "group",
+ "width": 30,
+ "meterBorde": 1,
+ "meterFillColor": "#FFFFFF",
+ "activeBgColor": "#000000",
+ "activeBgOpacity": 0.08
+ },
+ }
+ },
+ "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": [
+ "#34ce98",
+ ],
+ "padding": [15, 15, 0, 15],
+ "xAxis": {
+ "disableGrid": true,
+ },
+ "yAxis": {
+ "gridType": "dash",
+ "dashLength": 2,
+ },
+ "fontColor": "#999",
+ "fontSize":"12",
+ "legend": {},
+ "extra": {
+ "area": {
+ "type": "straight",
+ "opacity": 0.2,
+ "addLine": true,
+ "width": 2,
+ "gradient": false
+ },
+ }
+ },
+ "radar": {
+ "type": "radar",
+ "canvasId": "",
+ "canvas2d": false,
+ "background": "none",
+ "animation": true,
+ "timing": "easeOut",
+ "duration": 1000,
+ "color": [
+ "#91CB74",
+ "#1890FF",
+ "#FAC858",
+ "#EE6666",
+ "#73C0DE",
+ "#3CA272",
+ "#FC8452",
+ "#9A60B4",
+ "#ea7ccc"
+ ],
+ "padding": [
+ 5,
+ 5,
+ 5,
+ 5
+ ],
+ "rotate": false,
+ "errorReload": true,
+ "fontSize": 10,
+ "fontColor": "#666666",
+ "enableScroll": false,
+ "touchMoveLimit": 60,
+ "enableMarkLine": false,
+ "dataLabel": false,
+ "dataPointShape": true,
+ "dataPointShapeType": "solid",
+ "tapLegend": true,
+ "legend": {
+ "show": false,
+ "position": "bottom",
+ "float": "center",
+ "padding": 5,
+ "margin": 5,
+ "backgroundColor": "rgba(0,0,0,0)",
+ "borderColor": "rgba(0,0,0,0)",
+ "borderWidth": 0,
+ "fontSize": 13,
+ "fontColor": "#666666",
+ "lineHeight": 25,
+ "hiddenColor": "#CECECE",
+ "itemGap": 10
+ },
+ "extra": {
+ "radar": {
+ "gridType": "radar",
+ "gridColor": "#CCCCCC",
+ "gridCount": 3,
+ "labelColor": "#666666",
+ "opacity": 0.2,
+ "border": false,
+ "borderWidth": 2,
+ "max": 50
+ },
+ "tooltip": {
+ "showBox": true,
+ "showArrow": true,
+ "showCategory": false,
+ "borderWidth": 0,
+ "borderRadius": 0,
+ "borderColor": "#000000",
+ "borderOpacity": 0.7,
+ "bgColor": "#000000",
+ "bgOpacity": 0.7,
+ "gridType": "solid",
+ "dashLength": 4,
+ "gridColor": "#CCCCCC",
+ "fontColor": "#FFFFFF",
+ "splitLine": true,
+ "horizentalLine": false,
+ "xAxisLabel": false,
+ "yAxisLabel": false,
+ "labelBgColor": "#FFFFFF",
+ "labelBgOpacity": 0.7,
+ "labelFontColor": "#666666"
+ }
+ }
+ },
+ "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
+export default cfu;