Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
Chart not showing all the points
posted

I am using Infragistics Chart control in my Web Application. I have a scenario wherein I have to show multiple line graphs in a single chart and also another chart which contains an AreaGraph. I am adding points into multiple series and add all the series to my chart. After I do the DataBind I see the chart containing all the lines or areas but it shows the data for series which has minimum number of points. Following code, in which I am trying to draw an AreaChart should make the problem clearer. I have put the necessary comments to understand the code better.

private void DrawStackedAreaChart(){               //Feed is my business object. And I get multiple feeds from DB.IList<Feed> feeds = ASAMUIService.GetAllFeedNames();NumericSeries series = null; //For each feed I create a series. Obviously. each series represents an Area in the graphforeach (Feed feed in feeds){series = CreateStackedSeries(feed);if (series == null){continue;}NumericSeries stackedSeries = series;allTicketMessagesChart.DataBind();allTicketMessagesChart.Series.Add(stackedSeries);}allTicketMessagesChart.TitleTop.Text = string.Format("Ticket messages evolution for {0} ({1} - {2})", drpFeedNames.SelectedItem.Text,DateRangeChooserCtrl1.FromDate.ToString("dd/MM/yyyy"), DateRangeChooserCtrl1.ToDate.ToString("dd/MM/yyyy"));ticketMessagesChart.DataBind();allTicketMessagesChart.DataBind();allTicketMessagesChart.ImagePipePageName =allTicketMessagesChart.ResolveClientUrl(WebConfigurationManager.AppSettings[CommonConstants.CHART_IMAGEPIPE_URL]);allTicketMessagesChart.Visible = true;} private NumericSeries CreateStackedSeries(Feed feed){IList<TicketMessage> messages =ASAMUIService.GetTicketMessagesByFeed(DateRangeChooserCtrl1.FromDate, DateRangeChooserCtrl1.ToDate, feed.FeedID);NumericSeries series = new NumericSeries();if (messages == null){return null;}foreach (TicketMessage message in messages){series.Points.Add(new NumericDataPoint(message.MessageCount, message.ProductionDate.ToString("dd-MMM HH:mm"), false));}series.Label = feed.FeedName;return series;

}

 

Now,  for eg. Feed "X" has 5 data points, Feed "Y' has 4 and Feed "Z" has only 2. So when the chart is displayed, it shows only 2 datapoints with area for all the series. Additionally, I am using "NetAdvantage for .NET 2007 Vol. 3 CLR 2.0" with .NET framework 2.0.

 

  • 28496
    Offline posted

     The chart does not currently support series with an uneven number of points to be displayed on the same axis.  You can request this feature here: http://devcenter.infragistics.com/protected/requestfeature.aspx

    for the time being, your options are either:

    1: add "empty" points to the series with fewer than the required number of points

    2: use a composite chart and overlay multiple ChartAreas on top of each other.