asp.net chart control shows gap between series

231 Views Asked by At

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.

0

There are 0 best solutions below