SfCartesianChart - missing features in Xamarin to MAUI conversion
Dear Sir or Madame,
we're trying to migrate our project that uses SfCartesianChart quite heavily from Xamarin Forms to .NET MAUI and we've mostly succeeded. However we encountered some missing features that we would need some help with.
I'm sending you a minimal repo that illustrates the topics that we're concerned with. The charts that we use are more complex so we created this repo to contain only the troubling features.
The 4 issues are:
1. FastLineSeries doesn't support LinearGradientBrush as Fill. We use this to modify the color of the line based on its Y-value. It works fine in Xamarin Forms but doesn't seem to do anything in MAUI - the line just stays black.
2. TrackballLabelTemplate is missing in the CartesianSeries class. TrackballBehavior has settings for LabelStyle and LineStyle but for example it's missing a setting for Padding or multiline content. We need a 2-line label for describing the data when using trackball. We tried to solve this by using 2 labels (there are multiple series drawn with the same data in the graph anyway), but we cannot modify the style of the default label "bubbles" and in some cases they draw strange shapes (see attached screenshots).
3. ChartAxisLabelStyle is missing property LabelsPosition so we cannot set the Y-axis labels to be "inside" the graph as it is in the Xamarin Forms version.
4. ChartAnnotations property is missing. We used this to add a HorizontalLineAnnotation with a label at the end of the graph. We managed to recreate the line using a LineSeries with just 2 values defined (the start and end value), however if we try to display the label using the ShowDataLabels property the label appeared on both sides of the graph (left and right) so this doesn't solve our case.
Please let me know if these issues can be resolved by some workarounds or if they are planned to be implemented in the near future for MAUI.
Best regards,
Roman Jasek
Xamarin Forms (correct version):
MAUI (2 Trackball labels):
MAUI (broken Trackball label):
Attachment: SfChartFeatures_41d0f6fe.zip
Hi Roman Jasek,
We have reviewed your queries and would like to provide you with the following updates:
Query 1: Modifying the color of the line based on its Y-value
We are currently validating the fastline series color modification based on the Y-value. We will provide you with an update tomorrow.
Query 2: Track ball template
We have already created a feature request for the track label template. While we do not have immediate plans to implement this feature due to existing commitments, you can track its status on the feedback portal using the following link:
This feature will be expected on our upcoming volume 2 release 2024. Please cast your vote to make it count, and if you have any more specifications or suggestions for the feature request, you can add them as a comment in the feedback portal.
We will check the provided track ball image and will update you on tomorrow.
Query 3: ChartAxisLabelStyle missing property LabelsPosition
To position the labels inside, you can set the CrossesAt value to be less than the maximum range. We will provide you with a code sample tomorrow.
Query 4: Horizontal annotation
You can add horizontal annotations. Please refer to the attached sample and you can customize it as needed.
We appreciate your patience and understanding.
Regards,
Nanthini M.
Attachment: HorizontalHelpline_1_3b8ef9e1.zip
Hi Roman Jasek,
We would like to inform you of the following information.
Query 1: Modifying the color of the line based on its Y-value
Already, we have created the feedback for gradient support for line based series. https://www.syncfusion.com/feedback/49487/gradient-support-for-line-based-series-in-net-maui-chart
Our development is validating the possibilities of applying the different color modification based on the Y-value. We will update the status within two business days (12/02/2024).
Query 2: Track ball rendering
Our development is validating the provided image that track ball drawing section at our end and will update the status within two business days (12/02/2024).
Query 3: ChartAxisLabelStyle missing property LabelsPosition
You can set the axis label inside the series clip rect by setting the CrossesAt of YAxis as Maximum value of the XAxis. Differentiate the axis labels by setting different colors using the TextColor property. By doing this, you can show the labels inside the series clip rect. You can refer to the following code example.
|
<chart:SfCartesianChart> . . . <chart:SfCartesianChart.XAxes> <chart:NumericalAxis> </chart:NumericalAxis> </chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes> <chart:NumericalAxis CrossesAt="5"> <chart:NumericalAxis.LabelStyle> <chart:ChartAxisLabelStyle TextColor="Black"/> </chart:NumericalAxis.LabelStyle> </chart:NumericalAxis> </chart:SfCartesianChart.YAxes> . . . </chart:SfCartesianChart> |
Output:
However, we have considered the label position and tick position support as a feature request and added it to our feature request list. You can track the status of this feature the below feedback portal link.
We will prioritize the features in every release based on the demands, and we do not have an immediate plan to implement this since we committed to already planned work. So, this feature will be available for any of our upcoming releases.
Please cast your vote to make it count, and if you have any more specifications or suggestions for the feature request, you can add them as a comment in the feedback portal.
We appreciate your patience and understanding.
Regards,
Nanthini M.
Hi Roman Jasek,
We would like to inform you of the following:
Query 1: Modifying the color of the line based on its Y-value
We have checked the possibilities of applying different colors based on your requirement but unfortunately, we do not have a workaround for it. You can check the status of gradient support feature as shown in the following link.
https://www.syncfusion.com/feedback/49487/gradient-support-for-line-based-series-in-net-maui-chart
We will prioritize the features in every release based on the demands, and we do not have an immediate plan to implement this since we committed to already planned work. So, this feature will be available for any of our upcoming releases.
Please cast your vote to make it count, and if you have any more specifications or suggestions for the feature request, you can add them as a comment in the feedback portal.
Query 2: Trackball rendering
Currently, we were unable to reproduce the reported trackball rendering issue at our end. Could you please share a sample or code snippet where the issue is reproduced? This will help us provide a better solution.
Regards,
Nanthini M.
Thanks for the replies. Regarding the individual questions:
Query 1: I voted on the feature, we will wait for the implementation as there is no workaround for us right now.
Query 2: Thanks for letting us know that we can expect this in the volume 2 release 2024, this is a helpful information. Regarding the question in the previous post - I've included a repo in the original post ( SfChartFeatures_41d0f6fe.zip) where the broken behavior from the screenshot is happening.
Query 3: The issue with using the suggested solution with setting the CrossesAt value to the maximum value of the YAxis is that then the graph is overlapping the numbers on the YAxis. In the Xamarin version it was possible to get the horizontal guiding lines to span all the way to the right into the area where Y axis values were rendered but the graph ended so that it doesn't hide the Y values. This seems to be impossible in the MAUI version at the moment.
Query 4: The issue here was not with drawing the horizontal line - we could have achieved that using LineSeries. The issue is that we cannot get the AxisLabel with the value for the horizontal line to show up. We were however able to create this manually using the canvas and a combination of FillRoundedRectangle and DrawString. So we were able to achieve this point.
Hi Roman Jasek,
Currently, we are validating the track ball rendering based on provided sample and update the status within the two business days (16/02/2024).
Regards,
Nanthini M.
Hi,
We have validated the sample you provided and would like to inform you that we were able to reproduce the reported trackball rendering issue. We will need some time to validate the issue at our end and will update the status within two business days (20/02/2024).
Regards,
Nanthini M.
Hi Roman Jasek,
Currently, we have validated the reported issue and considered the trackball rendering issue as a bug. We will provide the bug report tomorrow (21/02/2024).
Regards,
Nanthini M.
Hi Roman,
We have created the bug report for the reported issue of Incorrect alignment of trackball label rendering in Cartesian chart. You can track the status in the following feedback portal link.
We will endeavor to provide the custom patch on or before February 29th, 2024. The fix will be available in the upcoming weekly NuGet release on March 5th, 2024.
Regards,
Dhanaraj Rajendran
Hi Roman,
We have fixed the reported issue of Incorrect alignment of trackball label rendering in Cartesian chart and are currently experiencing ongoing delays in the automation process to incorporate the fix. The fix will be available in the upcoming weekly NuGet release on March 5th , 2024.
Regards,
Nanthini M.
Hi Roman,
The fix for the reported issue of Incorrect alignment of trackball label rendering in Cartesian chart has been included in our latest weekly Nuget release, version 24.2.9 which is available for download ( https://www.nuget.org/).
NuGet Version: 24.2.9
Root Cause: While giving custom label or large string in label, there is no spacing for labels showing left and right position specifically in center at android and iOS.
We thank you for your support and appreciate your patience. Please contact us if you require any further assistance.
Regards,
Dhanaraj Rajendran.
- 10 Replies
- 3 Participants
-
RJ Roman Jasek
- Feb 6, 2024 02:31 PM UTC
- Mar 5, 2024 02:01 PM UTC