hklhai / dashboard

dashboard
0 stars 0 forks source link

数据根据范围显示不同的颜色,并且图例添加说明 #36

Closed aym19900825 closed 5 years ago

aym19900825 commented 5 years ago

实现效果如下: 微信图片_20190122171445.png

aym19900825 commented 5 years ago

@hklhai 视图需添加参数:

  1. isRangeDesc: false,
  2. rangeDesc: [{ min: '', max: '', desc: '' }],

备注:这些参数,可以添加到列说明级别columnList里,也可添加在视图级别,和vid同层

hklhai commented 5 years ago

@hklhai 视图需添加参数:

  1. isRangeDesc: false,
  2. rangeDesc: [{ min: '', max: '', desc: '' }],

备注:这些参数,可以添加到列说明级别columnList里,也可添加在视图级别,和vid同层

@aym19900825 提供一下rangeDesc的样例数据

hklhai commented 5 years ago

@aym19900825 数据说明: isRangeDesc: false, //在visualize实体中 rangeDesc: [{ min: '', // 下限 max: '', // 上限 description: '', // 显示描述,desc与SQL92中降序关键字冲突 color: '' // 自定义显示颜色 }],

hklhai commented 5 years ago

视图更新接口 PUT http://spark2:8090/show/visualize { "visualize": { "vid": 88, "isRangeDesc": true }, "rangeDesc": [ { "min": "1", "max": "4", "description": "des1", "color": "#0B0B0B" }, { "min": "4", "max": "10", "description": "des2", "color": "#000000" }, { "min": "10", "max":"20", "description":"des3", "color": "#2A2323" } ] }

return { "visualize": { "vid": 88, "isRangeDesc": true }, "rangeDesc": [ { "min": "1", "max": "4", "description": "des1", "color": "#0B0B0B" }, { "min": "4", "max": "10", "description": "des2", "color": "#000000" }, { "min": "10", "max":"20", "description":"des3", "color": "#2A2323" } ] }

hklhai commented 5 years ago

数据接口:

POST http://localhost:8090/show/visualizeData { "integerId": 88 }

return { "vid": 88, "x": null, "y": null, "h": null, "w": null, "did": 1, "visualizename": "大数据量面积图", "xname": null, "yname": null, "showLabel": [ null ], "columnList": [ { "columnmid": 179, "visualize": null, "field": "showvalue", "type": "double(10,2)", "columnshow": null, "colColor": null, "colLabel": "false", "colLabelPos": null, "colMax": false, "colMin": false, "colYIndex": null, "colWidth": null, "colStack": null, "colName": null, "colType": null, "colAverage": false, "colGradient": null, "colStartColor": null, "colEndColor": null, "colLabelRotate": null, "colAreaStyle": false, "colSmooth": true, "colAreaColor": null, "sampling": null, "colstep": false, "colRoseType": false, "colLabelline": false, "colLabelLineColor": null, "colRadius": null } ], "orientYList": [], "orientXList": [], "rangeDesc": [ { "valuecolorid": 7, "min": "1", "max": "4", "description": "des1" }, { "valuecolorid": 8, "min": "4", "max": "10", "description": "des2" }, { "valuecolorid": 9, "min": "10", "max": "20", "description": "des3" } ], "type": "line", "echarttitle": null, "legendShow": null, "legendPos": null, "legendOrient": null, "tooltipShow": null, "background": null, "echartTitPos": null, "echartTitColor": null, "xName": null, "xAxisLabel": null, "xAxisLine": true, "xSplitLine": true, "xInverse": null, "alignWithLabel": null, "xToy": null, "dataZoom": false, "yAxisLabel": null, "yAxisLine": true, "ySplitLine": true, "yInverse": null, "max": null, "min": null, "outOfRangeColor": null, "controllerColor": null, "subTit": null, "ylineColor": null, "ynameColor": null, "yaxisLabelPos": null, "xlineColor": null, "xnameColor": null, "xaxisLabelPos": null, "xstart": null, "xend": null, "ystart": null, "yend": null, "legendType": null, "legendSelData": null, "xBoundaryGap": false, "vwheredesc": null, "prefixwhere": null, "suffixwhere": null, "countValue": null, "israngeDesc": true }

hklhai commented 5 years ago

删除颜色配置

PUT http://spark2:8090/show/visualize { "visualize": { "vid": 119 }, "colorDeleteList": [ 13,15 ] }

return: { "code": 1, "message": "Edit Success!", "modelList": null }