Page 1 of 1

Series statistics

Posted: Wed Apr 09, 2008 1:54 pm
by 6928489
Hi:

I'm trying to use the Series statistics feature. The code your example doesn't work (and can't work), since it doesn't add the statistics tool. I added the tool myself, but the method returns and empty string for the statistics. Do I have to point it as a particular series first? Or if not, then could you show me a complete example?

Also, I have a question that you might not want to discuss in the open forum. Can I have an email address for someone in support? I promise only to discuss this one "procedural" issue and not to abuse the email address for general purpose support questions.

Thanks,

Matt

Posted: Wed Apr 09, 2008 2:30 pm
by narcis
Hi Matt,
I'm trying to use the Series statistics feature. The code your example doesn't work (and can't work), since it doesn't add the statistics tool. I added the tool myself, but the method returns and empty string for the statistics. Do I have to point it as a particular series first? Or if not, then could you show me a complete example?
The example in the features demo shipped with v8.0.0.3 installer works fine for me. Is that the version you are using?

You can find a runtime example in the code below. Notice that at runtime you have to manually create the functions. They are generated automatically at designtime.

Code: Select all

Private Sub Form_Load()
    TeeCommander1.Chart = TChart1
    
    With TChart1
        .AddSeries scLine
        
        .Series(0).FillSampleValues 100
        
        .Tools.Add tcSeriesStats
        .Tools.Items(0).asSeriesStats.Series = TChart1.Series(0)
        
        ' Add a series to be used for an Average Function
        .AddSeries scLine
        
        'Define the Function Type for the new Series
        .Series(1).SetFunction tfAverage
        .Series(1).DataSource = .Series(0)
        
        Text1.Text = .Tools.Items(0).asSeriesStats.Statistics.Text
    End With
    
End Sub
For more information on adding functions at runtime please read Tutorial 7 - Working with Functions. Tutorials can be found at TeeChart's program group.
Also, I have a question that you might not want to discuss in the open forum. Can I have an email address for someone in support? I promise only to discuss this one "procedural" issue and not to abuse the email address for general purpose support questions.
Ok, please send your inquiry to info at steema dot com. They'll forward it to the technical department.

Thanks in advance.

Posted: Wed Apr 09, 2008 2:49 pm
by 6928489
Hi:

Yes, thanks. Your code is different that what I'm tryint to do.

I discovered by trial and error that you need to set the series as:


.Tools.Items(StatToolIndex).asSeriesRegion.Series = LastSeriesStats

It's working now.

Thanks!