Page 1 of 1

Error on addseries

Posted: Mon Feb 09, 2009 1:47 pm
by 15049572
Hi

After I have created some series and groups in a teechart, I clear the chart, and add them once again. When I loop the AddSeries first time it went well, but second time I got an error:

-2147418113, "Invalid pointer operation"

I'm using TeeChart Pro Activex Control v8
v8.0.0.4

It seemse that my series count increment by one each time, even when I got the error.
Hope any one can give me clue, what can goes wrong, since I do not under stand it !

Regards
Kasper

Code: Select all

Set myChart = TChart1

 For n = 0 To 2
        seriesCount = myChart.seriesCount
        myChart.AddSeries scLine
        myChart.Series(seriesCount).asLine.Pointer.Visible = True
        myChart.Series(seriesCount).asLine.Pointer.HorizontalSize = 2
        myChart.Series(seriesCount).asLine.Pointer.VerticalSize = 2
        
        myChart.Series(seriesCount).asLine.LinePen.width = 1
        myChart.Series(seriesCount).Clear
        myChart.Series(seriesCount).Active = True
        myChart.Series(seriesCount).XValues.DateTime = True
        
        myChart.Series(seriesCount).Title = "some title"
    
        
        If (n = 0) Then
            ' add graph/serie to the group to be shown in list box
            myChart.SeriesList.Groups.Items(0).Add seriesCount
        else
          myChart.Series(seriesCount).color = vbRed
          myChart.Series(seriesCount).Active = False
          myChart.Series(seriesCount).asLine.Stairs = True
        End If
      
        If n  = 2 Then
            groupCount = myChart.SeriesList.Groups.count 
            myChart.SeriesList.AddGroup groupCount
            
            'myChart.Series(seriesCount - 1).Title = "abc"
            'myChart.Series(seriesCount).Title = "abc"
        End If
      
Next

Posted: Mon Feb 09, 2009 4:23 pm
by narcis
Hi Kasper,

I'm not able to reproduce the issue here using v8.0.0.5. Could you please check if this solves the problem for you? If it doesn't could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Thu Apr 02, 2009 1:29 pm
by 15049572
Sorry it was my mistake, when manipulating series data... I have not seen the problem since I have fixed this other bug.