shine
3 years ago
6 changed files with 70 additions and 2 deletions
@ -0,0 +1,35 @@
|
||||
package com.fr.design.mainframe.chart.gui.data; |
||||
|
||||
import com.fr.base.chart.chartdata.TopDefinitionProvider; |
||||
import com.fr.chart.chartattr.ChartCollection; |
||||
import com.fr.chart.chartattr.Plot; |
||||
import com.fr.plugin.chart.attr.axis.VanChartAxis; |
||||
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle; |
||||
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; |
||||
import com.fr.van.chart.config.DefaultStyleHelper4Van; |
||||
|
||||
/** |
||||
* @author shine |
||||
* @version 10.0 |
||||
* Created by shine on 2022/4/6 |
||||
*/ |
||||
public class ChartDataHelper { |
||||
|
||||
/** |
||||
* 在update数据集分类的时候,需要联动update一下样式-坐标轴里面的分层样式设置,来自CHART-22873 |
||||
*/ |
||||
public static void updateAxisCategoryStyles(ChartCollection chartCollection) { |
||||
TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition(); |
||||
int size = definition == null ? 1 : definition.getMoreCateSize() + 1; |
||||
|
||||
Plot plot = chartCollection.getSelectedChart().getPlot(); |
||||
if (plot instanceof VanChartAxisPlot) { |
||||
for (VanChartAxis axis : ((VanChartAxisPlot) plot).getXAxisList()) { |
||||
axis.clearCategoryStyles(); |
||||
for (int i = 0; i < size; i++) { |
||||
axis.addCategoryStyle(DefaultStyleHelper4Van.dealAxisCheckTheme(new VanChartAxisLabelStyle())); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue