This question is locked. New answers and comments are not allowed.
I have been running into some trouble regarding setting the DefaultLabelFormat value for both X and Y-Axis as well as ItemLabels.
I generate random data for my charts, i.e.
| //Random random = new Random(this.GetHashCode() | (int)(DateTime.Now.Ticks)); |
| Random random = new Random(); |
| for (int i = 0; i < 3; i++) |
| { |
| DataPoint dataPoint = new DataPoint(); |
| dataPoint.YValue = random.Next(2, 12); |
| dataSeries.Add(dataPoint); |
| } |
I tried using the following:
| dataSeries.Definition.DefaultLabelFormat = "#%"; |
| Chart.DefaultView.ChartArea.AxisY.DefaultLabelFormat = "#%"; |
But this takes the percent value of all items in the series (instead of just taking the value and appending a % sign to it), and actually doesn't even show anything for the Y-Axis Label.
So my question is, how I would get both the ItemLabel and Y-Axis Label to look like this: 5%
(Basically just take my value and append a % sign to it).
Thanks for your help!
Garrett