use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.
the class PieStatisticsState method getCustomerDataset.
public ICustomerDataset getCustomerDataset() {
CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
for (IndicatorUnit unit : units) {
if (unit.isExcuted()) {
FrequencyExt[] frequencyExt = (FrequencyExt[]) unit.getValue();
int numOfShown = PieStatisticsStateUtil.getNumberOfShown(unit, frequencyExt);
for (int i = 0; i < numOfShown; i++) {
FrequencyExt freqExt = frequencyExt[i];
String keyLabel = PieStatisticsStateUtil.getkeyLabel(freqExt);
customerdataset.addValue(freqExt.getValue(), PluginConstant.EMPTY_STRING, keyLabel);
ChartDataEntity entity = PieStatisticsStateUtil.createDataEntity(unit, freqExt, keyLabel);
customerdataset.addDataEntity(entity);
}
}
}
return customerdataset;
}
use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.
the class SimpleStatisticsState method getCustomerDataset.
public ICustomerDataset getCustomerDataset() {
CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
for (IndicatorUnit unit : units) {
String value = CommonStateUtil.getUnitValue(unit.getValue(), 0);
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 SimpleTextStatisticsState method getCustomerDataset.
@Override
public ICustomerDataset getCustomerDataset() {
// sort these indicators.
ComparatorsFactory.sort(units, ComparatorsFactory.TEXT_STATISTICS_COMPARATOR_ID);
CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
for (IndicatorUnit unit : units) {
double value = unit.getValue() != null ? Double.parseDouble(unit.getValue().toString()) : Double.NaN;
String label = unit.getIndicatorName();
// $NON-NLS-1$
String type = "";
switch(unit.getType()) {
case MinLengthWithNullIndicatorEnum:
case MinLengthWithBlankIndicatorEnum:
case MinLengthWithBlankNullIndicatorEnum:
// $NON-NLS-1$
type = "Minimal";
break;
case MaxLengthWithBlankIndicatorEnum:
case MaxLengthWithBlankNullIndicatorEnum:
case MaxLengthWithNullIndicatorEnum:
// $NON-NLS-1$
type = "Maximal";
break;
case AverageLengthWithNullIndicatorEnum:
case AverageLengthWithBlankIndicatorEnum:
case AverageLengthWithNullBlankIndicatorEnum:
// $NON-NLS-1$
type = "Average";
break;
default:
type = label;
break;
}
customerdataset.addValue(value, type, label);
ChartDataEntity entity = new ChartDataEntity();
entity.setIndicator(unit.getIndicator());
entity.setLabel(label);
entity.setValue(String.valueOf(value));
entity.setPercent(value / unit.getIndicator().getCount());
customerdataset.addDataEntity(entity);
}
return customerdataset;
}
use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.
the class SummaryStatisticsState method getCustomerDataset.
public ICustomerDataset getCustomerDataset() {
Map<IndicatorEnum, Double> map = new HashMap<IndicatorEnum, Double>();
CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
for (IndicatorUnit unit : units) {
// MOD xqliu 2009-06-29 bug 7068
String value = null;
if (indicators2ValueMap.containsKey(unit)) {
value = indicators2ValueMap.get(unit);
} else {
value = summaryUtil.getUnitValue(unit);
}
if (Java2SqlType.isNumbericInSQL(sqltype)) {
try {
map.put(unit.getType(), Double.parseDouble(value));
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
ChartDataEntity entity = summaryUtil.createDataEntity(unit, value);
customerdataset.addDataEntity(entity);
}
if (isIntact() && !isSupportDynamicChart) {
CustomerDefaultBAWDataset dataset = new CustomerDefaultBAWDataset(map.get(IndicatorEnum.MeanIndicatorEnum), map.get(IndicatorEnum.MedianIndicatorEnum), map.get(IndicatorEnum.LowerQuartileIndicatorEnum), map.get(IndicatorEnum.UpperQuartileIndicatorEnum), map.get(IndicatorEnum.MinValueIndicatorEnum), map.get(IndicatorEnum.MaxValueIndicatorEnum), customerdataset);
dataset.addDataEntity(customerdataset.getDataEntities());
return dataset;
} else {
// MOD hcheng,Range indicator value should not appear in bar chart
if (!isIntact()) {
map.remove(IndicatorEnum.RangeIndicatorEnum);
map.remove(IndicatorEnum.IQRIndicatorEnum);
}
for (IndicatorEnum indicatorEnum : map.keySet()) {
customerdataset.addValue(map.get(indicatorEnum), indicatorEnum.getLabel(), indicatorEnum.getLabel());
}
return customerdataset;
}
}
use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.
the class WhereRuleStatisticsStateTable method getOptimizeShowDataset.
/**
* DOC xqliu Comment method "getOptimizeShowDataset". ADD xqliu 2010-03-10 feature 10834
*
* @return
*/
private List<Object> getOptimizeShowDataset() {
List<Object> result = new ArrayList<Object>();
// get the page size
int size = getSizeOfDQRulePerChart();
// Add RowCountIndicator dataset
CustomerDefaultCategoryDataset customerDatasetRownCount = new CustomerDefaultCategoryDataset();
// MOD msjian TDQ-5119: fix a NPE
if (units != null && units.size() > 0) {
addRownCountDataEntity2CustomerDataset(customerDatasetRownCount, getRownCountUnit(units));
result.add(customerDatasetRownCount);
// MOD xqliu 2012-04-23 TDQ-5057: don't include RowCountUnit
List<TableIndicatorUnit> whereRuleUnits = removeRowCountUnit(units);
int totalNum = whereRuleUnits.size();
int pageNum = totalNum % size == 0 ? totalNum / size : totalNum / size + 1;
for (int i = 0; i < pageNum; i++) {
CustomerDefaultCategoryDataset customerDataset = new CustomerDefaultCategoryDataset();
for (int j = 0; j < size; ++j) {
int index = i * size + j;
if (index < totalNum) {
addDataEntity2CustomerDataset(customerDataset, whereRuleUnits.get(index));
} else {
break;
}
}
result.add(customerDataset);
}
}
return result;
}
Aggregations