When i use this instruction
.Tools.Add tcAnnotate after drawing a curves on my chart, a small rectangle appears on the left top corner of the chart. I don't know where it comes from. help me
thanx
magic rectangle when using .Tools.Add tcAnnotate
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ghynna,
That's what Annotation tool is about. The statement you mention is the one which creates that rectangle. For more information on TeeChart tools you could have a look at TeeChart tutorials, features demo and help files all available at TeeChart's program group.
That's what Annotation tool is about. The statement you mention is the one which creates that rectangle. For more information on TeeChart tools you could have a look at TeeChart tutorials, features demo and help files all available 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ghynna,
Could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
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 |
i send you a the source code (which is a part a program) that causes problems.
Private Sub DrawKinetic() 'ByVal nbpoint As Integer
If (draw_alpha = True) Then
GraphFile.RemoveAllSeries
GraphFile.AddSeries scPoint '(scFastLine)
GraphFile.Series(0).Clear
GraphFile.Axis.Left.Title.Caption = "Temperature"
GraphFile.Series(0).FastLine.LinePen.Width = 2
Dim val
Dim tmp
For i = 0 To nb_points - 1
val = temp(i)
GraphFile.Series(0).AddXY time(i), val, "", vbBlue
Next i
Dim peak As Double
Dim index As Integer
index = Peak_TemperatureIndex()
peak = Calcul_Alpha_DAlpha.temp(index)
With GraphFile
.Tools.Add tcAnnotate
.Tools.Items(0).Active = True
With .Tools.Items(0).asAnnotation
.Shape.CustomPosition = True
.Shape.Left = 100
.Shape.Top = 200
.Shape.Gradient.Visible = True
.Shape.ShapeStyle = fosRoundRectangle
.Shape.Font.Name = "Verdana"
.Text = "Peak temperature =" + Format(CStr(peak), "#####0.0#") + "°K" + Chr(13) + "Reaction Enthalpy =" + Format(CStr(enthalpy), "#####0.0#") + "kJ"
End With
End With
End If
End Sub
Private Sub DrawKinetic() 'ByVal nbpoint As Integer
If (draw_alpha = True) Then
GraphFile.RemoveAllSeries
GraphFile.AddSeries scPoint '(scFastLine)
GraphFile.Series(0).Clear
GraphFile.Axis.Left.Title.Caption = "Temperature"
GraphFile.Series(0).FastLine.LinePen.Width = 2
Dim val
Dim tmp
For i = 0 To nb_points - 1
val = temp(i)
GraphFile.Series(0).AddXY time(i), val, "", vbBlue
Next i
Dim peak As Double
Dim index As Integer
index = Peak_TemperatureIndex()
peak = Calcul_Alpha_DAlpha.temp(index)
With GraphFile
.Tools.Add tcAnnotate
.Tools.Items(0).Active = True
With .Tools.Items(0).asAnnotation
.Shape.CustomPosition = True
.Shape.Left = 100
.Shape.Top = 200
.Shape.Gradient.Visible = True
.Shape.ShapeStyle = fosRoundRectangle
.Shape.Font.Name = "Verdana"
.Text = "Peak temperature =" + Format(CStr(peak), "#####0.0#") + "°K" + Chr(13) + "Reaction Enthalpy =" + Format(CStr(enthalpy), "#####0.0#") + "kJ"
End With
End With
End If
End Sub
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ghynna,
It's hard to guess without being able to run your code as, in your snipet, you only add one Annotation tool. Would you be so kind to send us an example we can run "as-is" to reproduce the problem here so that we can reproduce the problem here and help you finding a solution?
Thanks in advance.
It's hard to guess without being able to run your code as, in your snipet, you only add one Annotation tool. Would you be so kind to send us an example we can run "as-is" to reproduce the problem here so that we can reproduce the problem here and help you finding a solution?
Thanks in advance.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ghynna,
I've been able to reproduce your problem here and I've found a solution for it. The problem was that every time you changed the series style you where adding a new Annotation tool to the chart. To reproduce this click ComboSeries and then go to the Tools tab at the chart editor. You'll notice one additional Annotation tool for every time you clicked the combobox. To prevent that I've added a IF statement checking if there already was an Annotation tool in the chart. See code below:
I've been able to reproduce your problem here and I've found a solution for it. The problem was that every time you changed the series style you where adding a new Annotation tool to the chart. To reproduce this click ComboSeries and then go to the Tools tab at the chart editor. You'll notice one additional Annotation tool for every time you clicked the combobox. To prevent that I've added a IF statement checking if there already was an Annotation tool in the chart. See code below:
Code: Select all
Private Sub ComboSeries_Click()
With TChart1
'Look to see if there's already a Series in the Chart
'Remove the existing Series
.RemoveAllSeries
'Add and randomly populate the new Series
'eg. .AddSeries(scHorizBar) is the same as .AddSeries(2)
.AddSeries (ComboSeries.ListIndex)
.Series(0).FillSampleValues 15
'Name the Series to visualise in the Chart Editor.
.Series(0).Title = ComboSeries.List(ComboSeries.ListIndex) & "Series"
'Modify the Chart Title
.Header.Text(0) = .Series(0).Title
If .Tools.Count <= 0 Then 'Added IF statement to prevent additional annotation tools.
.Tools.Add tcAnnotate
.Tools.Items(0).Active = True
With .Tools.Items(0).asAnnotation
.Shape.CustomPosition = True
.Shape.Left = 100
.Shape.Top = 200
.Shape.Gradient.Visible = True
.Shape.ShapeStyle = fosRoundRectangle
.Shape.Font.Name = "Verdana"
.Text = "My text"
End With
End If
End With
End Sub
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 |