Search in sources :

Example 11 with CustomerDefaultCategoryDataset

use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.

the class FrequencyDynamicChartEventReceiver method clearValue.

@Override
public void clearValue() {
    if (dataset != null) {
        // clear old data
        if (dataset instanceof CustomerDefaultCategoryDataset) {
            ((CustomerDefaultCategoryDataset) dataset).clearAll();
        } else {
            TOPChartUtils.getInstance().clearDataset(dataset);
        }
    }
    if (tableViewer != null) {
        TableWithData input = (TableWithData) tableViewer.getInput();
        input.setEntities(null);
        tableViewer.getTable().clearAll();
    }
}
Also used : TableWithData(org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)

Example 12 with CustomerDefaultCategoryDataset

use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.

the class DateFrequencyStateUtil method getCustomerDataset.

public static ICustomerDataset getCustomerDataset(List<IndicatorUnit> units, int sortType) {
    CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
    for (IndicatorUnit unit : units) {
        if (unit.isExcuted()) {
            FrequencyExt[] frequencyExt = (FrequencyExt[]) unit.getValue();
            ComparatorsFactory.sort(frequencyExt, sortType);
            int numOfShown = FrequencyTypeStateUtil.getNumberOfShown(unit, frequencyExt);
            for (int i = 0; i < numOfShown; i++) {
                FrequencyExt freqExt = frequencyExt[i];
                String keyLabel = FrequencyTypeStateUtil.getKeyLabel(freqExt, 30);
                customerdataset.addValue(freqExt.getValue(), unit.getIndicatorName(), keyLabel);
                ChartDataEntity entity = createDataEntity(unit, freqExt, keyLabel);
                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)

Example 13 with CustomerDefaultCategoryDataset

use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.

the class FunctionalDependencyAnalysisResultPage method createChart.

/**
 * DOC jet create result chart.
 * <p>
 * the chart must include
 *
 * @param sectionClient
 * @param analysis
 */
private void createChart(Composite sectionClient, Analysis analysis) {
    CustomerDefaultCategoryDataset dataset = initCustomerDataset();
    Object createChart = TOPChartUtils.getInstance().createStackedBarChart(DefaultMessagesImpl.getString("ColumnDependencyResultPage.dependencyStrength"), dataset, true, // $NON-NLS-1$
    true);
    TOPChartUtils.getInstance().decorateColumnDependency(createChart);
    Object chartComp = TOPChartUtils.getInstance().createChartComposite(sectionClient, SWT.NONE, createChart, true);
    addMenuToChartComp(chartComp, new ColumnDependencyExplorer(), getAnalysisHandler().getAnalysis(), ((ICustomerDataset) dataset).getDataEntities());
}
Also used : ColumnDependencyExplorer(org.talend.dq.analysis.explore.ColumnDependencyExplorer) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)

Example 14 with CustomerDefaultCategoryDataset

use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.

the class RedundancyAnalysisResultPage method creatChart.

private void creatChart(Composite parent, String tableA, String tableB) {
    CustomerDefaultCategoryDataset dataset = new CustomerDefaultCategoryDataset();
    // DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.addValue(rowMatchingIndicatorA.getNotMatchingValueCount(), NOT_MATCHING, tableA);
    dataset.addValue(rowMatchingIndicatorA.getMatchingValueCount(), MATCHING, tableA);
    // add by hcheng
    PatternChartDataEntity dataEntityA = new PatternChartDataEntity();
    dataEntityA.setLabel(tableA);
    dataEntityA.setIndicator(rowMatchingIndicatorA);
    dataEntityA.setNumMatch(rowMatchingIndicatorA.getMatchingValueCount().toString());
    dataEntityA.setNumNoMatch(rowMatchingIndicatorA.getNotMatchingValueCount().toString());
    dataset.addDataEntity(dataEntityA);
    if (!isHasDeactivatedIndicator) {
        dataset.addValue(rowMatchingIndicatorB.getNotMatchingValueCount(), NOT_MATCHING, tableB);
        dataset.addValue(rowMatchingIndicatorB.getMatchingValueCount(), MATCHING, tableB);
        PatternChartDataEntity dataEntityB = new PatternChartDataEntity();
        dataEntityB.setLabel(tableB);
        dataEntityB.setIndicator(rowMatchingIndicatorB);
        dataEntityB.setNumMatch(rowMatchingIndicatorB.getMatchingValueCount().toString());
        dataEntityB.setNumNoMatch(rowMatchingIndicatorB.getNotMatchingValueCount().toString());
        dataset.addDataEntity(dataEntityB);
    }
    Object chart = TOPChartUtils.getInstance().createStackedBarChart(// $NON-NLS-1$
    DefaultMessagesImpl.getString("ColumnsComparisonAnalysisResultPage.ColumnsComparison"), // $NON-NLS-1$
    dataset, true, true);
    final Object chartComp = TOPChartUtils.getInstance().createChartComposite(parent, SWT.NONE, chart, true);
    // add by hcheng for 6530(add menu to "View query result" for chart )
    addMenuToChartComp(chartComp, new RowMatchExplorer(), getAnalysisHandler().getAnalysis(), ((ICustomerDataset) dataset).getDataEntities());
}
Also used : PatternChartDataEntity(org.talend.dq.indicators.preview.table.PatternChartDataEntity) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset) RowMatchExplorer(org.talend.dq.analysis.explore.RowMatchExplorer)

Example 15 with CustomerDefaultCategoryDataset

use of org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset in project tdq-studio-se by Talend.

the class BenfordLawFrequencyStateTest method testSetValueToDataset.

/**
 * Test method for
 * {@link org.talend.dataprofiler.core.ui.editor.preview.model.states.freq.BenfordLawFrequencyState#setValueToDataset(org.talend.dataprofiler.core.ui.editor.preview.model.dataset.CustomerDefaultCategoryDataset, org.talend.dq.indicators.ext.FrequencyExt, java.lang.String)}
 * .
 */
@Test
public void testSetValueToDataset() {
    CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
    FrequencyExt fre = new FrequencyExt();
    fre.setKey(2);
    fre.setValue(3l);
    fre.setFrequency(0.33);
    // $NON-NLS-1$
    benState.setValueToDataset(customerdataset, fre, "2");
    Number n = TOPChartUtils.getInstance().getValue(customerdataset.getDataset(), 0, 0);
    Assert.assertEquals(0.33, n);
}
Also used : CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset) FrequencyExt(org.talend.dq.indicators.ext.FrequencyExt) Test(org.junit.Test)

Aggregations

CustomerDefaultCategoryDataset (org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)20 ChartDataEntity (org.talend.dq.indicators.preview.table.ChartDataEntity)12 IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)10 FrequencyExt (org.talend.dq.indicators.ext.FrequencyExt)5 PatternChartDataEntity (org.talend.dq.indicators.preview.table.PatternChartDataEntity)4 TableIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit)3 ArrayList (java.util.ArrayList)2 ColumnDependencyExplorer (org.talend.dq.analysis.explore.ColumnDependencyExplorer)2 HashMap (java.util.HashMap)1 List (java.util.List)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 GridData (org.eclipse.swt.layout.GridData)1 Table (org.eclipse.swt.widgets.Table)1 TableColumn (org.eclipse.swt.widgets.TableColumn)1 TableItem (org.eclipse.swt.widgets.TableItem)1 Test (org.junit.Test)1 ICustomerDataset (org.talend.dataprofiler.common.ui.editor.preview.ICustomerDataset)1 TableWithData (org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData)1 CustomerDefaultBAWDataset (org.talend.dataprofiler.core.ui.editor.preview.model.dataset.CustomerDefaultBAWDataset)1 TableStructureEntity (org.talend.dataprofiler.core.ui.editor.preview.model.entity.TableStructureEntity)1