use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.
the class TextStatisticsState method getCustomerDataset.
public ICustomerDataset getCustomerDataset() {
// sort these indicators.
ComparatorsFactory.sort(units, ComparatorsFactory.TEXT_STATISTICS_COMPARATOR_ID);
CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
for (IndicatorUnit unit : units) {
String value = CommonStateUtil.getUnitValue(unit.getValue(), StringFormatUtil.DOUBLE_NUMBER);
String label = unit.getIndicatorName();
customerdataset.addValue(Double.parseDouble(value), label, label);
ChartDataEntity entity = CommonStateUtil.createDataEntity(unit, value, label);
customerdataset.addDataEntity(entity);
}
return customerdataset;
}
use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.
the class FrequencyTypeStates method getCustomerDataset.
public ICustomerDataset getCustomerDataset() {
CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
boolean withRowCountIndicator = isWithRowCountIndicator();
for (IndicatorUnit unit : units) {
if (unit.isExcuted() && !this.isSupportDynamicChart) {
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, 200);
setValueToDataset(customerdataset, freqExt, keyLabel);
ChartDataEntity entity = FrequencyTypeStateUtil.createChartEntity(unit.getIndicator(), freqExt, keyLabel, withRowCountIndicator);
customerdataset.addDataEntity(entity);
}
} else {
ChartDataEntity entity = FrequencyTypeStateUtil.createChartEntity(unit.getIndicator(), null, SpecialValueDisplay.EMPTY_FIELD, false);
FrequencyExt fre = new FrequencyExt();
fre.setValue(0l);
fre.setFrequency(0d);
setValueToDataset(customerdataset, fre, unit.getIndicatorName());
customerdataset.addDataEntity(entity);
}
}
return customerdataset;
}
use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.
the class WhereRuleStatisticsStateTable method getCustomerDatasetRownCount.
/**
* DOC xqliu Comment method "getCustomerDatasetRownCount".
*
* @return
*/
public ICustomerDataset getCustomerDatasetRownCount() {
CustomerDefaultCategoryDataset customerDataset = new CustomerDefaultCategoryDataset();
TableIndicatorUnit rownCountUnit = getRownCountUnit(units);
if (rownCountUnit != null) {
addRownCountDataEntity2CustomerDataset(customerDataset, rownCountUnit);
}
return customerDataset;
}
use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.
the class PatternStatisticsState method getCustomerDataset.
public ICustomerDataset getCustomerDataset() {
CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
for (IndicatorUnit unit : units) {
String label = unit.getIndicator().getName();
PatternMatchingExt patternExt = PatternStatisticeStateUtil.getUnitValue(unit.getIndicator(), unit.getValue());
String notMathCount = PatternStatisticeStateUtil.getNotMatchCount(patternExt);
String machCount = PatternStatisticeStateUtil.getMatchCount(patternExt);
customerdataset.addValue(Double.parseDouble(notMathCount), DefaultMessagesImpl.getString("PatternStatisticsState.NotMatching"), // $NON-NLS-1$
label);
customerdataset.addValue(Double.parseDouble(machCount), DefaultMessagesImpl.getString("PatternStatisticsState.Matching"), // $NON-NLS-1$
label);
PatternChartDataEntity patternEntity = PatternStatisticeStateUtil.createDataEntity(unit, label, notMathCount, machCount);
customerdataset.addDataEntity(patternEntity);
}
return customerdataset;
}
use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.
the class FrequencyDynamicChartEventReceiver method setFrequecyToDataset.
private void setFrequecyToDataset(Object customerdataset, FrequencyExt[] frequencyExt, Indicator indicator) {
int numOfShown = frequencyExt.length;
IndicatorParameters parameters = indicator.getParameters();
if (parameters != null) {
if (parameters.getTopN() < numOfShown) {
numOfShown = parameters.getTopN();
}
}
FrequencyExt[] tempFreq = handleFrequency(frequencyExt);
clearDataEntity(customerdataset);
boolean withRowCountIndicator = FrequencyTypeStateUtil.isWithRowCountIndicator(indicator);
// Added TDQ-12870
List columnKeys = TOPChartUtils.getInstance().getColumnKeys(customerdataset);
FrequencyExt freqE = tempFreq[0];
if (!columnKeys.contains(String.valueOf(freqE.getKey()))) {
// columnKeys.clear();
TOPChartUtils.getInstance().clearDataset(customerdataset);
ICustomerDataset customerDataset = TOPChartUtils.getInstance().getCustomerDataset(customerdataset);
if (customerDataset != null && customerDataset instanceof CustomerDefaultCategoryDataset) {
((CustomerDefaultCategoryDataset) customerDataset).clearAll();
}
}
for (int i = 0; i < numOfShown; i++) {
FrequencyExt freqExt = tempFreq[i];
String keyLabel = String.valueOf(freqExt.getKey());
if ("null".equals(keyLabel)) {
// $NON-NLS-1$
keyLabel = SpecialValueDisplay.NULL_FIELD;
}
if ("".equals(keyLabel)) {
// $NON-NLS-1$
keyLabel = SpecialValueDisplay.EMPTY_FIELD;
}
ChartDataEntity entity = FrequencyTypeStateUtil.createChartEntity(indicator, freqExt, keyLabel, withRowCountIndicator);
if (customerdataset instanceof CustomerDefaultCategoryDataset) {
((CustomerDefaultCategoryDataset) customerdataset).addDataEntity(entity);
addValueToDataset(((CustomerDefaultCategoryDataset) customerdataset).getDataset(), freqExt, keyLabel);
} else {
ICustomerDataset customerDataset = TOPChartUtils.getInstance().getCustomerDataset(customerdataset);
if (customerDataset != null && customerDataset instanceof CustomerDefaultCategoryDataset) {
customerDataset.addDataEntity(entity);
addValueToDataset(((CustomerDefaultCategoryDataset) customerDataset).getDataset(), freqExt, keyLabel);
}
}
}
}
Aggregations