ColorBandTool
ColorBandTool
Am I correct in that the color band tool can not be used on a custom axis?
Also, can I put only a partial colorband up? or am I going to have to draw it using on after draw?
Adrian
Also, can I put only a partial colorband up? or am I going to have to draw it using on after draw?
Adrian
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Adrian,
No, color band tools can also be assigned custom axes, i.e.:Am I correct in that the color band tool can not be used on a custom axis?
Code: Select all
With TChart1.Tools.Items(0).asColorband
.Axis = TChart1.Axis.Custom(0)
.StartValue = 100
.EndValue = 200
End With
I'm not sure of what are you exactly trying to get, can you please be more specific on what a "partial colorband up" consists? Do you mean a colorband not covering the full axis range?Also, can I put only a partial colorband up? or am I going to have to draw it using on after draw?
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 Adrian,
This is not possible with a color band. However, you can achieve that using a rectangle tool and doing something like this:
This is not possible with a color band. However, you can achieve that using a rectangle tool and doing something like this:
Code: Select all
Dim Go As Boolean
Private Sub Form_Load()
For i = 0 To 100
TChart1.Series(0).Add Rnd * 100, "", clTeeColor
Next
TChart1.Tools.Items(0).asRectangle.Shape.Transparency = 50
Go = True
TChart1.Environment.InternalRepaint
End Sub
Private Sub TChart1_OnAfterDraw()
If Go Then
With TChart1.Tools.Items(0).asRectangle
.Left = TChart1.Axis.Left.Position
.Top = TChart1.Series(0).CalcYPosValue(50)
.Height = TChart1.Series(0).CalcYPosValue(20) - .Top
.Width = TChart1.Series(0).CalcXPosValue(40) - .Left
End With
Go = False
End If
End Sub
Private Sub TChart1_OnRectangleToolDragging()
TChart1.Tools.Items(0).asRectangle.Left = TChart1.Axis.Left.Position
End Sub
Private Sub TChart1_OnRectangleToolResizing()
TChart1.Tools.Items(0).asRectangle.Left = TChart1.Axis.Left.Position
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 |
Uh, how is this done in MFC/C++?No, color band tools can also be assigned custom axes, i.e.:Code: Select all
With TChart1.Tools.Items(0).asColorband .Axis = TChart1.Axis.Custom(0) .StartValue = 100 .EndValue = 200 End With
I've tried the following without success:
Code: Select all
CAxis& axis = tchart.GetAxis().GetCustom(m_AxisIds[index]);
CToolList & tools = tchart.GetTools();
CColorBandTool & colourBand = tools.GetItems(m_ColourBand).GetAsColorband();
COleVariant iDispatch;
iDispatch.vt = VT_DISPATCH;
iDispatch.pdispVal = axis.m_lpDispatch;
colourBand.SetAxis(iDispatch.Detach());
There is no rectangle tool. I'm using TChart 7.0.0.3. And due to the tight schedule we have, I am not authorised to upgrade to the new version.This is not possible with a color band. However, you can achieve that using a rectangle tool and doing something like this:
However, for reference, what compatibility issues are there if I were to upgrade to 7.0.0.8, and would I just do the Project->Add To Project->Components and Controls->TeeChart Pro Activex control v7 on the newly installed TChart to update the wrappers? Also, what other issues should I be aware of. What sort of testing regime do you do?
Thanks,
Adrian
Last edited by Vivo on Wed Jun 28, 2006 6:51 pm, edited 1 time in total.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Adrian,
Yes, you are right, rectangle tool wasn't defined. However we have recently fixed this as you can read in this message. Here you'll find the instructions to solve this and some code on how to use TeeChart tools in VC++ applications.
There won't be any compatibilty issues as we are specially concerned on keeping TeeChart being backward's compatible. To upgrade to v7.0.0.8, at least, you should unregister existing TeeChart7.ocx and register the new one. The easiest way is uninstalling existing one using the binary installer and install latest version. Also, you'll find v7 ActiveX version release notes here, so that you can check what is being changed in each release.
Yes, you are right, rectangle tool wasn't defined. However we have recently fixed this as you can read in this message. Here you'll find the instructions to solve this and some code on how to use TeeChart tools in VC++ applications.
However, for reference, what compatibility issues are there if I were to upgrade to 7.0.0.8, and would I just do the Project->Add To Project->Components and Controls->TeeChart Pro Activex control v7 on the newly installed TChart to update the wrappers? Also, what other issues should I be aware of. What sort of testing regime do you do?
There won't be any compatibilty issues as we are specially concerned on keeping TeeChart being backward's compatible. To upgrade to v7.0.0.8, at least, you should unregister existing TeeChart7.ocx and register the new one. The easiest way is uninstalling existing one using the binary installer and install latest version. Also, you'll find v7 ActiveX version release notes here, so that you can check what is being changed in each release.
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 |
Yeah, I saw that one, but I cannot easily use a CRectangle if that wrapper class does not exist. Would you be able to pass me the missing wrapper classes to me?Yes, you are right, rectangle tool wasn't defined. However we have recently fixed this as you can read in this message. Here you'll find the instructions to solve this and some code on how to use TeeChart tools in VC++ applications.
Thanks,
Adrian
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Adrian,
As told in the message I pointed, the classes are available at our attachments newsgroups. However, I've already sent them to your forums contact e-mail address.
As told in the message I pointed, the classes are available at our attachments newsgroups. However, I've already sent them to your forums contact e-mail address.
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 |
Hi Narcís,
Additionally, if I use tchart.GetTools().Add(tcRectangle) a First-chance exception is thrown (0xe06d7363). So I do not think this is going to work anyway.
Oh, and I have discovered that my email address is not correct. I've corrected it now. (Had an extra letter in there. )
I've also tried to use
as described in that other post but although it shows up, it does not move when I move that axis around.
Thanks,
Adrian
Additionally, if I use tchart.GetTools().Add(tcRectangle) a First-chance exception is thrown (0xe06d7363). So I do not think this is going to work anyway.
Oh, and I have discovered that my email address is not correct. I've corrected it now. (Had an extra letter in there. )
I've also tried to use
Code: Select all
CTChart& tchart = GetTChart();
CToolList & tools = tchart.GetTools();
CAxis & axis = tchart.GetAxis().GetCustom(m_AxisIds[index]);
m_ColourBand = tools.Add(tcColorband);
CColorBandTool & colourBand = tools.GetItems(m_ColourBand).GetAsColorband();
VARIANT iAxis;
iAxis.vt = VT_DISPATCH;
iAxis.pdispVal = axis;
colourBand.SetAxis(iAxis);
Thanks,
Adrian
Last edited by Vivo on Thu Jun 29, 2006 2:24 pm, edited 1 time in total.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Adrian,
Have you tried using the classes I've just sent you?
Have you tried using the classes I've just sent you?
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 Adrian,
Ok, I've forwarded my previous e-mail to the corrected address. Can you please test if they work at your end?
Ok, I've forwarded my previous e-mail to the corrected address. Can you please test if they work at your end?
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 Adrian,
Could you finally solve this issue using the files I sent?
Could you finally solve this issue using the files I sent?
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 |
No, as I said before:Could you finally solve this issue using the files I sent?
However, I was able to get the handle to the Device Context and was able to implement my own semi-transparent rectangle.Additionally, if I use tchart.GetTools().Add(tcRectangle) a First-chance exception is thrown (0xe06d7363). So I do not think this is going to work anyway.
Thanks,
Adrian