路径
D:\ireport365\ireport365.war\js\enduser\designer\vs-component-echarts.js
搜索 internalRefreshChinaDownMapModelData
1 修改数据处理函数 直接替换
```
var internalRefreshChinaDownMapModelData = function () {
var option = component.config.chartConfig;
var dimensions = component.config.datasourceConfig.dimensions;
var measures = component.config.datasourceConfig.measures;
var data = component.context.data;
var chartData = [];
var chartDataMap = {};
var measureIdx = 0;
if (component.config.receiveMeasureLink != null && component.config.receiveMeasureLink === true) {
var newMeasures = scope.getSelectedLinkMeasure(component, component.config.datasourceConfig.measures);
for (var i = 0; i < measures.length; i++) {
if (newMeasures[i] != null) {
measureIdx = i;
break
}
}
}
// for (var i = 0; i < data.length; i++) {
// for(var j = 0; j< data[i].length;j++){
// var value = data[i][j][measures[measureIdx].name];
// var name = factory._internalFindKvValue(component, data[i][j][dimensions[i].name]);
// chartData.push({
// name: name,
// value: value
// });
// }
// }
for (var i = 0; i < data.length; i++) {
for(var j = 0; j< data[i].length;j++){
var value = data[i][j][measures[measureIdx].name];
var name = factory._internalFindKvValue(component, data[i][j][dimensions[i].name]);
chartData.push({
name: name,
value: value
});
}
var dataMap = chartDataMap[data[i][dimensions[dimensions.length - 1].name]];
if (dataMap == null) {
dataMap = {};
chartDataMap[name] = dataMap
}
for (var m = 0; m < measures.length; m++) {
dataMap[measures[m].name] = data[i][measures[m].name]
}
}
option.series[0].data = chartData;
option.series[0].name = measures[measureIdx].label;
if (component.config["measureAlias_" + measureIdx] != null && component.config["measureAlias_" + measureIdx].length > 0) {
option.series[0].name = component.config["measureAlias_" + measureIdx]
}
option.series[0].seriesIndex = measureIdx;
var thresholdConfig = component.config.thresholdConfig[measures[measureIdx].name];
var splitList = [];
if (thresholdConfig != null && thresholdConfig.length > 0) {
var valueType = component.config["thresholdValueType_" + measures[measureIdx].name];
if (valueType == null) {
valueType = "value"
}
var maxValue = parseFloat(component.config["maxValue_" + measures[measureIdx].name]);
var minValue = parseFloat(component.config["minValue_" + measures[measureIdx].name]);
if (isNaN(maxValue) || isNaN(minValue)) {
var calculatedMaxValue = -9999999999;
var calculatedMinValue = 9999999999;
for (var i = 0; i < data.length; i++) {
var value = data[i][measures[measureIdx].name];
calculatedMaxValue = Math.max(calculatedMaxValue, parseFloat(value));
calculatedMinValue = Math.min(calculatedMinValue, parseFloat(value))
}
if (isNaN(maxValue)) {
maxValue = calculatedMaxValue
}
if (isNaN(minValue)) {
minValue = calculatedMinValue
}
}
var minToMaxValue = maxValue - minValue;
for (var i = 0; i < thresholdConfig.length; i++) {
var fromValue = parseFloat(component.config[thresholdConfig[i].fromBind]);
var toValue = parseFloat(component.config[thresholdConfig[i].toBind]);
if (isNaN(fromValue) && isNaN(toValue)) {
continue
}
if (valueType === "percent") {
fromValue = fromValue * minToMaxValue;
toValue = toValue * minToMaxValue
}
var color = component.config[thresholdConfig[i].colorBind];
var item = {
color: color
};
if (!isNaN(fromValue)) {
item.start = fromValue
}
if (!isNaN(toValue)) {
item.end = toValue
}
if (component.config.dataRangeUnit) {
if (item.start == null) {
item.label = "< " + item.end
} else {
if (item.end == null) {
item.label = "> " + item.start
} else {
item.label = item.start + " - " + item.end
}
}
item.label = item.label + component.config.dataRangeUnit
}
splitList.push(item)
}
}
if (splitList.length === 0) {
splitList = [{
start: 0,
color: "#A8DAF6"
}]
}
option.dataRange.splitList = splitList;
option.data = chartDataMap;
component.context.chart.setOption(option, true)
};
```
2修改弹窗数据方法
```
case "DrillDownChinaMap":
if (component.config.showItemLabel == null) {
component.config.showItemLabel = true
}
option.tooltip.confine = true;
option.tooltip.formatter = function(params) {
// console.log(params)
var res = params.name;
// console.log(res)
// console.log(component.context.data)
var dataMap = component.context.data[0][params.dataIndex];
// console.log(params.dataIndex)
var measures = component.config.datasourceConfig.measures;
for (var i = 0; i < measures.length; i++) {
res += "<br/>";
var unit = component.config["unit_" + i];
if (unit == null) {
unit = ""
}
var value = dataMap[measures[i].name];
console.log(value)
if (component.config["valueType_" + i] != null && component.config["valueType_" + i] === "percent") {
value = value * 100;
unit = "%"
}
value = $vsUtils.processValue(value, component.config["digit_" + i]);
value = $vsUtils.comdifyValue(value);
var measureLabel = measures[i].label;
if (component.config["measureAlias_" + i] != null && component.config["measureAlias_" + i].length > 0) {
measureLabel = component.config["measureAlias_" + i]
}
res += measureLabel + " : " + value + unit
}
return res
};
break;
```
分享页 路径D:\ireport365\ireport365.war\WEB-INF\classes\report-resource\design.js
同上
搜索 internalRefreshChinaDownMapModelData
1 修改数据处理函数 直接替换
```
var internalRefreshChinaDownMapModelData = function () {
var option = component.config.chartConfig;
var dimensions = component.config.datasourceConfig.dimensions;
var measures = component.config.datasourceConfig.measures;
var data = component.context.data;
var chartData = [];
var chartDataMap = {};
var measureIdx = 0;
if (component.config.receiveMeasureLink != null && component.config.receiveMeasureLink === true) {
var newMeasures = scope.getSelectedLinkMeasure(component, component.config.datasourceConfig.measures);
for (var i = 0; i < measures.length; i++) {
if (newMeasures[i] != null) {
measureIdx = i;
break
}
}
}
// for (var i = 0; i < data.length; i++) {
// for(var j = 0; j< data[i].length;j++){
// var value = data[i][j][measures[measureIdx].name];
// var name = factory._internalFindKvValue(component, data[i][j][dimensions[i].name]);
// chartData.push({
// name: name,
// value: value
// });
// }
// }
for (var i = 0; i < data.length; i++) {
for(var j = 0; j< data[i].length;j++){
var value = data[i][j][measures[measureIdx].name];
var name = factory._internalFindKvValue(component, data[i][j][dimensions[i].name]);
chartData.push({
name: name,
value: value
});
}
var dataMap = chartDataMap[data[i][dimensions[dimensions.length - 1].name]];
if (dataMap == null) {
dataMap = {};
chartDataMap[name] = dataMap
}
for (var m = 0; m < measures.length; m++) {
dataMap[measures[m].name] = data[i][measures[m].name]
}
}
option.series[0].data = chartData;
option.series[0].name = measures[measureIdx].label;
if (component.config["measureAlias_" + measureIdx] != null && component.config["measureAlias_" + measureIdx].length > 0) {
option.series[0].name = component.config["measureAlias_" + measureIdx]
}
option.series[0].seriesIndex = measureIdx;
var thresholdConfig = component.config.thresholdConfig[measures[measureIdx].name];
var splitList = [];
if (thresholdConfig != null && thresholdConfig.length > 0) {
var valueType = component.config["thresholdValueType_" + measures[measureIdx].name];
if (valueType == null) {
valueType = "value"
}
var maxValue = parseFloat(component.config["maxValue_" + measures[measureIdx].name]);
var minValue = parseFloat(component.config["minValue_" + measures[measureIdx].name]);
if (isNaN(maxValue) || isNaN(minValue)) {
var calculatedMaxValue = -9999999999;
var calculatedMinValue = 9999999999;
for (var i = 0; i < data.length; i++) {
var value = data[i][measures[measureIdx].name];
calculatedMaxValue = Math.max(calculatedMaxValue, parseFloat(value));
calculatedMinValue = Math.min(calculatedMinValue, parseFloat(value))
}
if (isNaN(maxValue)) {
maxValue = calculatedMaxValue
}
if (isNaN(minValue)) {
minValue = calculatedMinValue
}
}
var minToMaxValue = maxValue - minValue;
for (var i = 0; i < thresholdConfig.length; i++) {
var fromValue = parseFloat(component.config[thresholdConfig[i].fromBind]);
var toValue = parseFloat(component.config[thresholdConfig[i].toBind]);
if (isNaN(fromValue) && isNaN(toValue)) {
continue
}
if (valueType === "percent") {
fromValue = fromValue * minToMaxValue;
toValue = toValue * minToMaxValue
}
var color = component.config[thresholdConfig[i].colorBind];
var item = {
color: color
};
if (!isNaN(fromValue)) {
item.start = fromValue
}
if (!isNaN(toValue)) {
item.end = toValue
}
if (component.config.dataRangeUnit) {
if (item.start == null) {
item.label = "< " + item.end
} else {
if (item.end == null) {
item.label = "> " + item.start
} else {
item.label = item.start + " - " + item.end
}
}
item.label = item.label + component.config.dataRangeUnit
}
splitList.push(item)
}
}
if (splitList.length === 0) {
splitList = [{
start: 0,
color: "#A8DAF6"
}]
}
option.dataRange.splitList = splitList;
option.data = chartDataMap;
component.context.chart.setOption(option, true)
};
```
2修改弹窗数据方法
```
case "DrillDownChinaMap":
if (component.config.showItemLabel == null) {
component.config.showItemLabel = true
}
option.tooltip.confine = true;
option.tooltip.formatter = function(params) {
// console.log(params)
var res = params.name;
// console.log(res)
// console.log(component.context.data)
var dataMap = component.context.data[0][params.dataIndex];
// console.log(params.dataIndex)
var measures = component.config.datasourceConfig.measures;
for (var i = 0; i < measures.length; i++) {
res += "<br/>";
var unit = component.config["unit_" + i];
if (unit == null) {
unit = ""
}
var value = dataMap[measures[i].name];
console.log(value)
if (component.config["valueType_" + i] != null && component.config["valueType_" + i] === "percent") {
value = value * 100;
unit = "%"
}
value = $vsUtils.processValue(value, component.config["digit_" + i]);
value = $vsUtils.comdifyValue(value);
var measureLabel = measures[i].label;
if (component.config["measureAlias_" + i] != null && component.config["measureAlias_" + i].length > 0) {
measureLabel = component.config["measureAlias_" + i]
}
res += measureLabel + " : " + value + unit
}
return res
};
break;
```
完 2018-11-09
- video
- treemap
- mian.html文件注释
- 配置项tab
- 配置项属性
- internalRefreshAxisMdelData函数梳理
- 函数配置项-engine文件
- 替换数据源流程
- design.js
- 树图
- 下钻 废弃
- 人体图
- 下钻地图
- 行列互转
- 预览样式
- logo旁边的报表名
- echarts 组件生成图片
- 数据集样式
- 头部 黑色head
- 手机 ipad 图片
- k线图部分
- 平台管理css样式
- 目录css和平板的边距
- 设计页-数据源-目录
- 数据集 - 查看数据表 -按钮和目录样式
- 报表列表页按钮css
- 角色管理页按钮css
- 推送通知按钮css
- 子账号按钮css
- 数据连接
- openlayers地图线路图
- openlayers4_map_designer.js
- openlayers4_map_view.js
- 说明
- 常用图标小bug
- echarts 气泡地图
- echarts 线路轨迹图
- 导出pdf
- 可视化sql--css
- 表格滚动
- 主题色
- 时间轴
- 分享弹框
- 管理平台header和菜单
- 报表平台和菜单
- 初始化组件颜色
- 其他弹框
- olap分析样式-废弃
- 3d地图柱状图
- 关系图
- olap分析
- 地区地图
- k线图相关属性设置
- 世界地图
- 时间轴(new)
- 选择省份下转地图
- 选择省市飞线地图
- 面积预警地图默认颜色
- 组件覆层开关组件
- 汽车仪表盘bug
- 雷达图bug修复不能分享的问题
- 饼状 条形图 自动播放
- 临时用
- 自动轮播
- 方形元素 按钮浮动报错
- 面积预警地图整合可选择省市区
- 下钻地图添加返回按钮
- 下钻地图修复预警bug
- 基本时间组件
- 添加时钟组件
- 3d地球组件
- 盒须图
- 组件加载动画
- 报表背景渐变色
- 主题模板
- 没用
- 3机房第三方组件
- 设计
- 分享
- 3d机房需要的静态资源
- cesium地球需要的文件以及样式
- cesium地球
- 设计页
- 分享页
- 图标条形图
- 世豪-前端代码整理
- component.css 文件新添加
- 杂项
- index.jsp
- designer.css 样式暂时不整理 里面比较杂
- vs-common.js 新加生成html2canvas pdf
- vs-component-basic.js 完
- vs-component-datasource.js 完
- vs-component-engine.js 完
- vs-component-widget-grid.js 完
- vs-component-widget-square.js 完
- vs-designer.js 完
- vs-designer-component.js 完
- vs-designer-report.js 完
- vs-designer-reportpage.js 完
- vs-component-echarts.js 完
- main.html 完
- component.html 新加组件设置页模板
- 以前的报表页设置控制器---做个记录
- 大概修改过的代码
- 2019-5-8 修改皮肤控制器
- 选择模板
- 桑基图2019-11-20
- bug 修正 2019-11-21
- 插图柱状图
- cesiumchart组件
- gis 地图 联动 弹框 图标
- 动态面积图添加按钮类配置项
- 玫瑰图形组件
- cesium 图形 和three.js 冲突的bug
- gis 地图 默认图层
- 网格标签
- gis 点图 值域
- gis 面图 值域
- 按钮图标添加提示框
- 百度地图
- 剩余的组件
- gulp说明文档
- 色斑图加透明