dotnetcharting Axis Formatting
从onlinedocument上搞下来的做个保持
[C#] Chart.DefaultSeries.DefaultElement.SmartLabel.Text = "<%YValue,Currency>";
[Visual Basic] Chart.DefaultSeries.DefaultElement.SmartLabel.Text = "<%YValue,Currency>"
This will format the labels on the chartArea as currency but not in other places like the legend box.
For a complete list of possible tokens see: Tokens
For a reference of how to access different label on a chart see Using Labels
Advanced Axis Formatting
The axis also provides some additional settings that influence the axis format.
Percent
Setting Axis.Percent = true will format axis tick labels as percentages (in addition to snapping the scales maximum value to 100%)
A shortcut for setting the number of decimals for axis formats is to specify it with the Axis.NumberPrecision property.
Format strings that specify decimal spaces override this setting. |
[C#]
Chart.YAxis.NumberPrecision = 2;
[Visual Basic]
Chart.YAxis.NumberPrecision = 2