final IAxis xAxis = sciChartBuilder.newNumericAxis().withGrowBy(0.1d, 0.1d).withAutoRangeMode(AutoRange.Always).build(); final IAxis yAxis = sciChartBuilder.newNumericAxis().withGrowBy(0.1d, 0.1d).withAutoRangeMode(AutoRange.Always).build();
@Override public void run() { final IAxis xBottomAxis = sciChartBuilder.newNumericAxis() .withAutoRangeMode(AutoRange.Never) .withAxisTitle("Time (ms)") .withVisibleRange(new DoubleRange(2.5, 4.5)) .build(); final IAxis yRightAxis = sciChartBuilder.newNumericAxis() .withAutoRangeMode(AutoRange.Never) .withAxisTitle("Voltage (mV)") .withVisibleRange(new DoubleRange(-12.5, 12.5)) .build(); rSeries = sciChartBuilder.newLineSeries() .withDataSeries(dataSeries1) .withXAxisId(xBottomAxis.getAxisId()) .withYAxisId(yRightAxis.getAxisId()) .build(); Collections.addAll(surface.getXAxes(), xBottomAxis); Collections.addAll(surface.getYAxes(), yRightAxis); Collections.addAll(surface.getRenderableSeries(), rSeries); Collections.addAll(surface.getChartModifiers(), sciChartBuilder.newModifierGroupWithDefaultModifiers().build()); } });
@Override public void run() { final NumericAxis xAxis = sciChartBuilder.newNumericAxis() .withVisibleRange(xVisibleRange) .withAutoRangeMode(AutoRange.Never) .build(); final NumericAxis yAxis = sciChartBuilder.newNumericAxis() .withGrowBy(new DoubleRange(0.1d, 0.1d)) .withAutoRangeMode(AutoRange.Always) .build(); final AnimatingLineRenderableSeries rs1 = new AnimatingLineRenderableSeries(); rs1.setDataSeries(ds1); rs1.setStrokeStyle(sciChartBuilder.newPen().withColor(ColorUtil.argb(0xFF, 0x40, 0x83, 0xB7)).withAntiAliasing(true).withThickness(3).build()); Collections.addAll(surface.getXAxes(), xAxis); Collections.addAll(surface.getYAxes(), yAxis); Collections.addAll(surface.getRenderableSeries(), rs1); } });
final IAxis yAxis = sciChartBuilder.newNumericAxis().withAutoRangeMode(AutoRange.Always).withAxisTitle("billions of People").withGrowBy(0, 0.1).withDrawMajorBands(true).build();
.withGrowBy(0.1d, 0.1d) .withAxisAlignment(AxisAlignment.Right) .withAutoRangeMode(AutoRange.Always) .withAxisId("PrimaryAxisId") .withDrawMajorTicks(false) .withGrowBy(0, 3d) .withAxisAlignment(AxisAlignment.Left) .withAutoRangeMode(AutoRange.Always) .withAxisId("SecondaryAxisId") .withDrawMajorTicks(false)
@Override protected void initExample() { final IAxis xAxis = sciChartBuilder.newNumericAxis().withAxisAlignment(AxisAlignment.Bottom).withAutoRangeMode(AutoRange.Always).build(); final IAxis leftAxis = sciChartBuilder.newNumericAxis().withAxisAlignment(AxisAlignment.Left).withAxisId(AxisAlignment.Left.name()).build(); final IAxis rightAxis = sciChartBuilder.newNumericAxis().withAxisAlignment(AxisAlignment.Right).withAxisId(AxisAlignment.Right.name()).build();
.withGrowBy(0.1d, 0.1d) .withAxisAlignment(AxisAlignment.Right) .withAutoRangeMode(AutoRange.Always) .withAxisId("PrimaryAxisId") .withDrawMajorTicks(false) .withGrowBy(0, 3d) .withAxisAlignment(AxisAlignment.Left) .withAutoRangeMode(AutoRange.Always) .withAxisId("SecondaryAxisId") .withDrawMajorTicks(false)
final IAxis yAxis0 = sciChartBuilder.newNumericAxis().withAxisAlignment(AxisAlignment.Left).withAxisId("Ch0").withAxisTitle("Ch0").withVisibleRange(-2, 2).withAutoRangeMode(AutoRange.Never).withDrawMajorGridLines(false).withDrawMinorGridLines(false).withDrawMajorBands(false).build(); final IAxis yAxis1 = sciChartBuilder.newNumericAxis().withAxisAlignment(AxisAlignment.Left).withAxisId("Ch1").withAxisTitle("Ch1").withVisibleRange(-2, 2).withAutoRangeMode(AutoRange.Never).withDrawMajorGridLines(false).withDrawMinorGridLines(false).withDrawMajorBands(false).build(); final IAxis yAxis2 = sciChartBuilder.newNumericAxis().withAxisAlignment(AxisAlignment.Left).withAxisId("Ch2").withAxisTitle("Ch2").withVisibleRange(-2, 2).withAutoRangeMode(AutoRange.Never).withDrawMajorGridLines(false).withDrawMinorGridLines(false).withDrawMajorBands(false).build(); final IAxis yAxis3 = sciChartBuilder.newNumericAxis().withAxisAlignment(AxisAlignment.Left).withAxisId("Ch3").withAxisTitle("Ch3").withVisibleRange(-2, 2).withAutoRangeMode(AutoRange.Never).withDrawMajorGridLines(false).withDrawMinorGridLines(false).withDrawMajorBands(false).build(); final IAxis yAxis4 = sciChartBuilder.newNumericAxis().withAxisAlignment(AxisAlignment.Left).withAxisId("Ch4").withAxisTitle("Ch4").withVisibleRange(-2, 2).withAutoRangeMode(AutoRange.Never).withDrawMajorGridLines(false).withDrawMinorGridLines(false).withDrawMajorBands(false).build();
.withAutoRangeMode(AutoRange.Always) .build(); .withAutoRangeMode(AutoRange.Never) .withVisibleRange(new DoubleRange(-2d, 2d)) .build();
@Override protected void initExample() { final IAxis xAxis = sciChartBuilder.newNumericAxis().withVisibleRange(new DoubleRange(3d, 6d)).build(); final IAxis yAxis = sciChartBuilder.newNumericAxis().withAutoRangeMode(AutoRange.Always).withGrowBy(0.05d, 0.05d).build();
public EegChannelViewHolder(View itemView) { super(itemView); ButterKnife.bind(this, itemView); final NumericAxis xAxis = sciChartBuilder.newNumericAxis() .withGrowBy(new DoubleRange(0.05d, 0.05d)) .withAutoRangeMode(AutoRange.Always) .withDrawMajorBands(false) .withDrawLabels(false) .withDrawMinorTicks(false) .withDrawMajorTicks(false) .withDrawMajorGridLines(false) .withDrawMinorGridLines(false) .build(); final NumericAxis yAxis = sciChartBuilder.newNumericAxis() .withGrowBy(new DoubleRange(0.1d, 0.1d)) .withAutoRangeMode(AutoRange.Always) .withDrawMajorBands(false) .withDrawLabels(false) .withDrawMinorTicks(false) .withDrawMajorTicks(false) .withDrawMajorGridLines(false) .withDrawMinorGridLines(false) .build(); final IRenderableSeries rs = sciChartBuilder.newLineSeries().build(); Collections.addAll(chart.getXAxes(), xAxis); Collections.addAll(chart.getYAxes(), yAxis); Collections.addAll(chart.getRenderableSeries(), rs); }
final IAxis yAxis = sciChartBuilder.newNumericAxis().withGrowBy(0d, 0.1d).withAutoRangeMode(AutoRange.Always).build();
private void initChart() { final IAxis xAxis = sciChartBuilder.newNumericAxis().withAutoRangeMode(AutoRange.Always).build(); final IAxis yAxis = sciChartBuilder.newNumericAxis().withAutoRangeMode(AutoRange.Always).build(); final IRenderableSeries rs1 = sciChartBuilder.newLineSeries().withStrokeStyle(0xFF4083B7).withDataSeries(new XyDataSeries<>(Integer.class, Float.class)).build(); final IRenderableSeries rs2 = sciChartBuilder.newLineSeries().withStrokeStyle(0xFFFFA500).withDataSeries(new XyDataSeries<>(Integer.class, Float.class)).build(); final IRenderableSeries rs3 = sciChartBuilder.newLineSeries().withStrokeStyle(0xFFE13219).withDataSeries(new XyDataSeries<>(Integer.class, Float.class)).build(); textView = new TextView(getActivity()); textView.setPadding(20, 20, 20, 20); final CustomAnnotation annotation = sciChartBuilder.newCustomAnnotation() .withCoordinateMode(AnnotationCoordinateMode.Relative) .withContent(textView) .withZIndex(-1) .withX1(0) .withY1(0) .build(); UpdateSuspender.using(surface, new Runnable() { @Override public void run() { Collections.addAll(surface.getXAxes(), xAxis); Collections.addAll(surface.getYAxes(), yAxis); Collections.addAll(surface.getRenderableSeries(), rs1, rs2, rs3); Collections.addAll(surface.getChartModifiers(), sciChartBuilder.newModifierGroupWithDefaultModifiers().build()); Collections.addAll(surface.getAnnotations(), annotation); } }); }
private void initializeMainChart(final SciChartSurface surface) { final CategoryDateAxis xAxis = sciChartBuilder.newCategoryDateAxis() .withBarTimeFrame(SECONDS_IN_FIVE_MINUTES) .withDrawMinorGridLines(false) .withGrowBy(0, 0.1) .build(); final NumericAxis yAxis = sciChartBuilder.newNumericAxis().withAutoRangeMode(AutoRange.Always).build(); final FastOhlcRenderableSeries ohlc = sciChartBuilder.newOhlcSeries() .withStrokeUp(STOKE_UP_COLOR, STROKE_THICKNESS) .withStrokeDown(STROKE_DOWN_COLOR, STROKE_THICKNESS) .withStrokeStyle(STOKE_UP_COLOR) .withDataSeries(ohlcDataSeries) .build(); final FastLineRenderableSeries line = sciChartBuilder.newLineSeries().withStrokeStyle(SMA_SERIES_COLOR, STROKE_THICKNESS).withDataSeries(xyDataSeries).build(); UpdateSuspender.using(surface, new Runnable() { @Override public synchronized void run() { Collections.addAll(surface.getXAxes(), xAxis); Collections.addAll(surface.getYAxes(), yAxis); Collections.addAll(surface.getRenderableSeries(), ohlc, line); Collections.addAll(surface.getAnnotations(), smaAxisMarker, ohlcAxisMarker); Collections.addAll(surface.getChartModifiers(), sciChartBuilder.newModifierGroup() .withXAxisDragModifier().build() .withZoomPanModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).build() .withZoomExtentsModifier().build() .withLegendModifier().withOrientation(Orientation.HORIZONTAL).withPosition(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 20).withReceiveHandledEvents(true).build() .build()); } }); }
@Override protected void initExample() { final NumericAxis xAxis = sciChartBuilder.newNumericAxis().withVisibleRange(xVisibleRange).withAutoRangeMode(AutoRange.Never).build(); final NumericAxis yAxis = sciChartBuilder.newNumericAxis().withGrowBy(0.1d, 0.1d).withAutoRangeMode(AutoRange.Always).build(); final IRenderableSeries rs1 = sciChartBuilder.newLineSeries().withDataSeries(ds1).withStrokeStyle(0xFF4083B7, 2f, true).build(); final IRenderableSeries rs2 = sciChartBuilder.newLineSeries().withDataSeries(ds2).withStrokeStyle(0xFFFFA500, 2f, true).build(); final IRenderableSeries rs3 = sciChartBuilder.newLineSeries().withDataSeries(ds3).withStrokeStyle(0xFFE13219, 2f, true).build(); UpdateSuspender.using(surface, new Runnable() { @Override public void run() { Collections.addAll(surface.getXAxes(), xAxis); Collections.addAll(surface.getYAxes(), yAxis); Collections.addAll(surface.getRenderableSeries(), rs1, rs2, rs3); } }); schedule = scheduledExecutorService.scheduleWithFixedDelay(new Runnable() { @Override public void run() { if (!isRunning) { return; } UpdateSuspender.using(surface, insertRunnable); } }, 0, TIME_INTERVAL, TimeUnit.MILLISECONDS); }
@Override public void run() { final IAxis xBottomAxis = sciChartBuilder.newNumericAxis() .withVisibleRange(new DoubleRange(0d, 10d)) .withAutoRangeMode(AutoRange.Never) .withAxisTitle("Time (seconds)") .build(); final IAxis yRightAxis = sciChartBuilder.newNumericAxis() .withVisibleRange(new DoubleRange(-0.5d, 1.5d)) .withAxisTitle("Voltage (mV)") .build(); final IRenderableSeries rs1 = sciChartBuilder.newLineSeries() .withDataSeries(series0) .build(); final IRenderableSeries rs2 = sciChartBuilder.newLineSeries() .withDataSeries(series1) .build(); Collections.addAll(surface.getXAxes(), xBottomAxis); Collections.addAll(surface.getYAxes(), yRightAxis); Collections.addAll(surface.getRenderableSeries(), rs1, rs2); } });
private void initializeOverview(final SciChartSurface surface) { surface.setRenderableSeriesAreaBorderStyle(null); final CategoryDateAxis xAxis = builder.newCategoryDateAxis() .withBarTimeFrame(SECONDS_IN_FIVE_MINUTES) .withAutoRangeMode(AutoRange.Always) .withDrawMinorGridLines(false) .withVisibility(View.GONE) .withGrowBy(0, 0.1) .build(); overviewXAxisVisibleRange = xAxis.getVisibleRange(); final NumericAxis yAxis = builder.newNumericAxis().withAutoRangeMode(AutoRange.Always).withVisibility(View.INVISIBLE).build(); removeAxisGridLines(xAxis, yAxis); final FastMountainRenderableSeries mountain = builder.newMountainSeries().withDataSeries(overviewDataSeries).build(); UpdateSuspender.using(surface, new Runnable() { @Override public synchronized void run() { Collections.addAll(surface.getXAxes(), xAxis); Collections.addAll(surface.getYAxes(), yAxis); Collections.addAll(surface.getRenderableSeries(), mountain); Collections.addAll(surface.getAnnotations(), boxAnnotation, leftBox, rightBox, leftLineGrip, rightLineGrip); } }); }
protected BasePaneModel(SciChartBuilder builder, String title, String yAxisTextFormatting, boolean isFirstPane) { this.title = title; this.renderableSeries = new RenderableSeriesCollection(); this.annotations = new AnnotationCollection(); this.yAxis = builder.newNumericAxis() .withAxisId(title) .withTextFormatting(yAxisTextFormatting) .withAutoRangeMode(AutoRange.Always) .withDrawMinorGridLines(true) .withDrawMajorGridLines(true) .withMinorsPerMajor(isFirstPane ? 4 : 2) .withMaxAutoTicks(isFirstPane ? 8 : 4) .withGrowBy(isFirstPane ? new DoubleRange(0.05d, 0.05d) : new DoubleRange(0d, 0d)) .build(); }
protected BasePaneModel(SciChartBuilder builder, String title, String yAxisTextFormatting, boolean isFirstPane) { this.title = title; this.renderableSeries = new RenderableSeriesCollection(); this.annotations = new AnnotationCollection(); this.yAxis = builder.newNumericAxis() .withAxisId(title) .withTextFormatting(yAxisTextFormatting) .withAutoRangeMode(AutoRange.Always) .withDrawMinorGridLines(true) .withDrawMajorGridLines(true) .withMinorsPerMajor(isFirstPane ? 4 : 2) .withMaxAutoTicks(isFirstPane ? 8 : 4) .withGrowBy(isFirstPane ? new DoubleRange(0.05d, 0.05d) : new DoubleRange(0d, 0d)) .build(); }
@Override protected void initExample() { final NumericAxis xAxis = sciChartBuilder.newNumericAxis().withAutoRangeMode(AutoRange.Always).withDrawMajorBands(true).withVisibleRange(0, 150).withAxisTitle("X Axis").build(); final NumericAxis yAxis = sciChartBuilder.newNumericAxis().withAutoRangeMode(AutoRange.Always).withDrawMajorBands(true).withVisibleRange(-1.5, -1.5).withAxisTitle("Y Axis").build(); surface.getXAxes().add(xAxis); surface.getYAxes().add(yAxis); surface.getChartModifiers().add(sciChartBuilder.newModifierGroupWithDefaultModifiers().build()); }