I am trying to make my pie chart show the categories (Cats, Dogs, etc. in my below code) instead of the numerical data, where the DataMarkers would be. I can see the categories if I turn on the legend, but I prefer to see the categories in the pie itself, rather than in a separate legend
Here is the code I'm using:
SfChart chart = new SfChart(this);
CategoryAxis primaryAxis = new CategoryAxis();
primaryAxis.Title.Text = "Animals";
chart.PrimaryAxis = primaryAxis;
NumericalAxis secondaryAxis = new NumericalAxis();
secondaryAxis.Title.Text = "Number";
chart.SecondaryAxis = secondaryAxis;
ObservableArrayList Ratings = new ObservableArrayList();
Ratings.Add(new ChartDataPoint("Cats", 3));
Ratings.Add(new ChartDataPoint("Dogs", 5));
Ratings.Add(new ChartDataPoint("Birds", 50));
Ratings.Add(new ChartDataPoint("Fish", 20));
Ratings.Add(new ChartDataPoint("Other", 120));
PieSeries pieSeries = new PieSeries()
{
DataSource = Ratings,
};
chart.Series.Add(pieSeries);
chart.Legend.Visibility = Visibility.Visible;