Totally lost, and the documentation tells me it is a string. It is definitely NOT a .NET type format string.
How should it look?
Hi NetTecture,
Thank you for your post!
formatLabel is an object. You can refer to API help docs https://www.igniteui.com/help/api/2013.2/ui.igDataChart. From the Options tab and then pick axes option and pick the formatLabel. There is code sample using formatLabel.
Sincerely,
Deyan Kamburov
Ok, useless answer. Simply because it is not using MVC.
In MVC the Axis FormatLabel is defined as having an input of string. No parameter. This means I do not have access to the value in the axis. How do I make that?
Example:
x.CategoryX("xAxis").Label(item => item.Item1);
nw, Item1 is a number. I want it to be shown as string% (i.e. 5 turns into 5%, 7 into 5%). How do I do that? This is as simple as it gets.
And no, the link to some jquery level stuff is useless - given that this is C# and MVC from a logical point, I want an example using MVC, not pure jquery. If I have to get rid of the MVC wrappers - so be it, but please document that they are useless.
Thank you for the clarification.
You need to use FormatLabel option to accomplish such behavior. That option does not take as a parameter format string from C#. It takes a function as a parameter in which you can format the label as you want. For your example you can try
x.CategoryX("xAxis").Label(item => item.Item1).FormatLabel("function (item) {return item.Item1 + '%';}");
You can also pass as a parameter of FormatLabel only the name of a formatting function not the whole function as I did in the example.