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.

Answered
0
0

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?

Version
v2
  • You must to post comments
Best Answer
1
0

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

  • You must to post comments
0
0

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.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.