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
603
disappearing columns in column chart
posted

My column chart is behaving rather oddly. I have it bound on a datatable such that it will display either the progress (1 bar per item in the x axis) or the varying schedules (3 bars per item in the x axis).  The chart displays the correct data when switching from one display type to another via the radio button, until you move the mouse and get the pointer out of the chart area that's when one or more set of columns will suddenly disappear. For instance, columns related to Schedule2 and Schedule3 columns for all items in the X axis will just vanish and only Schedule1 will remain.

I have checked and re-checked that no actions like Refresh exist for any mouse-related event so maybe someone out there can help me with this problem. My code is posted below for reference.

 

If Not (dtProjects Is Nothing) Then

            Chart1.ResetData()
            Chart1.Data.excludeColumns.Clear()
            Dim dv As DataView = New DataView(dtProjects)

            Chart1.Data.UseRowLabelsColumn = True
            Chart1.Data.RowLabelsColumn = 1
            dv.Sort = "creationdate"
            Chart1.DataSource = dv

            'Include only the 4 relevant columns (3, 22, 23, 24)
            Chart1.Data.IncludeColumn(0, False)
            Chart1.Data.IncludeColumn(1, False)
            Chart1.Data.IncludeColumn(2, False)
            Chart1.Data.IncludeColumn(3, True)
            Chart1.Data.IncludeColumn(4, False)
            Chart1.Data.IncludeColumn(5, False)
            Chart1.Data.IncludeColumn(6, False)
            Chart1.Data.IncludeColumn(7, False)
            Chart1.Data.IncludeColumn(8, False)
            Chart1.Data.IncludeColumn(9, False)
            Chart1.Data.IncludeColumn(10, False)
            Chart1.Data.IncludeColumn(11, False)
            Chart1.Data.IncludeColumn(12, False)
            Chart1.Data.IncludeColumn(13, False)
            Chart1.Data.IncludeColumn(14, False)
            Chart1.Data.IncludeColumn(15, False)
            Chart1.Data.IncludeColumn(16, False)
            Chart1.Data.IncludeColumn(17, False)
            Chart1.Data.IncludeColumn(18, False)
            Chart1.Data.IncludeColumn(19, False)
            Chart1.Data.IncludeColumn(20, False)
            Chart1.Data.IncludeColumn(21, False)
            Chart1.Data.IncludeColumn(22, True)
            Chart1.Data.IncludeColumn(23, True)
            Chart1.Data.IncludeColumn(24, True)


            If optSchedule.Checked = True Then
                Dim aColLabels As String() = {"Sched1", "Sched2", "Sched3"}
  
                'Further remove unnecessary column from the initial selection
                Chart1.Data.IncludeColumn(24, False)
                Chart1.Data.SetColumnLabels(aColLabels)
                Chart1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.ColumnChart
                Chart1.Axis.Y.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Automatic
                'Chart1.Axis.Y.RangeMin = 0
                'Chart1.Axis.Y.RangeMax = 0

            Else
                Dim aColLabels As String() = {"Progress"}

                'Further remove unnecessary columns from the initial selection
                Chart1.Data.IncludeColumn(3, False)
                Chart1.Data.IncludeColumn(22, False)
                Chart1.Data.IncludeColumn(23, False)
                Chart1.Data.SetColumnLabels(aColLabels)
                Chart1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.ColumnChart
                Chart1.Axis.Y.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom
                Chart1.Axis.Y.RangeMin = 0
                Chart1.Axis.Y.RangeMax = 100
            End If

            Chart1.Data.DataBind()
            Chart1.Refresh()


 End If

  • 28496
    Offline posted

     there was a bug some time ago where excluded columns were not stored properly and something similar happened... please make sure you have tested with the latest available hotfix.

    otherwise, I can investigate further, but where is this code called from?  is it just the OptionSet Checked event handler?