kojirosan
kojirosan

Reputation: 507

Kendo Currency Format For Pie Chart

All i need to show my values with currency format with Pie Chart. I think i missed so i couldn't find a solution for this.

How must i handle this code?

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

Here is my Kendo chart:

            @(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"))

            )

Upvotes: 2

Views: 1846

Answers (1)

Jarosław Kończak
Jarosław Kończak

Reputation: 3407

Just do it like so:

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

Upvotes: 4

Related Questions