Horizontal Bar does not show values

TeeChart for ActiveX, COM and ASP
Post Reply
King Designs
Newbie
Newbie
Posts: 1
Joined: Wed Dec 10, 2003 5:00 am

Horizontal Bar does not show values

Post by King Designs » Thu Jun 17, 2010 5:19 pm

I have read posts about having to swap the X axis and the Y axis when adding data to the Horizontal Bar chart. But everything that I have tried has not worked. When I try to swap the values I get a "Type Mismatch" error.

Is there some type of setting that I need to initiate in order to allow a numeric value to be added to the vertical axis and a text string to be added to the horizontal axis? I have tried both .Add and .AddXY. Any specific examples would be great!

Thanks,

Vince King

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

Re: Horizontal Bar does not show values

Post by Yeray » Fri Jun 18, 2010 3:26 pm

Hi Vince King,

The difference is that, as horizontal bars are horizontal, the *length* of the bars are stored in the XValues array, while in the standard Bar series, these are stored in the YValues array.
But when you add your values with the Add method, it woks in the same way in both series. So this works fine:

Code: Select all

Private Sub Form_Load() 
  TChart1.Aspect.View3D = False
  
  TChart1.AddSeries scHorizBar
  
  Dim i As Integer
  For i = 0 To 4
    TChart1.Series(0).Add Rnd * 100, "value nº " + Str$(i), clTeeColor
  Next i
End Sub
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