How to use the ColorBand?

TeeChart for ActiveX, COM and ASP
Post Reply
Jerry
Newbie
Newbie
Posts: 1
Joined: Fri Nov 02, 2012 12:00 am

How to use the ColorBand?

Post by Jerry » Thu Nov 08, 2012 2:23 pm

Dear Steema support,

I want to add a colorband to my chart,my code as followed:

int m_nCurrentBand=GetTools().Add(tcColorband);
COleVariant colorBandAxis;
colorBandAxis.vt = VT_DISPATCH;
colorBandAxis.pdispVal = GetAxis().GetLeft().m_lpDispatch;
GetTools().GetItems(m_nCurrentBand).GetAsColorband().SetAxis(colorBandAxis);

but the error which says that an Invalid Axis type!



Any help will be appreciated!

Jerry

Yeray
Site Admin
Site Admin
Posts: 9587
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to use the ColorBand?

Post by Yeray » Fri Nov 09, 2012 3:51 pm

Hi Jerry,

I've just tried the following code with TeeChart ActiveX v2012.0.0.9 in VB6 and it works without problems.

Code: Select all

  TChart1.Aspect.View3D = False
  TChart1.AddSeries scFastLine
  TChart1.Series(0).FillSampleValues
  TChart1.Tools.Add tcColorband
  With TChart1.Series(0).YValues
    TChart1.Tools.Items(0).asColorband.Axis = TChart1.Axis.Left
    TChart1.Tools.Items(0).asColorband.StartValue = .Minimum + (.Maximum - .Minimum) / 4
    TChart1.Tools.Items(0).asColorband.EndValue = .Minimum + (.Maximum - .Minimum) / 2
  End With
Are you using the latest TeeChart ActiveX version?
If you still have problems with it, could you please arrange a simple example project we can run as-is to reproduce the problem here?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply