【问题标题】:telerik RAD HTMLChart Label display NaN (not a number)Telerik RAD HTMLChart 标签显示 NaN(不是数字)
【发布时间】:2016-03-26 00:48:11
【问题描述】:

我有一个图表,它在代码隐藏中从 SQL 数据库中获取数据。一切都正确显示,并且悬停时该系列的编号正确。

这是一个堆叠条形图,显示此站点上的一轮显示总数。

http://www.telerik.com/support/kb/aspnet-ajax/chart-%28html5%29/details/displaying-grand-total-in-stacked-series-labels-and-pie-series-legend

我知道来自 SQL 的数据是一个数字,因为我将其转换为十进制。

gTotal 显示:“TL bbl: NaN”
如果我只是做 TL bbls: #=dataItem.TotalRed# 它显示未定义 有什么想法吗?

后面的代码:

    Dim daFMChart As New SqlDataAdapter(SQLFM, Conn)
    daFMChart.Fill(DTFMChart)

    Me.ColumnChart.DataSource = DTFMChart
    Me.ColumnChart.DataBind()

SQL数据是这样的

+-------------------------------------------------+
| DateTime     TotalRed   TotalWhite       gTotal |
+-------------------------------------------------+
| 2016-03-25    20000        3             0.0001 |
| 2016-03-24    30000        2601          0.0001 |
| 2016-03-23    50000        45626         0.0001 |
| 2016-03-22    10000        55568         0.0001 |
| 2016-03-21    30000        54098         0.0001 |
| 2016-03-20    10000        51351         0.0001 |
| 2016-03-19    20000        21973         0.0001 |
+-------------------------------------------------+

<ChartTitle Text="Daily Volume Total Per Meter">
    <Appearance Align="Right" Position="Top">
        <TextStyle Color="#999999" />
    </Appearance>
</ChartTitle>

<Legend>
    <Appearance Position="Right" Visible="true">
        <TextStyle Color="#999999" />
    </Appearance>
</Legend>

<PlotArea>
    <Series>

        <telerik:ColumnSeries Name="FM Red" DataFieldY="TotalRed" Stacked="true">
            <LabelsAppearance Visible="false"></LabelsAppearance>
            <Appearance>
                <FillStyle BackgroundColor="#ff1a1a"></FillStyle>

            </Appearance>
        </telerik:ColumnSeries>

        <telerik:ColumnSeries Name="FM White" DataFieldY="TotalWhite">
            <LabelsAppearance Visible="false"></LabelsAppearance>
            <Appearance>
                <FillStyle BackgroundColor="#bfbfbf"></FillStyle>
            </Appearance>
        </telerik:ColumnSeries>

        <telerik:ColumnSeries DataFieldY="gTotal" Stacked="true">
            <Appearance FillStyle-BackgroundColor="#DDD9C3"></Appearance>
            <LabelsAppearance Position="OutsideEnd">
                <TextStyle Color="#999999" />
                <TextStyle Margin="0" />
                <ClientTemplate>
                        TL bbls: #=dataItem.TotalRed + dataItem.TotalWhite#
                </ClientTemplate>
            </LabelsAppearance>

            <TooltipsAppearance Visible="false">
            </TooltipsAppearance>
        </telerik:ColumnSeries>

    </Series>
    <XAxis DataLabelsField="DateTime"></XAxis>
    <XAxis>
        <MajorGridLines Visible="false" />
        <MinorGridLines Visible="false" />
        <LabelsAppearance Step="1">
            <TextStyle Color="#999999" />
        </LabelsAppearance>
    </XAxis>

    <YAxis>
        <MajorGridLines Visible="true" Color="#555555" />
        <MinorGridLines Visible="false" />
        <LabelsAppearance Step="1">
            <TextStyle Color="#999999" />
        </LabelsAppearance>
    </YAxis>
</PlotArea>

<ChartTitle Text=""></ChartTitle>

【问题讨论】:

    标签: asp.net telerik rad radhtmlchart


    【解决方案1】:

    猜猜是什么.....它是一个错误。

    不适用于 X 轴的日期列。

    要弄清楚是多么痛苦。

    必须使用 3|24 作为字符串.. 不能使用 3/24

    【讨论】:

    • 在将日期列数据绑定到 RAD HtmlChart 之前,您能否在后面的 VB 代码中格式化日期列数据?而不是在&lt;ClientTemplate&gt;
    猜你喜欢
    • 1970-01-01
    • 2018-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多