One of the most common requests we got after the Q3 2008 release was to improve our label customization. Well I believe many of you will be pleasantly surprised to learn that we will most certainly deliver on those expectations for the Q3 SP1 release and then some!

This news is really twofold. The first part is the support for custom format strings in our axis and series items labels. What this means is that with the SP1 release of RadChart for WPF you will be able to apply all .NET supported standard numeric format strings. The easiest way to enable formatting on a chart element with labels – say an axis, would be to set its DefaultFormat property. Say you want to display currency values on the YAxis. Simply set the “{0:C}” text to the AxisY.DefaultFormat property and you will get your numeric data formatted as currency with respect to your current ui culture:

currency

The second part is that we have built-in support for date and time values. There is a new property on the Axis – IsDateTime which specifies that values on the axis should be treated as DateTime values. This way you can format your date time values using standard .NET datetime format strings. If you set it to true and set the DefaultFormat to say “DDD” this will format the date-time values as days of the week (again with respect to your current UI culture) like follows:

date-time-axis

But the customization options don’t end here! While setting the DefaultFormat properties for series and axes is indeed the most convenient way to customize the appearance of your labels we have exposed the TickPoints collection of the Axis class (DataPoints for the Series were already exposed at release time). Because of this you will have the chance to change the format string of each item individually or simply place your custom text in there. So if you want to customize your x axis to show the following: “Mon, Tue, TODAY, Thu” you most definitely can – well at least once you get your hands on that SP1 chart :-)

Cheers from the data visualization division in Telerik!


About the Author

Vladimir Milev

Vladimir Milev is a developer manager.

Comments

Comments are disabled in preview mode.