@Override protected void initExample() { seekBar.setOnSeekBarChangeListener(this); final NumericAxis xAxis = sciChartBuilder.newNumericAxis().withAxisAlignment(AxisAlignment.Bottom).build(); final NumericAxis yAxis = sciChartBuilder.newNumericAxis().withAxisAlignment(AxisAlignment.Right).build(); final UniformHeatmapDataSeries<Integer, Integer, Double> dataSeries = new UniformHeatmapDataSeries<>(Integer.class, Integer.class, Double.class, WIDTH, HEIGHT); paletteProvider.setThresholdValue(seekBar.getProgress()); dataSeries.updateZValues(createValues()); final FastUniformHeatmapRenderableSeries heatmapRenderableSeries = sciChartBuilder.newUniformHeatmap() .withDataSeries(dataSeries) .withMinimum(0) .withMaximum(200) .withPaletteProvider(paletteProvider) .build(); Collections.addAll(chart.getXAxes(), xAxis); Collections.addAll(chart.getYAxes(), yAxis); Collections.addAll(chart.getRenderableSeries(), heatmapRenderableSeries); Collections.addAll(chart.getChartModifiers(), sciChartBuilder.newModifierGroupWithDefaultModifiers().build()); }
@Override protected void initExample() { final NumericAxis xAxis = sciChartBuilder.newNumericAxis().build(); final NumericAxis yAxis = sciChartBuilder.newNumericAxis().build(); final FastUniformHeatmapRenderableSeries heatmapRenderableSeries = sciChartBuilder.newUniformHeatmap() .withColorMap(new ColorMap(new int[]{DarkBlue, CornflowerBlue, DarkGreen, Chartreuse, Yellow, Red}, new float[]{0f, 0.2f, 0.4f, 0.6f, 0.8f, 1})) .withMinimum(0) .withMaximum(200) .withDataSeries(dataSeries) .build(); for (int i = 0; i < SERIES_PER_PERIOD; i++) { valuesList.add(createValues(i)); } colourMap.setMinimum(heatmapRenderableSeries.getMinimum()); colourMap.setMaximum(heatmapRenderableSeries.getMaximum()); colourMap.setColorMap(heatmapRenderableSeries.getColorMap()); Collections.addAll(chart.getXAxes(), xAxis); Collections.addAll(chart.getYAxes(), yAxis); Collections.addAll(chart.getRenderableSeries(), heatmapRenderableSeries); ModifierGroup modifiers = sciChartBuilder.newModifierGroupWithDefaultModifiers() .withCursorModifier().withShowTooltip(true).withReceiveHandledEvents(true).build() .build(); Collections.addAll(chart.getChartModifiers(), modifiers); schedule = scheduledExecutorService.scheduleWithFixedDelay(new Runnable() { @Override public void run() { UpdateSuspender.using(chart, updateDataRunnable); } }, 0, TIME_INTERVAL, TimeUnit.MILLISECONDS); }
@Override protected void initExample() { final NumericAxis xAxis = sciChartBuilder.newNumericAxis() .withGrowBy(0.1, 0.1) .withFlipCoordinates(true) .build(); final NumericAxis yAxis = sciChartBuilder.newNumericAxis() .withGrowBy(0.1, 0.1) .withFlipCoordinates(true) .build(); final FastUniformHeatmapRenderableSeries heatmapRenderableSeries = sciChartBuilder.newUniformHeatmap() .withMinimum(0) .withMaximum(100) .withCellTextStyle(sciChartBuilder.newFont().withTextSize(8).withTextColor(ColorUtil.White).build()) .withDrawTextInCell(true) .withDataSeries(createDataSeries()) .build(); colourMap.setMinimum(heatmapRenderableSeries.getMinimum()); colourMap.setMaximum(heatmapRenderableSeries.getMaximum()); colourMap.setColorMap(heatmapRenderableSeries.getColorMap()); colourMap.setTextFormat(new DecimalFormat("0.##")); Collections.addAll(chart.getXAxes(), xAxis); Collections.addAll(chart.getYAxes(), yAxis); Collections.addAll(chart.getRenderableSeries(), heatmapRenderableSeries); Collections.addAll(chart.getChartModifiers(), sciChartBuilder.newModifierGroupWithDefaultModifiers().build()); }