Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Resize X labels on Syncfusion chart. I'm not able to get it working

clopezclopez ESMember ✭✭✭

Hello, everyone:

I was playing around with SyncFusion charts. I have an example that uses it and was trying to modify it to know how it works.
I was able to modify all aspects of visual representation but the X labels.
When calling the constructor, I added the next code:

PrimaryAxis = new CategoryAxis()
{
Title = new ChartAxisTitle()
{
Text = axisXTitle,
Font = Font.SystemFontOfSize(Device.GetNamedSize(NamedSize.Small, typeof(ChartAxisTitle))),
TextColor = Color.Blue
},
LabelRotationAngle = 90,
EdgeLabelsDrawingMode = EdgeLabelsDrawingMode.Center,
LabelPlacement = LabelPlacement.BetweenTicks,
LabelsIntersectAction = AxisLabelsIntersectAction.None,
TickPosition = AxisElementPosition.Outside,
ShowMajorGridLines = false,
LabelStyle = new ChartAxisLabelStyle()
{
TextColor = Color.green,
Font = Font.SystemFontOfSize(Device.GetNamedSize(NamedSize.Micro, typeof(ChartAxisLabelStyle)))
}
}

No matter how I define font size, what size I put (micro, normal, big, 45, 1000...) the size still remain the same. I read that in older versions of SFCharts there was a bug for this, but I'm updating it via NuGet Package Manager to the almost last version (14.4.0.20, because newer versions are crashing on my system, and didn't have time to check why) and still have this issue, that it was suppose to be fixed on v12 or v13.

Any ideas what is happening here?

Best Answer

  • clopezclopez ESMember ✭✭✭
    Accepted Answer

    Thank you for your help, and sorry for soooo late reply ^^U The project was put aside for a while.
    After that, I started to review the code and... I'm not sure what I did but I think I found a bug in my code that overwrited the font size in some point after the initialization, so it's working now.

    Anyway, thank you for your help. I'm taking notes for future references.

Answers

  • N_BauaN_Baua INMember ✭✭✭✭✭

    Hi @clopez ,

    Do not update to the beta or latest nugets from SyncFusion, typically they hot-fix one thing and break another three doing so, The font sizing and label formatting issues are persistent back from year 2014, they re-emerge over-n-over again.

    Better to contact the Syncfusion support and get the work-around from them, unless they say the issue will be fixed (??) in their next release.

    --- N Baua

  • Hi @Carlos,

    Regarding the query about font size is not working

    As per your provided code snippet, we have prepared the sample and ensured the font size in mentioned version (14.4.0.20) as well as latest version (15.3.0.29) of SfChart assemblies, which is working fine.

    Please download the sample from following location.

    Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/FontSample-60750519

    If you still facing the issue at your end, please update us modified sample or provide more information to reproduce the issue which will be helpful for providing further assistance on this.

    Regarding the query about crash in newer version

    Due to internal architecture change, now it is not required to add Syncfusion.SfChart.Android.dll and Syncfusion.SfChart.iOS.dll assemblies to your platform specific projects such as Android and iOS in Xamarin.Forms respectively. Hence, you need to remove these two assemblies from your platform specific projects.

    Please ensure that the following highlighted SfChart assemblies are only referred in your application.

    Release notes: https://help.syncfusion.com/xamarin/release-notes/v15.3.0.26?type=all#breaking-changes

    UG: https://help.syncfusion.com/xamarin/introduction/control-dependencies

    Note: Clean and Rebuild the projects after remove the assemblies.

  • clopezclopez ESMember ✭✭✭
    Accepted Answer

    Thank you for your help, and sorry for soooo late reply ^^U The project was put aside for a while.
    After that, I started to review the code and... I'm not sure what I did but I think I found a bug in my code that overwrited the font size in some point after the initialization, so it's working now.

    Anyway, thank you for your help. I'm taking notes for future references.

Sign In or Register to comment.