I set a custom font in the app theme, but the charts ignore this font.
All fonts in the charts seem to be Roboto.
I tried to add TextStyle and LabelStyle to set my custom font.
but I haven't found how to define the tooltip or track point font.
How can I do this, and should the chart not just use the font specified in the theme by default?
Hi Matthias,
You can achieve your requirement by using the textStyle which is available in the tooltip behavior. Please refer to the following code snippet.
tooltipBehavior: TooltipBehavior( textStyle: TextStyle( fontFamily: 'Times New Roman', ), ), |
Screenshot:
For more details, refer to the ug:
https://help.syncfusion.com/flutter/cartesian-charts/tooltip#customizing-the-appearance
If you still facing the issue, we kindly request you to share us with more about the issue in detail along with code snippets so that it will help us assist you in a better way.
Regards,
Natrayan
Hi,
I use TrackballBehavior
SfCartesianChart(
enableSideBySideSeriesPlacement: true,
enableAxisAnimation: true,
trackballBehavior: TrackballBehavior(
enable: true,
activationMode: ActivationMode.singleTap,
tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
),
in the documentation it says:
https://help.syncfusion.com/flutter/cartesian-charts/trackball-crosshair
that textStyle is an available property.
but when looking into the class:
https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/TrackballBehavior-class.html
it isn't.
that's why I don't know how to apply the font also in case using TrackBall.
Also, I wonder why not use ThemeFont by default.
Now I need to set the font manually, on every axis, legend, tooltip, (trackball?) title, etc.
thank you
Hi Matthias,
To customize the trackball tooltip text style, you can achieve this with the help of textStyle property in a tooltipSettings in TrackballBehavior. We have shared the code snippet below for your reference.
Code snippet:
SfCartesianChart( trackballBehavior: TrackballBehavior( enable: true, tooltipSettings: InteractiveTooltip( textStyle: TextStyle( fontFamily: 'Calibri (Body)', ), ), ), ) |
Currently, we don't have a support textStyle in SfChartThemeData. However, we have considered this as a feature request and logged the feature request for it in our feedback portal. This will be implemented and included in our 2023 Volume 2 release, which is expected to be rolled out on June 2023. We shared the feedback link below for your reference, you can track the status of the feature.
Feedback, https://www.syncfusion.com/feedback/41820/
Regards,
Yuvaraj.
great, thank you very much :)
Hi Matthias,
Most Welcome. We will update you once the release got rolled out and we appreciate your patience until then.
Regards,
Yuvaraj.
Hi Matthias,
We are glad to announce that our Essential Studio 2023 Volume 2 release v22.1.34 is rolled out and is available for download under the following link.
We have provided the global text theme support for charts widget and rolled out in this release. So, kindly please upgrade the charts widget package version to the latest version below to overcome the issue.
https://pub.dev/packages/syncfusion_flutter_charts/versions/22.1.34
For more details, please refer the API details here https://pub.dev/documentation/syncfusion_flutter_core/latest/theme/SfChartThemeData-class.html
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Lavanya A.