I am using ZedGraph to display some pie charts in my C# WinForms application. I want to display a legend and also the labels next to each pie slice in the following format:
Legend: Each item should display the Name of the pie slice, e.g. "Customers"
Slice Label: Each label should display value and percent, e.g. "4 (25%)"
By default I am able to have the legend displaying the name as desired. So on to the label requirement...
I have looked into the LabelType
property, which allows me to select a few options for the label format (here is the list). Unfortunately, there is no Value_Percent
option. I cannot use the ones that include the Name because they are too long and it ruins the display of the labels.
I though perhaps I could set the text label myself as I am able to calculate both the Value and Percent anyway, so I tried this:
pieItem.Label.Text = myCustomString;
This does get my desired labels, but it also sets the legend key format to be the same - so I lose that requirement of Name.
Is it possible to change the slice label text independent of the legend text? Or, is it possible to achieve my requirements another way?