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