<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ~~~ var internalRefreshAxisModelData = function () { // 判斷屬性值 如果是折線 柱狀圖 區域 switch (component.type) { case "line": case "area": case "column": console.log(component.config); if (component.config.chartPivotType != null) { alert('1111') if ("rowToColumn" === component.config.chartPivotType) { internalRefreshDimensionToMeasureAxisModelData() } else { if ("columnRowExchange" === component.config.chartPivotType) { internalRefreshMeasureDimensionExchangeAxisModelData() } else { internalRefreshMeasureToDimensionAxisModelData() } } return } } // 圖標配置對象 var option = component.config.chartConfig; // 圖標維度數據 var dimensions = component.config.datasourceConfig.dimensions; // 圖標度量數據 var measures = component.config.datasourceConfig.measures; // 圖標所需要的數據 var data = component.context.data; // 判斷數據為不為空 if (data == null) { return } // 設置一個新度量的空數組 var newMeasures = []; // 循環遍歷選中的度量 for (var i = 0; i < measures.length; i++) { var show = component.config["show_" + i]; console.log(component.config) if (show != null && show === false) { // 結束本次循環(跳過下一步) continue } // push進新度量數組 newMeasures.push(measures[i]) } // 新度量數組賦值給初始數組 measures = newMeasures; console.log(option.series.length) console.log(measures.length) // 如果綜合數據數組大于選中度量數組數量 if (option.series.length > measures.length) { var newSeries = []; // 遍歷度量數組 for (var i = 0; i < measures.length; i++) { // 把對應索引的push進新數組里 newSeries.push(option.series[i]) } // 賦值echarts的數組數組 option.series = newSeries } // x軸的標簽 var xAxisLabels = []; // 遍歷某一個維度的所有指標 for (var i = 0; i < data.length; i++) { // push進去每一個遍歷出來的指標 xAxisLabels.push(data[i][dimensions[dimensions.length - 1].name]) console.log(data[i][dimensions[dimensions.length - 1].name]) } // 判斷標簽數組里有沒有數組 if (xAxisLabels.length == 0) { // 沒有則為空 xAxisLabels = [""] } // 設置新數組 var legendData = []; var yAxis0MeasureCount = 0; var yAxis1MeasureCount = 0; for (var m = 0; m < measures.length; m++) { // echarts新data數組 var serieData = []; for (var i = 0; i < data.length; i++) { // 轉數值函數返回布爾型 if (isNaN(data[i][measures[m].name])) { // 將數據里的度量名賦值為null data[i][measures[m].name] = null } // 將數據里度量push進echarts所需要的數據data里 serieData.push(data[i][measures[m].name]) } // 判斷數據數組的長度為0 的話直接把數組賦值為空數組 if (serieData.length == 0) { serieData = [""] } // 如果數據度量索引對應的數據等于null的時候 // 所對應索引的數據將由計算后的數據賦值 if (option.series[m] == null) { var newOption = factory.buildChartOption(element, component); option.series[m] = newOption.series[0] } // 這里得serieData 是每一個度量的數據 // console.log(serieData) // 每一個度量對應的數據 // console.log(option.series[m].data) // 每一個度量的名 // console.log(option.series[m].name) // 數據賦值合并 option.series[m].data = serieData; // 名字賦值合并 option.series[m].name = measures[m].label; // 判斷如果是柱線混合圖 if (component.type !== "mixed") { // 合并y軸上的name option.yAxis[0].name = scope.compileFormulaString(component.config["measureAlias_" + m]); // 如果y軸為數組長度0 或者為null的時候 直接用度量上的數組和數據上y軸的name賦值合并 if (option.yAxis[0].name == null || option.yAxis[0].name.length == 0) { option.yAxis[0].name = measures[m].label } } switch (component.type) { // 判斷如果為這線圖 case "line": // console.log(component.config["lineColor_" + m]) // 如果 沒有設置顏色 則直接是默認顏色 if (component.config["lineColor_" + m] == null) { // 獲取到折線上的顏色 var colorConfig = getColorConfig(m); // console.log(colorConfig) // 賦值給折線圖對象屬性 option.series[m].itemStyle.normal.lineStyle.color = colorConfig.main } else { // 賦值給我們設置過的顏色 option.series[m].itemStyle.normal.color = component.config["lineColor_" + m]; option.series[m].itemStyle.normal.lineStyle.color = component.config["lineColor_" + m] } break; // 如果是柱狀圖 case "column": // 如果沒有設置顏色則使用默認的顏色 if (component.config["columnColor_" + m] == null) { // 函數是獲取默認的顏色函數 var colorConfig = getColorConfig(m); // 賦值給柱狀圖對象屬性 option.series[m].itemStyle.normal.color = colorConfig.main } else { // 賦值給我們設置過的顏色 option.series[m].itemStyle.normal.color = component.config["columnColor_" + m] } // 開啟柱狀堆積圖 option.series[m].stack = component.config["stack_" + m]; // 如果取消則刪除堆積的數據 if (VSUtils.isEmpty(option.series[m].stack) || !option.series[m].stack) { delete option.series[m].stack } break; // 如果是區域圖 case "area": // 如果沒有自定義顏色用默認的 if (component.config["areaColor_" + m] == null) { var colorConfig = getColorConfig(m); option.series[m].itemStyle.normal.color = colorConfig.main; option.series[m].itemStyle.normal.lineStyle.color = colorConfig.main; // 這個是rbga的顏色值 option.series[m].itemStyle.normal.areaStyle.color = hexToRgb(colorConfig.main, 0.5) } else { // 這里是自定義顏色的顏色值 // rgba的顏色值 var rgbValue = hexToRgb(rgbaToHex(component.config["areaColor_" + m]), 0.5); option.series[m].itemStyle.normal.color = component.config["areaColor_" + m]; option.series[m].itemStyle.normal.lineStyle.color = component.config["areaColor_" + m]; option.series[m].itemStyle.normal.areaStyle.color = rgbValue } option.series[m].stack = component.config["stack_" + m]; if (VSUtils.isEmpty(option.series[m].stack) || !option.series[m].stack) { delete option.series[m].stack } break; // 如果是柱線混合圖 case "mixed": if (option.series[m].yAxisIndex == null || option.series[m].yAxisIndex >= option.yAxis.length) { option.series[m].yAxisIndex = 0 } option.yAxis[option.series[m].yAxisIndex].name = scope.compileFormulaString(component.config["measureAlias_" + m]); if (option.yAxis[option.series[m].yAxisIndex].name == null || option.yAxis[option.series[m].yAxisIndex].name.length == 0) { option.yAxis[option.series[m].yAxisIndex].name = measures[m].label } option.series[m].stack = component.config["stack_" + m]; if (VSUtils.isEmpty(option.series[m].stack) || !option.series[m].stack) { delete option.series[m].stack } if (component.config["type_" + m] != null) { option.series[m].type = component.config["type_" + m] } if (component.config["columnColor_" + m] != null) { option.series[m].itemStyle.normal.color = component.config["columnColor_" + m]; if (option.series[m].itemStyle.normal.lineStyle == null) { option.series[m].itemStyle.normal.lineStyle = {} } option.series[m].itemStyle.normal.lineStyle.color = component.config["columnColor_" + m] } if (component.config["yAxisIndex_" + m] != null) { option.series[m].yAxisIndex = component.config["yAxisIndex_" + m] } else { option.series[m].yAxisIndex = 0 } break } // 度量名 var legendValue = measures[m].label; // console.log(legendValue) // 如果度量為null和數組長度為0 if (component.config["measureAlias_" + m] != null && component.config["measureAlias_" + m].length > 0) { // 度量名字賦值給echarts對象屬性 option.series[m].name = scope.compileFormulaString(component.config["measureAlias_" + m]); legendValue = scope.compileFormulaString(component.config["measureAlias_" + m]) } console.log(legendData) // 將度量名push成一個數組 legendData.push(legendValue); if (option.series[m].name == null || option.series[m].name.length == 0) { // 對象合并合并名稱 option.series[m].name = measures[m].label } } component.context.originalXAxisLabels = null; // console.log(xAxisLabels) if (!VSUtils.isEmpty(component.config.xAxisLabelScript)) { // 復制x軸維度數組 component.context.originalXAxisLabels = angular.copy(xAxisLabels); try { // 計算字符串 var f = eval("(function(labelData){ " + Base64.decode(component.config.xAxisLabelScript) + "})"); f.call(null, xAxisLabels) } catch (e) { console.log(e) } } // x軸的數據賦值 option.xAxis[0].data = xAxisLabels; if (option.legend != null) { // 如果維度沒有名可賦值 option.legend.data = legendData } var yAxis0MeasureCount = 0; var yAxis1MeasureCount = 0; for (var i = 0; i < option.series.length; i++) { if (option.series[i].yAxisIndex == null || parseInt(option.series[i].yAxisIndex) === 0) { yAxis0MeasureCount++ } else { yAxis1MeasureCount++ } } if (yAxis0MeasureCount > 1 || option.legend.show === true) { option.yAxis[0].name = "" } if ((yAxis1MeasureCount > 1 || option.legend.show === true) && option.yAxis.length > 1) { option.yAxis[1].name = "" } if (!VSUtils.isEmpty(component.config.barCategoryGap)) { option.series[0].barCategoryGap = component.config.barCategoryGap + "%" } if (!VSUtils.isEmpty(component.config.barGap)) { option.series[0].barGap = component.config.barGap + "%" } if (option.yAxis.length > 0) { delete option.yAxis[0].name } if (option.yAxis.length > 1) { delete option.yAxis[1].name } delete option.yAxis[0].min; delete option.yAxis[0].max; if (!VSUtils.isEmpty(component.config.yAxis0Max)) { option.yAxis[0].max = parseFloat(component.config.yAxis0Max) } if (!VSUtils.isEmpty(component.config.yAxis0Min)) { option.yAxis[0].min = parseFloat(component.config.yAxis0Min) } if (!VSUtils.isEmpty(component.config.yAxis0ValueRangeScript)) { try { var f = eval("(function(){ " + Base64.decode(component.config.yAxis0ValueRangeScript) + "})"); var range = f.call(null); option.yAxis[0].min = range[0]; option.yAxis[0].max = range[1] } catch (e) { console.log(e) } } // 判斷 相同的組件 switch (component.type) { case "column": case "area": case "mixed": case "line": // 循環遍歷數據 for (var i = 0; i < option.series.length; i++) { option.series[i].seriesIndex = i; // 設置echarts屬性 if (option.series[i].itemStyle.normal.label == null) { option.series[i].itemStyle.normal.label = {} } // 提示框顯示的數據 option.series[i].itemStyle.normal.label.show = component.config.showDataLabel; // 提示框里的設置項屬性 option.series[i].itemStyle.emphasis = option.series[i].itemStyle.normal; if (component.config.dataLabelPosition != null) { // 如果為折線和柱狀圖 if (component.type === "mixed" && option.series[i].type === "line") { option.series[i].itemStyle.normal.label.position = "top"; option.series[i].itemStyle.normal.label.y = 1 } else { option.series[i].itemStyle.normal.label.position = component.config.dataLabelPosition } } // 提示框的數據 option.series[i].itemStyle.normal.label.formatter = function (param) { // 索引 var identifier = param.series.seriesIndex; console.log(identifier) var unit = component.config["unit_" + identifier]; var value = param.data; if (!VSUtils.isEmpty(component.config.dataLabelValueScript)) { try { // 計算字符串函數 var f = eval("(function(value, values, measure, xAxisValue, xAxisValues){ " + Base64.decode(component.config.dataLabelValueScript) + "})"); value = f.call(null, value, param.data, measures[param.series.seriesIndex], param.name, option.xAxis[0].data) } catch (e) { console.log(e) } return value } else { if (unit == null) { unit = "" } if (component.config["valueType_" + identifier] != null && component.config["valueType_" + identifier] === "percent") { value = value * 100; unit = "%" } value = $vsUtils.processValue(value, component.config["digit_" + identifier]); res = $vsUtils.comdifyValue(value) + unit; return res } }; // 默認字體12有設置的用設置的 var fontSize = component.config.dataLabelFontSize ? component.config.dataLabelFontSize : 12; // 默認顏色值 判斷 var fontColor = component.config.dataLabelFontColor ? component.config.dataLabelFontColor : "#999999"; // 設置字體顏色值 option.series[i].itemStyle.normal.label.textStyle = { fontSize: fontSize, color: fontColor } } } switch (component.type) { case "column": case "area": case "line": // 標記線判斷開啟或關閉 看有沒有設置項 if (component.config.marklines == null || component.config.marklines.length == 0) { delete option.series[0].markline } // 初始新數組 var marklineDataArr = []; // 顏色值 var marklineColor = component.config.marklineColor; if (VSUtils.isEmpty(marklineColor)) { marklineColor = "#2990EA" } for (var i = 0; i < component.config.marklines.length; i++) { var marklineItem = component.config.marklines[i]; var value = component.config[marklineItem.valueBind]; // x軸y軸的數據 var arr = [{ xAxis: -1, yAxis: value }, { xAxis: option.xAxis[0].data.length - 1, yAxis: value, value: value }]; // 標記線數據 marklineDataArr.push(arr) } // echarts組件里的屬性 option.series[0].markLine = { clickable: false, itemStyle: { normal: { color: marklineColor, label: { position: "right", textStyle: { fontSize: 12 }, formatter: function (param) { if (!VSUtils.isEmpty(component.config.markLineLabelScript)) { try { // 計算字符串 var f = eval("(function(value){ " + Base64.decode(component.config.markLineLabelScript) + "})"); return f.call(null, param.value) } catch (e) { console.log(e) } } // return出value度量值 return param.value } } } }, // 新的數據 data: marklineDataArr } } // 判斷指標聯動打開和關閉 if (component.config.receiveMeasureLink != null && component.config.receiveMeasureLink === true) { // 聯動新的度量 var newMeasures = scope.getSelectedLinkMeasure(component, component.config.datasourceConfig.measures); // 設置空數組 var newSeries = []; for (var i = 0; i < measures.length; i++) { if (newMeasures[i] != null) { // push進去數組echarts所需要的data newSeries.push(option.series[i]) } } option.series = newSeries } setTimeout(function () { // 如果沒有提示框則直接禁用 if (component.context.chart.component.tooltip != null) { component.context.chart.component.tooltip.hideTip() } // 重新繪制圖形并清除以前的 setTimeout(function () { component.context.chart.setOption(option, true) }) }); // 判斷提示框的顯示和隱藏 if (component.config.hideOnFirstShow && !component.context.firstShowTooltip) { component.context.firstShowTooltip = true; return } setTimeout(function () { var cachedSelectedValue = scope.getCachedDimensionValue(dimensions[dimensions.length - 1].name); if (cachedSelectedValue != null) { var dataIndex = -1; for (var i = 0; i < component.config.chartConfig.xAxis[0].data.length; i++) { var xAxisValue = "" + component.config.chartConfig.xAxis[0].data[i]; if (component.context.originalXAxisLabels != null && component.context.originalXAxisLabels.length > i) { xAxisValue = component.context.originalXAxisLabels[i] } if (xAxisValue === "" + cachedSelectedValue) { dataIndex = i; break } } if (dataIndex > -1) { setTimeout(function () { component.context.chart.component.tooltip.showTip({ dataIndex: dataIndex, seriesIndex: 0 }) }, showtip_timeout) } } }, 10) }; ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看