diff --git a/plugin.xml b/plugin.xml index 9190080..8d6ba38 100644 --- a/plugin.xml +++ b/plugin.xml @@ -3,13 +3,14 @@ com.finebi.plugin.custom.chart.demo.v6 yes - 1.6.0 + 1.6.1 11.0~11.0 6.0~ 2023-05-16 fanruan diff --git a/src/main/java/com/finebi/plugin/custom/component/DemoComponentProvider.java b/src/main/java/com/finebi/plugin/custom/component/DemoComponentProvider.java index 1a4e70a..69a98c2 100644 --- a/src/main/java/com/finebi/plugin/custom/component/DemoComponentProvider.java +++ b/src/main/java/com/finebi/plugin/custom/component/DemoComponentProvider.java @@ -3,7 +3,8 @@ package com.finebi.plugin.custom.component; import com.finebi.common.context.OperationContext; import com.finebi.provider.api.component.AbstractCustomComponentProvider; import com.finebi.provider.api.component.CustomComponentContext; -import com.finebi.provider.api.component.DataModel; +import com.finebi.provider.api.component.data.DataModel; +import com.finebi.provider.api.component.data.Dimension; import com.fr.general.IOUtils; import com.fr.plugin.transform.ExecuteFunctionRecord; import com.fr.plugin.transform.FunctionRecorder; @@ -111,19 +112,19 @@ public class DemoComponentProvider extends AbstractCustomComponentProvider { */ @Override public List process(List dataModels, CustomComponentContext customComponentContext) { - return dataModels.stream().map(dataModel -> new DataModel() { @Override - public List getFields() { + public List getFields() { return dataModel.getFields(); } @Override public List> getColData() { List> colData = new ArrayList<>(dataModel.getFields().size()); - dataModel.getColData().forEach(d -> colData.add(Collections.singletonList(d.get(0)))); + dataModel.getColData().forEach(d -> colData.add(Collections.singletonList(d.get((int) (Math.random() * d.size()))))); return colData; } }).collect(Collectors.toList()); } + }