use of org.talend.dq.indicators.preview.table.ChartDataEntity in project tdq-studio-se by Talend.
the class TableDynamicChartEventReceiver method handle.
@Override
public boolean handle(Object value) {
if (value == null) {
return false;
}
if (IndicatorEnum.RowCountIndicatorEnum.equals(this.getIndicatorType())) {
super.handle(value);
} else {
Long count = getIndicator().getCount();
double valueMatch = WhereRuleStatisticsStateUtil.getMatchValue(value);
double valueNotmatch = WhereRuleStatisticsStateUtil.getNotMatchValue(value, valueMatch, count);
if (dataset != null) {
TOPChartUtils.getInstance().setValue(dataset, valueNotmatch, WhereRuleStatisticsStateTable.ROW_KEY_NOT_PASS, indicatorName);
TOPChartUtils.getInstance().setValue(dataset, valueMatch, WhereRuleStatisticsStateTable.ROW_KEY_PASS, indicatorName);
}
if (tableViewer != null) {
TableWithData input = (TableWithData) tableViewer.getInput();
if (input != null) {
ChartDataEntity[] dataEntities = input.getEnity();
((WhereRuleChartDataEntity) dataEntities[this.getEntityIndex()]).setNumMatch(String.valueOf(valueMatch));
((WhereRuleChartDataEntity) dataEntities[this.getEntityIndex()]).setNumNoMatch(String.valueOf(valueNotmatch));
tableViewer.getTable().clearAll();
tableViewer.setInput(input);
}
}
}
return true;
}
use of org.talend.dq.indicators.preview.table.ChartDataEntity in project tdq-studio-se by Talend.
the class FrequencyTableState method getDataEntity.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.editor.preview.model.states.table.AbstractTableTypeStates#getDataEntity()
*/
@Override
public ChartDataEntity[] getDataEntity() {
List<ChartDataEntity> dataEnities = new ArrayList<ChartDataEntity>();
boolean withRowCountIndicator = isWithRowCountIndicator();
for (IndicatorUnit unit : units) {
if (unit.isExcuted()) {
FrequencyExt[] frequencyExt = (FrequencyExt[]) unit.getValue();
sortIndicator(frequencyExt);
int numOfShown = FrequencyTypeStateUtil.getNumberOfShown(unit, frequencyExt);
for (int i = 0; i < numOfShown; i++) {
FrequencyExt freqExt = frequencyExt[i];
String keyLabel = FrequencyTypeStateUtil.getKeyLabel(freqExt, 30);
dataEnities.add(FrequencyTypeStateUtil.createChartEntity(unit.getIndicator(), freqExt, keyLabel, withRowCountIndicator));
}
} else {
// TDQ-11422: before analysis run turn to Analysis Results page, there should show nothing data
// dataEnities.add(FrequencyTypeStateUtil.createChartEntity(unit.getIndicator(), null, null, false));
}
}
return dataEnities.toArray(new ChartDataEntity[dataEnities.size()]);
}
use of org.talend.dq.indicators.preview.table.ChartDataEntity in project tdq-studio-se by Talend.
the class ModeStatisticsTableState method getDataEntity.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.editor.preview.model.states.table.AbstractTableTypeStates#getDataEntity()
*/
@Override
public ChartDataEntity[] getDataEntity() {
List<ChartDataEntity> dataEnities = new ArrayList<ChartDataEntity>();
for (IndicatorUnit unit : units) {
ChartDataEntity entity = ModeStatisticsStateUtil.createDataEntity(unit, unit.getIndicatorName());
dataEnities.add(entity);
}
return dataEnities.toArray(new ChartDataEntity[dataEnities.size()]);
}
use of org.talend.dq.indicators.preview.table.ChartDataEntity in project tdq-studio-se by Talend.
the class SimpleRuleStatisticsTableState method getDataEntity.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.editor.preview.model.states.table.AbstractTableTypeStates#getDataEntity()
*/
@Override
public ChartDataEntity[] getDataEntity() {
TableIndicatorUnit rownCountUnit = WhereRuleStatisticsStateUtil.getRownCountUnit(tableunits);
List<ChartDataEntity> dataEnities = new ArrayList<ChartDataEntity>();
if (rownCountUnit != null) {
String value = CommonStateUtil.getUnitValue(rownCountUnit.getValue(), StringFormatUtil.DOUBLE_NUMBER);
String label = rownCountUnit.getIndicatorName();
ChartDataEntity createDataEntity = CommonStateUtil.createDataEntity(rownCountUnit, value, label);
dataEnities.add(createDataEntity);
}
return dataEnities.toArray(new ChartDataEntity[dataEnities.size()]);
}
use of org.talend.dq.indicators.preview.table.ChartDataEntity in project tdq-studio-se by Talend.
the class WhereRuleStatisticsTableState method getDataEntityOfRowCount.
/**
* DOC xqliu Comment method "getDataEntityRowCount".
*
* @return
*/
public ChartDataEntity[] getDataEntityOfRowCount() {
TableIndicatorUnit rownCountUnit = WhereRuleStatisticsStateUtil.getRownCountUnit(tableunits);
List<ChartDataEntity> dataEnities = new ArrayList<ChartDataEntity>();
if (rownCountUnit != null) {
// final Object unitValue = rownCountUnit.getValue();
// unitValue != null ?Double.parseDouble(unitValue.toString()): Double.NaN;
String value = CommonStateUtil.getUnitValue(rownCountUnit.getValue(), StringFormatUtil.DOUBLE_NUMBER);
String label = rownCountUnit.getIndicatorName();
ChartDataEntity createDataEntity = CommonStateUtil.createDataEntity(rownCountUnit, value, label);
dataEnities.add(createDataEntity);
}
return dataEnities.toArray(new ChartDataEntity[dataEnities.size()]);
}
Aggregations