Как добавить разделитель тысяч для значения круговой диаграммы?

У меня есть круговая диаграмма telerik, где значения для меток были бы как 6413.857 МВтч, 75433.695 МВтч. Как добавить разделитель тысяч (6 413,857 МВтч, 75 433 695 МВтч) в эти значения, которые отображаются на графике?

Я попытался отформатировать, используя строку dataformat, но это либо не повлияет на значение вообще, либо даст пустое значение.

 <div class="pie">
         <telerik:RadHtmlChart runat="server" ID="PChartConsumption" Visible="false" Width="100%" Height="300" Transitions="true" Skin="Silk">
            <ChartTitle Text="Consumption in MWh for all the price plans">
                <Appearance Align="Center" Position="Top">
                </Appearance>
            </ChartTitle>
            <Legend>
                <Appearance Position="Right" Visible="true">
                </Appearance>
            </Legend>
            <PlotArea>
                <Series>
                    <telerik:PieSeries DataFieldY="Consumption" ColorField="Color" ExplodeField="false"
                        NameField="PricePlanType">
                        <LabelsAppearance DataFormatString="{0:#,###.000} MWh">
                           <ClientTemplate>#= kendo.format(\'{0:N3}\', dataItem.Consumption)#</ClientTemplate>
                        </LabelsAppearance>
                        <TooltipsAppearance Color="Black" />
                    </telerik:PieSeries>
                </Series>
            </PlotArea>
        </telerik:RadHtmlChart>
    </div>

Источник данных круговой диаграммы

 DataTable tbl = new DataTable();
        tbl.Columns.Add(new DataColumn("Consumption"));
        tbl.Columns.Add(new DataColumn("PricePlanType"));
        tbl.Columns.Add(new DataColumn("Color"));
        tbl.Columns.Add(new DataColumn("IsExploded"));
        string fixedCon, sigCon, sigPlusCon, dodtCon, wspsCon;
        if (consumptionFixed > 0)
            fixedCon = consumptionFixed.ToString("#.000");
        else
            fixedCon = "0";

        if (consumptionSignature > 0)
            sigCon = consumptionSignature.ToString("#.000");
        else
            sigCon = "0";

        if (consumptionSignaturePlus > 0)
            sigPlusCon = consumptionSignaturePlus.ToString("#.000");
        else
            sigPlusCon = "0";

        if (consumptionDOT > 0)
            dodtCon = consumptionDOT.ToString("#.000");
        else
            dodtCon = "0";

        if (consumptionWSPSubscription > 0)
            wspsCon = consumptionWSPSubscription.ToString("#.000");
        else
            wspsCon = "0";

        tbl.Rows.Add(new object[] { fixedCon, PricePlanConstants.GetName(PricePlanEnum.Fixed), "Red", false });
        tbl.Rows.Add(new object[] { sigCon, PricePlanConstants.GetName(PricePlanEnum.Signature), "Blue", false });
        tbl.Rows.Add(new object[] { sigPlusCon, PricePlanConstants.GetName(PricePlanEnum.SignaturePlus), "Green", false });
        tbl.Rows.Add(new object[] { dodtCon, PricePlanConstants.GetName(PricePlanEnum.DOT), "Yellow", false });
        tbl.Rows.Add(new object[] { wspsCon, PricePlanConstants.GetName(PricePlanEnum.WSPSubscription), "Pink", true });

0 ответов

Другие вопросы по тегам