Hello.
I am using VBScript to manipulate ActiveX TeeChart version 7.0.1.3. The problem is that the datasources are not set. I get the serie and the function type is correct but the datasources are not set. I can open the editor and add the series manually but the following code does not work. What is the problem here?
sub AddDifferenceSerie()
Dim dsNum
'Add line
axChart.AddSeries(0)
dsNum = axChart.SeriesCount - 1
With axChart.Series(dsNum)
.Title = "Difference"
.Color = 0
.SetFunction 2 'tfSubtract
.DataSource = axChart.Series(0).Title & "," & axChart.Series(1).Title
End With
End sub
Regards, fjarvirkni.
Problem creating subtraction serie at client
-
- Newbie
- Posts: 8
- Joined: Mon Dec 04, 2006 12:00 am
Problem creating subtraction serie at client
Last edited by fjarvirkni on Thu Dec 14, 2006 12:25 pm, edited 1 time in total.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi fjarvirkni,
You may need to call CheckDataSource method as told in Tutorial 7 - Working with Functions. You'll find the tutorials at TeeChart's program group.
You may need to call CheckDataSource method as told in Tutorial 7 - Working with Functions. You'll find the tutorials at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 8
- Joined: Mon Dec 04, 2006 12:00 am
I have added the CheckDataSource but that does not do anything. The code is now as follows:
sub AddDifferenceSerie()
Dim dsNum
'Add line
axChart.AddSeries(0)
dsNum = axChart.SeriesCount - 1
With axChart.Series(dsNum)
.Title = "Difference"
.Color = 0
.SetFunction 2 'tfSubtract
.DataSource = axChart.Series(0).Title & "," & axChart.Series(1).Title
.CheckDataSource
End With
End sub
Is there any restrictions on the Charts Titles? The chart titles are formatted like "Location - device, measurement" i.e. with a comma. Is that allowed?
sub AddDifferenceSerie()
Dim dsNum
'Add line
axChart.AddSeries(0)
dsNum = axChart.SeriesCount - 1
With axChart.Series(dsNum)
.Title = "Difference"
.Color = 0
.SetFunction 2 'tfSubtract
.DataSource = axChart.Series(0).Title & "," & axChart.Series(1).Title
.CheckDataSource
End With
End sub
Is there any restrictions on the Charts Titles? The chart titles are formatted like "Location - device, measurement" i.e. with a comma. Is that allowed?
Hi,
the problem is that you've to pass the Series name as DataSource, not the Series title :
the problem is that you've to pass the Series name as DataSource, not the Series title :
Code: Select all
Dim dsNum
TChart1.Series(0).Name = "seriesname"
'Add line
TChart1.AddSeries (0)
dsNum = TChart1.SeriesCount - 1
With TChart1.Series(dsNum)
.Title = "Difference"
.Color = 0
.SetFunction 2 'tfSubtract
.DataSource = TChart1.Series(0).Name
.CheckDataSource
End With
Pep Jorge
http://support.steema.com
http://support.steema.com