Overflowing labels on Doughnut Series are getting hidden regardless of 'overflow' settings

I'm trying to create a Doughnut chart that has outer labels for each datapoint, showing its value. The labels have been customized using a builder.

Unfortunately, many of the labels are completely hidden, even though it looks like at least some of them should have no problems fitting inside the available space:

photo_2022-01-11_14-48-40.jpg


These are my chart label settings:

DataLabelSettings(
overflowMode: OverflowMode.shift,
labelIntersectAction: LabelIntersectAction.shift,
margin: EdgeInsets.all(0),
isVisible: true,
textStyle: TextStyle(
fontSize: 10,
),
borderWidth: 0,
labelPosition:
ChartDataLabelPosition
.outside,
connectorLineSettings:
ConnectorLineSettings(
// Type of the connector line
type:
ConnectorType.line),
builder: (dynamic data, dynamic point, dynamic series, int pointIndex, int seriesIndex) {
return Text(
getInvestmentAsString(point.y),
overflow: TextOverflow.ellipsis,
softWrap: false,
style: kDistributionChartLabelTextStyle);
}
),

As you can see, both the 'overflow' and the 'label intersection' settings are set to 'shift', and inside the builder I've also set the text overflow setting to 'ellipsis' and the softWrap to 'false', just in case.

I've played around a lot with all of these settings, but none of them seem to make any difference.

The chart is nested as follows:

Card -> Padding (15.0) -> Column -> SfCircularChart

It looks to me like the space used by the labels themselves is just not considered when dimensioning the whole chart widget. But even if that cannot be fixed, I wish I had the option to force the labels to stay in place, even if they overflow slightly, or at the very least have them clipped/trimmed rather than hidden.

In this case, it would be perfectly acceptable to have the labels slightly invading the padding of the card, but it seems they're removed no matter which settings I choose.

Workarounds that I've tried:

  • Remove the padding of the card. It can work, but then you need to make sure that every other element you place inside the card is padded/separated individually, which is not how things should be done and makes code difficult to maintain.
  • Nest the SfCircularChart directly inside a container, and give the container a fixed height (e.g.: 200 pixels). Because the chart is circular, by constraining it vertically its horizontal size is also shrinked, which means the labels now have more white space around them and fewer of them are clipped. Still a bad solution, as some labels are still getting clipped, and this will make the chart too small for users on bigger screens, or too big for users on smaller screens.

Could you please let me know if there's any solution for this? Otherwise, could this somehow be improved in a future release?

Thanks!

4 Replies

YG Yuvaraj Gajaraj Syncfusion Team January 13, 2022 02:58 PM UTC

Hi Víctor Marino, 
 
Greetings from Syncfusion. We have analyzed on your query and trying to replicate the reported scenario at our end. We will update you the status on 18th January 2022. 
 
Regards, 
Yuvaraj.


YG Yuvaraj Gajaraj Syncfusion Team January 18, 2022 01:28 PM UTC

Hi Victor Marino, 
 
Thanks for your patience, the reported scenario is already fixed, and it is available in our latest package. To resolve this can you upgrade our chart package to latest version mentioned below. 
 
 
Regards, 
Yuvaraj. 



VM Víctor Marino replied to Yuvaraj Gajaraj January 18, 2022 06:11 PM UTC

Thanks so much for the quick solution!

Will give it a try and let you know if I find any problems.

Best regards,

Víctor.



YG Yuvaraj Gajaraj Syncfusion Team January 19, 2022 12:56 PM UTC

Hi Víctor Marino, 
 
Most welcome. If you have any further queries, please get back to us. We are always happy to assist you. 
 
Regards, 
Yuvaraj. 


Loader.
Up arrow icon