Pre loader

Styling Axis Annotation

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

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.

Try SciChart Today

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

Start TrialCase Studies