I have a chart that is getting data from a SQL database in codebehind. Everything displays correctly and the series have the correct number on hover.
It is a stacked bar with the Show totals work a round found on this site.
I know the data coming from SQL is a number because I'm casting it to decimal.
The gTotal shows: "TL bbl: NaN"
If I just do TL bbls: #=dataItem.TotalRed# it shows undefined
Any Ideas?
code behind:
Dim daFMChart As New SqlDataAdapter(SQLFM, Conn)
daFMChart.Fill(DTFMChart)
Me.ColumnChart.DataSource = DTFMChart
Me.ColumnChart.DataBind()
The SQL data is this
+-------------------------------------------------+
| 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>
Guess what..... Its a Bug.
Does not work with a Date column for the X Axis.
What a pain in the balls that was to figure out.
Had to use 3|24 as a string.. Could not use 3/24