Search in sources :

Example 1 with BenfordFrequencyDynamicChartEventReceiver

use of org.talend.dataprofiler.core.ui.events.BenfordFrequencyDynamicChartEventReceiver in project tdq-studio-se by Talend.

the class AnalysisUtils method createDynamicChartEventReceiver.

/**
 * create a DynamicChart Event Receiver, according to its type
 *
 * @param categoryDataset
 * @param index
 * @param oneIndicator
 * @param eIndicatorChartType
 * @return
 */
public static DynamicChartEventReceiver createDynamicChartEventReceiver(DynamicIndicatorModel indicatorModel, int index, Indicator oneIndicator) {
    DynamicChartEventReceiver eReceiver = null;
    if (isBenford(indicatorModel.getChartType())) {
        eReceiver = new BenfordFrequencyDynamicChartEventReceiver();
        ((BenfordFrequencyDynamicChartEventReceiver) eReceiver).setSecondDataset(indicatorModel.getSecondDataset());
    } else if (isFrequency(indicatorModel.getChartType())) {
        // TDQ-12870, should clear the last result
        oneIndicator.setCount(0l);
        eReceiver = new FrequencyDynamicChartEventReceiver();
    } else if (isPattern(indicatorModel.getChartType())) {
        eReceiver = new PatternDynamicChartEventReceiver();
    } else {
        eReceiver = new DynamicChartEventReceiver();
    }
    eReceiver.setDataset(indicatorModel.getDataset());
    eReceiver.setIndexInDataset(index);
    eReceiver.setIndicatorName(oneIndicator.getName());
    eReceiver.setIndicator(oneIndicator);
    return eReceiver;
}
Also used : BenfordFrequencyDynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.BenfordFrequencyDynamicChartEventReceiver) BenfordFrequencyDynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.BenfordFrequencyDynamicChartEventReceiver) FrequencyDynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.FrequencyDynamicChartEventReceiver) PatternDynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.PatternDynamicChartEventReceiver) DynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.DynamicChartEventReceiver) BenfordFrequencyDynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.BenfordFrequencyDynamicChartEventReceiver) PatternDynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.PatternDynamicChartEventReceiver) FrequencyDynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.FrequencyDynamicChartEventReceiver)

Aggregations

BenfordFrequencyDynamicChartEventReceiver (org.talend.dataprofiler.core.ui.events.BenfordFrequencyDynamicChartEventReceiver)1 DynamicChartEventReceiver (org.talend.dataprofiler.core.ui.events.DynamicChartEventReceiver)1 FrequencyDynamicChartEventReceiver (org.talend.dataprofiler.core.ui.events.FrequencyDynamicChartEventReceiver)1 PatternDynamicChartEventReceiver (org.talend.dataprofiler.core.ui.events.PatternDynamicChartEventReceiver)1