Search in sources :

Example 16 with ChartDataEntity

use of org.talend.dq.indicators.preview.table.ChartDataEntity in project tdq-studio-se by Talend.

the class ModeStatisticsState method getCustomerDataset.

public ICustomerDataset getCustomerDataset() {
    CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
    for (IndicatorUnit unit : units) {
        ChartDataEntity entity = ModeStatisticsStateUtil.createDataEntity(unit, unit.getIndicatorName());
        customerdataset.addDataEntity(entity);
    }
    return customerdataset;
}
Also used : IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)

Example 17 with ChartDataEntity

use of org.talend.dq.indicators.preview.table.ChartDataEntity in project tdq-studio-se by Talend.

the class PhoneNumbStatisticsState method getCustomerDataset.

/*
     * (non-Jsdoc)
     * 
     * @see org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates#getCustomerDataset()
     */
public ICustomerDataset getCustomerDataset() {
    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 = PhoneNumbStatisticsStateUtil.createDataEntity(unit.getIndicator(), value, label);
        customerdataset.addDataEntity(entity);
    }
    return customerdataset;
}
Also used : IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)

Example 18 with ChartDataEntity

use of org.talend.dq.indicators.preview.table.ChartDataEntity in project tdq-studio-se by Talend.

the class SimpleRuleStatisticsChartState method getCustomerDataset.

public ICustomerDataset getCustomerDataset() {
    CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
    for (TableIndicatorUnit unit : units) {
        String value = CommonStateUtil.getUnitValue(unit.getValue(), StringFormatUtil.DOUBLE_NUMBER);
        String label = unit.getIndicatorName();
        // $NON-NLS-1$
        customerdataset.addValue(Double.parseDouble(value), label, "");
        ChartDataEntity entity = CommonStateUtil.createDataEntity(unit, value, label);
        customerdataset.addDataEntity(entity);
    }
    return customerdataset;
}
Also used : TableIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)

Example 19 with ChartDataEntity

use of org.talend.dq.indicators.preview.table.ChartDataEntity 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;
}
Also used : IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)

Example 20 with ChartDataEntity

use of org.talend.dq.indicators.preview.table.ChartDataEntity 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;
}
Also used : IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset) FrequencyExt(org.talend.dq.indicators.ext.FrequencyExt)

Aggregations

ChartDataEntity (org.talend.dq.indicators.preview.table.ChartDataEntity)61 IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)17 ArrayList (java.util.ArrayList)16 Test (org.junit.Test)13 TdColumn (org.talend.cwm.relational.TdColumn)13 CustomerDefaultCategoryDataset (org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)12 Analysis (org.talend.dataquality.analysis.Analysis)11 IndicatorParameters (org.talend.dataquality.indicators.IndicatorParameters)10 TdTable (org.talend.cwm.relational.TdTable)9 TdExpression (org.talend.cwm.relational.TdExpression)8 AnalysisContext (org.talend.dataquality.analysis.AnalysisContext)8 FrequencyExt (org.talend.dq.indicators.ext.FrequencyExt)8 DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)7 TableWithData (org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData)7 PatternMatchingIndicator (org.talend.dataquality.indicators.PatternMatchingIndicator)6 UDIndicatorDefinition (org.talend.dataquality.indicators.definition.userdefine.UDIndicatorDefinition)6 Expression (orgomg.cwm.objectmodel.core.Expression)6 Domain (org.talend.dataquality.domain.Domain)5 Pattern (org.talend.dataquality.domain.pattern.Pattern)5 RegularExpression (org.talend.dataquality.domain.pattern.RegularExpression)5