Thought this might be of help to those of you who are want to customize your Y-Axis labeling on your charts. (note: this solution is based off of the article knowledgebase regarding customize labeling that Infragistics has on their site--gotta give credit where credit is due--I just expanded and tailored it my needs) Just to illustrate:
Y-Axis DATA VALUES Label Before:$1,000,000$100,000$10,000$1,000
Y-Axis DATA VALUES Label After:$1M$100K$10K$1K
Now that takes up less space and is much more readable. Now--onto the code!
Public Class MyLabelRenderer
Public Overloads Function ToString(ByVal context As Hashtable) _
Case Is < -999
Return CStr(context("DATA_VALUE")).Substring(0, 4) & "K"
Return CStr(context("DATA_VALUE")).Substring(0, 3) & "K"
Return CStr(context("DATA_VALUE")).Substring(0, 2) & "K"
Return CStr(context("DATA_VALUE")).Substring(0, 1) & "K"
Return CStr(context("DATA_VALUE"))
Return CStr(context("DATA_VALUE")).Substring(0, 1) & "M"
Return CStr(context("DATA_VALUE")).Substring(0, 2) & "M"
End Function
End Class
Private Sub Customize_Labels_Using_the_IRenderLabel_Interface_Load( _
ByVal sender As System.Object, _
Me.YourChartNameHere.Axis.Y.Labels.ItemFormatString = "<MY_VALUE>"
YourChartNameHere.LabelHash = MyLabelHashTable
End Sub
Now, I only chose to customize the Y axis because that usually contains the data values (which is what I'm interested in). You easily modify the code above to include changes in the X axis as well.
Happy coding!