LiveCharts2 icon indicating copy to clipboard operation
LiveCharts2 copied to clipboard

Doughnut Chart Center Label

Open tuccitj opened this issue 8 months ago • 0 comments

Is your feature request related to a problem? Please describe. I would like to display the total/sum of all values in a series in the center of a doughnut chart.

Describe the solution you'd like A property on SKPieChart() that allows you set a text value to the center of a chart. Or a way to add to include an element in the PieSeries that is not displayed except for when set to LiveChartsCore.Measure.PolarLabelsPosition.ChartCenter.

Describe alternatives you've considered

I tried adding another element to PieSeries[], hiding it in the legend, and making the fill color transparent. Obviously this doesn't work. Setting IsVisible to false makes everything invisible. new PieSeries { IsVisibleAtLegend = false, // IsVisible = false, Values = new decimal[] { 1811.54m + 600.54m}, Name = "Total", InnerRadius = 60, Fill = new SolidColorPaint(SKColors.Transparent), DataLabelsPaint = new SolidColorPaint(SKColors.Black), DataLabelsSize = 12, // DataLabelsPadding = new LiveChartsCore.Drawing.Padding(padding), DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.ChartCenter, DataLabelsFormatter = point => point.Coordinate.PrimaryValue.ToString("C2") },

tuccitj avatar May 31 '24 22:05 tuccitj