开发者

How to format the axis values in an asp.net mvc 3 chart using C# and razor?

开发者 https://www.devze.com 2023-03-22 05:16 出处:网络
I\'开发者_如何学编程m trying to create a chart in asp.net mvc 3 using the system.web.helpers namespace.However, I cannot find a way to format the values of the Y Axis.Currently they are display as 100

I'开发者_如何学编程m trying to create a chart in asp.net mvc 3 using the system.web.helpers namespace. However, I cannot find a way to format the values of the Y Axis. Currently they are display as 1000,2000,3000,4000 when I would like them to be $1,000,$2,000,$3,000,$4,000

Any ideas?


There does not seem to be a way to do this. Marking this as the answer.


Please read here and here.

I think you need something resembling this code:

LabelStyle style = new LabelStyle();
style.Format = "$#,##0";
myChart.ChartAreas[0].AxisY.LabelStyle = style;
0

精彩评论

暂无评论...
验证码 换一张
取 消