SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

How to set the background, font color and font size of the text label on the map;

Source as this:

PenStyle penStyle = new SolidPenStyle(getColor(R.color.baselineColor), false, 1, new float[]{7, 3, 3});
for (int i = 0; i < baseValues.size(); i++) {
baseLines.add(sciChartBuilder.newHorizontalLineAnnotation()
.withY1(baseValues.get(i))
.withStroke(penStyle)
.withAnnotationLabel()
.withHorizontalGravity(Gravity.FILL_HORIZONTAL)
.build());
}

Version
2.1.0.2210
Images
  • You must to post comments
0
0

Hi Huang,

You can use code like this:

            final AnnotationLabel annotationLabel = new AnnotationLabel(getActivity());
            annotationLabel.setLabelPlacement(LabelPlacement.Axis);
            annotationLabel.setAxisLabelStyle(new Action1<AnnotationLabel>() {
                @Override
                public void execute(AnnotationLabel annotationLabel) {
                    annotationLabel.setBackgroundColor(Color.RED);
                    annotationLabel.setFontStyle(new FontStyle(20f, Color.BLUE));
                }
            });

            final HorizontalLineAnnotation lineAnnotation = sciChartBuilder.newHorizontalLineAnnotation()
                    // some other builder calls here
                    .build();

            lineAnnotation.annotationLabels.add(annotationLabel);

Best regards,
Yura

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.