@Override public void onSummaryReceived(SummaryReceivedEvent event) { if (getOriginalVariable() != null && event.getResourceUri().equals(getOriginalVariable().getLink() + "/summary")) { SummaryStatisticsDto dto = event.getSummary(); if (dto.getExtension(ContinuousSummaryDto.SummaryStatisticsDtoExtensions.continuous) != null) { ContinuousSummaryDto continuous = dto.getExtension(ContinuousSummaryDto.SummaryStatisticsDtoExtensions.continuous) .cast(); double from = continuous.getSummary().getMin(); double to = continuous.getSummary().getMax(); getView().setValueLimits((long) from, (long) (to + 1)); } } }
private void initDescriptivestats(ContinuousSummaryDto continuous) { DescriptiveStatsDto descriptiveStats = continuous.getSummary(); addDescriptiveStatistics(descriptiveStats); if (descriptiveStats.getVariance() > 0) { histogram = new HistogramChartFactory(); JsArray<IntervalFrequencyDto> frequencyArray = continuous.getIntervalFrequencyArray(); if (frequencyArray != null) { int length = frequencyArray.length(); for (int i = 0; i < length; i++) { IntervalFrequencyDto value = frequencyArray.get(i); histogram.push(value.getDensity(), value.getLower(), value.getUpper()); } } qqPlot = new NormalProbabilityChartFactory(descriptiveStats.getMin(), descriptiveStats.getMax()); qqPlot.push( descriptiveStats.getPercentilesArray(), continuous.getDistributionPercentilesArray()); } }