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?
- Marcin K asked 7 years ago
- You must login to post comments
Hi Marcin,
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!
Best regards,
Yura
- Yura Khariton answered 7 years ago
- You must login to post comments
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.
styles.xml:
<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>
drawable/checkbox.xml:
<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.
- Marcin K answered 7 years ago
- You must login to post comments
Please login first to submit.