SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
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.
I have issue with legend on high resolutions screens. Checkboxes and text is very small and hard to read. I couldn’t find any solution to change text size or provide my own template with text size for legend in Android SciChart.
I want to change legend text size depends on screen like it is in Android by declaring size in dimens.xml.
I do that for Axis labels but I don’t know how do the same for text in legend.
Does anyone know how to achieve this?
Have you tried to customize one of default themes and override default text size property provided by ThemeProvider? It should change text size for legend items and annotations which contain text.
Please take a look on example which shows how to create custom themes and you’ll need to add one line into theme style which overrides default text size value:
<style name="SciChart_BerryBlue" parent="SciChart_BaseStyle"> <!-- override default textsize --> <item name="defaultTextSize">20sp</item> <!-- the rest of the theme values... --> </style>
Hope this will help you!
It helped with text size of legend but checkboxes was still the same.
I resolved checkboxes issue by setting in app theme android:checkboxStyle with style where android:button is drawable resource.
<style name="checkBoxStyle" parent="@android:style/Widget.CompoundButton.CheckBox"> <item name="android:button">@drawable/checkbox</item> </style> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:checkboxStyle">@style/checkBoxStyle</item> </style>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:drawable="@drawable/ic_check_box_black_24dp" /> <item android:state_checked="false" android:drawable="@drawable/ic_check_box_outline_blank_black_24dp" /> </selector>
Thank You for Your help.
Please login first to submit.