.net chart controls - show values in mm:ss
I am plotting data on a .net chart control, and I want to display values on the x-axis in in minutes an开发者_如何学Cd seconds (mm:ss). For example, instead of displaying 1.5, I would like the axis to show 1:30. Any ideas?
I've just tried this using the Visiblox Silverlight charting API. It is possible with the following code:
<charts:Chart Name="chart">
<charts:Chart.XAxis>
<charts:DateTimeAxis LabelFormatString="mm:ss" />
</charts:Chart.XAxis>
</charts:Chart>
You should be able to apply something similar to other charting controls.
Edit: Sorry, just notice that you are using the MS Charting library, the documentation does not mention a LabelFormatString but you should be able to set one in the style: http://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.axis.labelstyle.aspx . You can use the Format property on the LabelStyle class here: system.windows.forms.datavisualization.charting.labelstyle.aspx
精彩评论