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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

Hello,
is it possible to modify the corner radius of tooltips in SciChart Android?

Version
2.0.0.1884
  • You must to post comments
0
0

Hi Anna,

Yes, it is possible but it requires some code customization.

First of all I would suggest you to take a look on our example which shows how to customize tooltips. i would suggest to take a look on on FirstCustomXySeriesTooltip/SecondCustomXySeriesTooltip classes which represent tooltip View ( by default tooltip in SciChart Android use TextView as a base class so you have access to all its methods and properties ).

To provide round corners you just need to create a drawable resource with rounded corners and set it as background for tooltip:

 protected void internalUpdate(XySeriesInfo seriesInfo) {
            final SpannableStringBuilder sb = new SpannableStringBuilder();
            sb.append(MODIFIER_NAME).append(StringUtil.NEW_LINE);

            if (seriesInfo.seriesName != null) {
                sb.append(seriesInfo.seriesName).append(StringUtil.NEW_LINE);
            }
            sb.append("X: ").append(seriesInfo.getFormattedXValue());
            sb.append(" Y: ").append(seriesInfo.getFormattedYValue());

            setText(sb);

            setBackgroundResource(R.drawable.backgroundWithCornersDrawable); // set drawable with corners
            setTooltipTextColor(ColorUtil.White);
        }

Hope this will help you!

Best regards,
Yura

  • You must to post comments
0
0

Hi Anna,

Yes, it is possible but it requires some code customization.

First of all I would suggest you to take a look on our example which shows how to customize tooltips. i would suggest to take a look on on FirstCustomXySeriesTooltip/SecondCustomXySeriesTooltip classes which represent tooltip View ( by default tooltip in SciChart Android use TextView as a base class so you have access to all its methods and properties ).

To provide round corners you just need to create a drawable resource with rounded corners and set it as background for tooltip:

 protected void internalUpdate(XySeriesInfo seriesInfo) {
            final SpannableStringBuilder sb = new SpannableStringBuilder();
            sb.append(MODIFIER_NAME).append(StringUtil.NEW_LINE);

            if (seriesInfo.seriesName != null) {
                sb.append(seriesInfo.seriesName).append(StringUtil.NEW_LINE);
            }
            sb.append("X: ").append(seriesInfo.getFormattedXValue());
            sb.append(" Y: ").append(seriesInfo.getFormattedYValue());

            setText(sb);

            setBackgroundResource(R.drawable.backgroundWithCornersDrawable); // set drawable with corners
            setTooltipTextColor(ColorUtil.White);
        }

Hope this will help you!

Best regards,
Yura

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.