@ -16,6 +16,8 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils ;
import com.fr.log.FineLoggerFactory ;
import com.fr.plugin.chart.base.AttrTooltipRichText ;
import com.fr.plugin.chart.custom.CustomDefinition ;
import com.fr.plugin.chart.custom.type.CustomPlotType ;
import com.fr.plugin.chart.type.TextAlign ;
import com.fr.stable.StringUtils ;
import com.fr.van.chart.designer.PlotFactory ;
@ -48,21 +50,46 @@ public class VanChartRichEditorPane {
return fieldNames ;
}
public static void refreshFieldNames ( Chart chart ) {
VanChartRichEditorPane . fieldNames = null ;
// 更新普通图表中指定plot的数据集字段
public static void refreshCommonChartFieldNames ( Chart chart ) {
if ( chart = = null ) {
return ;
}
Plot plot = chart . getPlot ( ) ;
if ( plot = = null | | ! PlotFactory . plotSupportAddTableField ( plot ) ) {
if ( plot = = null ) {
return ;
}
VanChartRichEditorPane . fieldNames = null ;
if ( ! PlotFactory . plotSupportAddTableField ( plot ) ) {
return ;
}
TopDefinitionProvider definition = chart . getFilterDefinition ( ) ;
VanChartRichEditorPane . refreshFieldNames ( definition ) ;
}
// 更新组合图表中指定plot的数据集字段
public static void refreshCustomChartTableFieldNames ( Chart chart , CustomPlotType plotType ) {
if ( chart = = null | | plotType = = null ) {
return ;
}
VanChartRichEditorPane . fieldNames = null ;
TopDefinitionProvider filterDefinition = chart . getFilterDefinition ( ) ;
if ( filterDefinition instanceof CustomDefinition ) {
CustomDefinition customDefinition = ( CustomDefinition ) filterDefinition ;
Map < CustomPlotType , TopDefinitionProvider > definitionProviderMap = customDefinition . getDefinitionProviderMap ( ) ;
VanChartRichEditorPane . refreshFieldNames ( definitionProviderMap . get ( plotType ) ) ;
}
}
// 更新富文本数据集字段
public static void refreshFieldNames ( TopDefinitionProvider definition ) {
if ( definition = = null ) {
return ;
}