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());
}
- Huang haiyan asked 5 years ago
- You must login to post comments
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
- Yura Khariton answered 5 years ago
- You must login to post comments
Please login first to submit.