0

I have a RadHtmlChart that includes NULL values and instead of skipping or interpolating the values, they are counted as zero.

Here is my chart:

<Telerik:RadHtmlChart ID="rhc" runat="server">
    <PlotArea>
        <Series>
            <Telerik:ScatterLineSeries Name="Intl" DataFieldX="a1" DataFieldY="a2" MissingValues="Interpolate">
                <TooltipsAppearance DataFormatString="{1:N}% on {0:MM/dd}" />
                <MarkersAppearance Visible="true" />
            </Telerik:ScatterLineSeries>
            << - I have 7 more entries following - >>
        </Series>
        <XAxis BaseUnit="Weeks" Step="1">
            <LabelsAppearance DataFormatString="{0:MM/dd}" />
        </XAxis>
        <YAxis MaxValue="102" MinValue="0" Step="5">
            <TitleAppearance Text="Percentage" />
        </YAxis>
    </PlotArea>
    <Legend>
        <Appearance Position="Bottom" />
    </Legend>
</Telerik:RadHtmlChart>

I am setting the data source for the chart in the code behind. Here is a small sample:

a1         a2     b1         b2     c1         c2     d1         d2
5/02/2016  100    5/02/2016  96     5/02/2016  100    5/02/2016  (NULL)
5/09/2016  100    5/09/2016  100    5/09/2016  100    5/09/2016  (NULL)
5/16/2016  66     5/16/2016  100    5/16/2016  100    5/16/2016  100
5/23/2016  88     5/23/2016  80     5/23/2016  100    5/23/2016  100
5/30/2016  100    5/30/2016  100    5/30/2016  100    5/30/2016  (NULL)

e1         e2     f1         f2     g1         g2     h1         h2
5/02/2016  100    5/02/2016  100    5/02/2016  100    5/02/2016  98
5/09/2016  100    5/09/2016  5      5/09/2016  100    5/09/2016  83
5/16/2016  100    5/16/2016  (NULL) 5/16/2016  (NULL) 5/16/2016  80
5/23/2016  20     5/23/2016  66     5/23/2016  (NULL) 5/23/2016  63
5/30/2016  100    5/30/2016  100    5/30/2016  (NULL) 5/30/2016  100

A1 through H2 is all 1 record for each date. I have checked that I am setting the "MissingValues" argument on every line series. I followed my data source in debug mode and made sure that no values were being set to zero before assigning it to the chart, yet it still displays zeros.

PhoenixFly
  • 89
  • 2
  • 2
  • 13

1 Answers1

0

It's unclear what the expected behavior is. Do you want the days with a null number value not to show at all? You'd be better off removing them from the data before binding if this is the case.

Sorry, my VB is too rusty, so here's some C#;

List<Day> dataSource = getData();

foreach(Day d in dataSource)
    if (d.Number == null)
        dataSource.Remove(d);
Seano666
  • 2,238
  • 1
  • 15
  • 14
  • You are correct. I should have thought this out a little bit more before posting. It completely makes sense that the chart wouldn't skip over the null values because 1 of 2 is not null. – PhoenixFly Jun 28 '16 at 17:35
  • @PhoenixFly Glad I could help. I understand what you were getting at, but the chart is not going to know that you don't want those records with a null number. So 0 is the natural default. – Seano666 Jun 28 '16 at 17:48