路徑
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說明文檔
- 色斑圖加透明