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

0
0

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?

Version
3.1.0.5175
  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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?

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.