【问题标题】:Kendo Currency Format For Pie Chart饼图的剑道货币格式
【发布时间】:2014-12-13 19:12:02
【问题描述】:

我只需要使用饼图以货币格式显示我的价值观。我想我错过了,所以我找不到解决方案。

我必须如何处理这段代码?

  .Template("#= category #: #= value '{0:C}'#"))

这是我的剑道图表:

            @(Html.Kendo().Chart(Model)
.Name("chart3")
      .Title(title => title
                    .Text(@ViewBag.a)
        .Position(ChartTitlePosition.Top))
        .Legend(legend => legend
        .Visible(true)
        .Position(ChartLegendPosition.Top))
    .Series(series =>
    {
        series.Pie(model => model.Count, categoryExpression: model => model.Name);


    })


.Theme("metro")
      .Tooltip(tooltip => tooltip
    .Visible(true)
                            .Template("#= category #: #= value '{0:C}'#"))
        .Events(ev => ev.DataBound("onDB"))

            )

【问题讨论】:

    标签: jquery kendo-ui telerik kendo-asp.net-mvc


    【解决方案1】:

    就这样吧:

    .Template("#= category #: #= kendo.toString(value, 'c0')#"))
    

    【讨论】:

    • 感谢您的回答,但我无法使用此代码获取货币。
    • ispanak 您可能需要将您的值转换为浮点数,它可能是一个字符串。我必须这样做才能让它工作。"#=kendo.format('{0:C0}', parseFloat(value))#"
    猜你喜欢
    • 2017-10-25
    • 1970-01-01
    • 2015-07-24
    • 2017-10-09
    • 1970-01-01
    • 2019-11-07
    • 1970-01-01
    • 2015-10-24
    • 2016-05-02
    相关资源
    最近更新 更多