Hi: I have a simple plot of x-y data. I want to add two vertical bars (making a window) a specific number of x-axis units apart. How can I do this?
This picture should show what I'm after.
add window bars to simple x-y chart?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Russ,
The easiest way to achieve that is using ColorBand or ColorLine tools.
The easiest way to achieve that is using ColorBand or ColorLine tools.
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 |
add window bars to simple x-y chart (access violation)
Hi: I am having difficulty in figuring out how to draw two vertical bars on an x-y chart. I can't find much in the way of examples of ColorBand useage. Here is some code that I have attempted but it results in an access violation in "TeeChart7.ocx" as seen in the attached picture (with the code).
Best Regards,
russ
Best Regards,
russ
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Russ,
The same code works fine here using v7.0.1.3, which is the latest version available at the client area, provided bottom axis, at least, ranges from 25 to 75. Otherwise the band is not visible.
Which TeeChart version are you using? If the problem persists could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
The same code works fine here using v7.0.1.3, which is the latest version available at the client area, provided bottom axis, at least, ranges from 25 to 75. Otherwise the band is not visible.
Which TeeChart version are you using? If the problem persists could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
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 |
add window bars to simple x-y chart?
I finally figured out what the problem was. The line of code ".Tools.Items(0).asColorband.Axis" made specific reference to tool 0 of the present set of tools for this particular chart. Well, the ColorBand tool wasn't my only tool so I was referencing the wrong tool by the "Items(0)" part.
Is there a way to reference the ColorBand tool without using the "Items(0)" method?
Thanks a bunch for your help. I have been very please with your software and support.
Regards,
russ
Is there a way to reference the ColorBand tool without using the "Items(0)" method?
Thanks a bunch for your help. I have been very please with your software and support.
Regards,
russ
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Russ,
Thank you very much. I'm glad to hear it works fine for you.
Regarding your question, at the snippet below you have 2 example on how to do that:
Thank you very much. I'm glad to hear it works fine for you.
Regarding your question, at the snippet below you have 2 example on how to do that:
Code: Select all
Private Sub Form_Load()
Dim ColorBandIndex As Integer
Dim ColorBand As IColorBandTool
TChart1.Series(0).FillSampleValues 100
ColorBandIndex = TChart1.Tools.Add(tcColorband)
With TChart1.Tools.Items(ColorBandIndex).asColorband
.Axis = TChart1.Axis.Bottom
.StartValue = 10
.EndValue = 20
.ResizeEnd = True
.ResizeStart = True
End With
'or
TChart1.Tools.Add tcColorband
Set ColorBand = TChart1.Tools.Items(TChart1.Tools.Count - 1).asColorband
With ColorBand
.Axis = TChart1.Axis.Left
.StartValue = 100
.EndValue = 150
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 |