0

I have a chart which dynamically generates series. The series represent people. and Im using only the Yaxis in a Stacked bar chart to generate for each day of a month how many people have data. My problem is that if person1 and person3 have data for the first day of the month and person2 has data for the second day, there will be a gap between person1 and person3.

        foreach (DataRow dr in dt.Rows)
        {
            string Name = dr.ItemArray.GetValue(0).ToString();
            int Days = (int)dr.ItemArray.GetValue(1);
            int Month = (int)dr.ItemArray.GetValue(2);

            if (Chart1.Series.FindByName(Name) == null) Chart1.Series.Add(Name);

            Chart1.Series[Name].Points.AddXY(Days, Month);
            Chart1.Series[Name].ChartType = SeriesChartType.StackedBar;
            Chart1.Series[Name].ToolTip = Name;
        }

SOLUTION The problem here was that i was adding y and x axis but i was using only the y one. When i stopped adding the x one there were no more gaps.

SubqueryCrunch
  • 1,325
  • 11
  • 17
  • Can you show us how do you serialize the info. Do you serialize by automatic datasource or you do programmatically? – MarcS Jun 19 '15 at 11:54
  • I updated my question. – SubqueryCrunch Jun 19 '15 at 11:56
  • I think this may be a serialize problem with a dr empty value input. Debug it and make sure there is none missing null or empty datarow. – MarcS Jun 19 '15 at 12:03
  • I checked the content of the data table before i start adding the series and there are not empty fields. I checked also when im adding the series and everything is okay there as well. – SubqueryCrunch Jun 19 '15 at 12:07

0 Answers0