SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Hello,
is it possible to modify the corner radius of tooltips in SciChart Android?
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
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
Please login first to submit.