telerik RAD HTMLChart标签显示NaN(不是数字)

时间:2016-03-26 00:48:11

标签: asp.net telerik rad radhtmlchart

我有一个图表,它在代码隐藏中从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>

1 个答案:

答案 0 :(得分:0)

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

不适用于X轴的日期列。

要弄明白球的痛苦。

不得不使用3 | 24作为字符串..无法使用3/24