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
1320
UltraChart Memory utilization when ShowOwners is True
posted

Hi to all.  I am having an unusual problem with the UltraChart control when UltraChart.ChartType = GanttChart and UltraChart.GanttChart.ShowOwners = True.  I've noticed with this setting that the UltraChart.FillSceneGraph() method is continuously executed (and there is nothing else in the call stack beneath it).  Unfortunately for me I have some implemented some additional code within this method and hence the CPU is very active when the UltraChart is displayed even though the application is effectively idle.  If I set ShowOwners = False, or if I set the Owner property of every GanttTimeEntry to an empty string then the problem does not occur.

Given the complexity of my application, and the fact that my UltraChart implementation is as part of a larger custom control I am not able to provide any source code.  I have checked all calls to UltraChart.Invalidate and UltraChart.Refresh methods and there are none that could be causing this problem.  I am not able to reproduce the error in a sample application.  I have also ruled out InteractionTools derived classes and IRenderLabel implementing classes as a potential cause.

 Any ideas?

Parents
No Data
Reply
  • 1320
    Verified Answer
    Offline posted

    OK.  I've solved the problem myself and I can reproduce the error.  To check this out yourself just create a new form with two UltraCheckEditors called UltraCheckEditor1 and UltraCheckEditor1, and an UltraChart called UltraChart1.  Then paste this code into the form's code:

    Private Sub Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      UltraChart1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.GanttChart
      UltraCheckEditor1.Text =
    "Show Owners"
     
    UltraCheckEditor2.Text = "FontSizeBestFit"
     
    LoadData()
     
    End Sub

    Private Sub UltraCheckEditor1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UltraCheckEditor1.CheckedChanged
      UltraChart1.GanttChart.ShowOwners = UltraCheckEditor1.Checked
    End Sub

    Private Sub UltraCheckEditor2_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles UltraCheckEditor2.CheckedChanged
      UltraChart1.GanttChart.OwnersLabelStyle.FontSizeBestFit = UltraCheckEditor2.Checked
    End Sub

    Private Sub UltraChart1_FillSceneGraph(ByVal sender As Object, ByVal e As Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs) Handles UltraChart1.FillSceneGraph
      Debug.Print(
    String.Format("UltraChart1.FillSceneGraph @ {0}", Now.ToString("HH:mm:ss.ff")))
    End Sub

    Private Sub LoadData()
      Try
       
    Dim ganttSeries As Infragistics.UltraChart.Data.GanttSeries = Nothing
       
    Dim ganttItem As Infragistics.UltraChart.Data.GanttItem = Nothing
       
    Dim timeEntry As Infragistics.UltraChart.Data.GanttTimeEntry = Nothing
       
    ganttSeries = New Infragistics.UltraChart.Data.GanttSeries("SeriesA")
        ganttSeries.Label =
    "Series A"
       
    ganttItem = New Infragistics.UltraChart.Data.GanttItem("Task1")
        ganttItem.Label =
    "Task 1"
       
    timeEntry = New Infragistics.UltraChart.Data.GanttTimeEntry(CDate("7 Aug 2008 9:00 am"), CDate("7 Aug 2008 11:00 am"), 0, -1, "Worker A", 100)
        timeEntry.Label =
    String.Format("Label {0}", timeEntry.ID)
        timeEntry.Owner =
    String.Format("Entry {0}", timeEntry.ID)
        ganttItem.Times.Add(timeEntry)
        ganttSeries.Points.Add(ganttItem)
       
    Me.UltraChart1.Series.Add(ganttSeries)
     
    Catch ex As Exception
        Debug.Print(
    String.Format("LoadData Error : {0}", ex.Message))
     
    End Try
    End Sub

    Now run the code then click on the check boxes and you will see a stream of messages in the Immediate Window in VS when both check boxes are ticked.

Children