SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Hi,
I’m trying to convert Java code to swift and I need the AnnotationLabel’s setAxisLabelStyle equivalent.
AnnotationLabel annotationLabel = new AnnotationLabel(getContext());
annotationLabel.setLabelPlacement(LabelPlacement.Axis);
annotationLabel.setAxisLabelStyle(new Action1<AnnotationLabel>()
{
@Override
public void execute(AnnotationLabel annotationLabel)
{
annotationLabel.setFontStyle(new FontStyle(37.0f, Color.BLUE));
annotationLabel.setBackgroundResource(R.drawable.current_price);
}
});
How can i apply this code in swift?
Hi, there.
If I understand your issue correctly in Swift you can create SCIAnnotationLabel and then set fontStyle and backgroundBrush properties like this:
let annotationLabel = SCIAnnotationLabel()
annotationLabel.fontStyle = SCIFontStyle(fontSize: 22, andTextColor: .black)
annotationLabel.backgroundBrush = SCISolidBrushStyle(color: .blue)
Please see the iOS Chart Annotations are Easy! example and Annotations APIs as a reference.
Let us know if that helped.
Hi,
We can add drawable resource to annotationlabel on android.
But how can we add a background image to annotationlabel in swift? There is no customView property?
Please login first to submit.