From 9184af817c210b030036452f94eba9017154d1ff Mon Sep 17 00:00:00 2001 From: yigekaiguan Date: Wed, 3 Nov 2021 20:10:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E8=A1=A8JS=E5=AF=B9=E8=B1=A1=E7=9A=84?= =?UTF-8?q?dataSetPropertiesOfSign=E5=87=BD=E6=95=B0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=94=B1(chartDataSet,dataSign)=E9=87=8D=E6=9E=84=E4=B8=BA(cha?= =?UTF-8?q?rtDataSet,dataSetProperties,dataSign)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/static/script/chartFactory.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/datagear-web/src/main/resources/org/datagear/web/static/script/chartFactory.js b/datagear-web/src/main/resources/org/datagear/web/static/script/chartFactory.js index a718fe192..93b3ff6fb 100644 --- a/datagear-web/src/main/resources/org/datagear/web/static/script/chartFactory.js +++ b/datagear-web/src/main/resources/org/datagear/web/static/script/chartFactory.js @@ -1836,27 +1836,36 @@ */ chartBase.dataSetPropertyOfSign = function(chartDataSet, dataSign) { - var properties = this.dataSetPropertiesOfSign(chartDataSet, dataSign); + var properties = this.dataSetProperties(chartDataSet, false); + var re = this.dataSetPropertiesOfSign(chartDataSet, properties, dataSign); - return (properties.length > 0 ? properties[0] : undefined); + return (re.length > 0 ? re[0] : undefined); }; /** * 获取指定标记的数据集属性数组。 * * @param chartDataSet 图表数据集对象 + * @param dataSetProperties 可选,待筛选的数据集属性数组,默认为chartBase.dataSetProperties(chartDataSet)。 * @param dataSign 数据标记对象、标记名称 * @return [...] */ - chartBase.dataSetPropertiesOfSign = function(chartDataSet, dataSign) + chartBase.dataSetPropertiesOfSign = function(chartDataSet, dataSetProperties, dataSign) { + //(chartDataSet, dataSign),兼容2.9.0版本的API + if(arguments.length == 2) + { + dataSign = dataSetProperties; + dataSetProperties = null; + } + var re = []; - if(!chartDataSet || !chartDataSet.dataSet || !dataSign) + if(!chartDataSet || !dataSign) return re; + dataSetProperties = (dataSetProperties || this.dataSetProperties(chartDataSet)); dataSign = (dataSign.name || dataSign); - var dataSetProperties = (chartDataSet.dataSet.properties || []); var propertySigns = (chartDataSet.propertySigns || {}); var signPropertyNames = [];