Pre loader

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

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

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.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies