@NonNull @Override public IAnnotation createAnnotation(@NonNull ISciChartSurface parentSurface, int annotationType) { return sciChartBuilder.newBoxAnnotation().withBackgroundColor(0x6600cc00).build(); } });
private BoxAnnotation generateBoxAnnotation(@DrawableRes int backgroundDrawable) { return builder.newBoxAnnotation() .withBackgroundDrawableId(backgroundDrawable) .withCoordinateMode(AnnotationCoordinateMode.RelativeY) .withIsEditable(false) .withY1(0).withY2(1) .build(); }
.withZIndex(1) // draw this annotation above other annotations .build(), sciChartBuilder.newBoxAnnotation() .withIsEditable(true) .withBackgroundDrawableId(R.drawable.example_box_annotation_background_4)
.build(), sciChartBuilder.newBoxAnnotation() .withPosition(3.5d, 4d, 5d, 5d) .withBackgroundDrawableId(R.drawable.example_box_annotation_background_1) .build(), sciChartBuilder.newBoxAnnotation() .withPosition(4d, 4.5d, 5.5d, 5.5d) .withBackgroundDrawableId(R.drawable.example_box_annotation_background_2) .build(), sciChartBuilder.newBoxAnnotation() .withPosition(4.5d, 5d, 6d, 6d) .withBackgroundDrawableId(R.drawable.example_box_annotation_background_3)
xyScatterDataSeries.append(priceBars.getIndexesAsDouble(), dataManager.offset(priceBars.getOpenData(), dataOffset * 2.5)); final BoxAnnotation annotation = sciChartBuilder.newBoxAnnotation().withPosition(152d, 0, 158d, 1).withBackgroundDrawableId(R.drawable.example_box_annotation_background_1).withIsEditable(true).withCoordinateMode(AnnotationCoordinateMode.RelativeY).build(); annotation.setOnAnnotationDragListener(new OnAnnotationDragListener() { @Override