Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIeChart Documentation Out of Date #1508

Open
MiaJohnson opened this issue May 11, 2024 · 2 comments
Open

PIeChart Documentation Out of Date #1508

MiaJohnson opened this issue May 11, 2024 · 2 comments

Comments

@MiaJohnson
Copy link

.Net Maui, Pie Chart: Documentation shows using PrimaryValue, but PrimaryValue is Obsolete.

How do you set the DataLabel format?
https://livecharts.dev/docs/Maui/2.0.0-rc2/PieChart.Pie%20series#datalabels
DataLabelsSize = 22,
DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.Middle,
DataLabelsFormatter = point => point.PrimaryValue.ToString("N2") + " elements"

@darrendowning16
Copy link

This is how I have my lineseries Y Axis set up. You should be able to use this example and apply it to your chart type

YToolTipLabelFormatter = (chartPoint) => $"Flu: {chartPoint.Model?.Property1Name:N0} {Environment.NewLine}Wave: {chartPoint.Model?.Property2Name:N0}",

@Darkproduct
Copy link

You can do it like this:

// …
new HeatSeries<WeightedPoint> {
  // …
  YToolTipLabelFormatter = (point) => $"{point.Model?.Weight}",
  // …
}
// …

Other options with the x and y values:

YToolTipLabelFormatter = (point) => $"Value: {point.Model?.Weight}\r\nX: {point.Model?.X}\r\nY: {point.Model?.Y}",

Copied from my Answer on SO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants