0

below is the code I use:

        DataTable dt = new DataTable();
        string connstring = "%my connection string%";
        string query = @"%my query%";
        OracleConnection oc = new OracleConnection(connstring);
        oc.Open();

        OracleCommand ocom = new OracleCommand(query, oc);
        OracleParameter p1 = new OracleParameter();
        p1.Value = dtp1.Value.Date;
        ocom.Parameters.Add(p1);
        OracleParameter p2 = new OracleParameter();
        p2.Value = dtp2.Value.Date;
        ocom.Parameters.Add(p2);

        try
        {
            dt.Load(ocom.ExecuteReader());
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
        //*********
        chart1.Series.Clear();
        this.chart1.DataBindCrossTable(dt.Rows, "PROGRAM_NAME", "STARTDATE", "MINUTES", "");
        foreach (Series ser in chart1.Series)
        {
            ser.ChartType = SeriesChartType.StackedColumn;
        }

it generates pretty good chart and I am generally satisfied form results until ... it is a short period of time. When I choose wider time interval my column has empty holes. Below two screenshots: The first one shows only 5 days of March. 9th of March column reach value of 200 (minutes) 7-11 of marchenter image description here

and the second shows 15 days of March . 9th of March should also be 200 but it finish just below 200 and then there is a hole before the last blue bar 7-11 of march enter image description here

Do you have any idea why such a failure appears ?

Data from 9 of march

enter image description here

są the first chart is correct , the second one , with hole has a failure.

user3863616
  • 185
  • 1
  • 9
  • 24

1 Answers1

1

The 'holes' actually are misplaced bars and many should go to one or more points to the left..! See here:

enter image description here

The DataPoints must be 'synch'ed' or 'aligned'. This means each Series of ChartType StackedXXX must have a DataPoint at each of the X-Values of any other Series .

There is a long post here that should explain it all..

Note especially the link to this interesting chart function

DataManipulator.InsertEmptyPoints

has several overloads to help aligning stacked charts.

Community
  • 1
  • 1
TaW
  • 53,122
  • 8
  • 69
  • 111