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();
}
}
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;
}
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());
}
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());
}
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);
}
Aggregations