TeeChart for ActiveX, COM and ASP
-
Shurik
- Newbie
- Posts: 4
- Joined: Thu Oct 31, 2002 5:00 am
Post
by Shurik » Tue Feb 08, 2005 5:16 pm
Hello,
Using Version 5.03
Trying to display 2 stacked horizontal bars and scPoint series
Code: Select all
...
'adding the first horizontal bar
.AddSeries scHorizBar
.Series(0)DataSource=rs
.Series(0).XValues.ValueSource=rs.Fields(1).Name)
....
'here adding another horizontal bar
....
'trying to add scPoint "fails"
.AddSeries scPoint
.Series(2).DataSource=rs
.Series(2).YValues.ValueSource=rs.Fileds(3).Name
...
What happens after I add scPoint is that it "pushes" the two horizontal bars down instead of being plotted nicely "next" them.
In other words I get something similar to
*
*
*
--------
-------
--------
instead of
-------- *
------ *
---------- *
Is there away around it?
Thanks in advance,
Shurik.
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Fri Feb 11, 2005 3:38 pm
Hello Shurik,
The only way I can think of doing this is as in the code below. Stacking the Horizontal Bar series and populating the Point series as if it was a vertical point line and adding the stacked bars values to it's values.
Code: Select all
Private Sub Form_Load()
Dim i As Integer
With TChart1
'adding the first horizontal bar
.AddSeries scHorizBar
.Series(0).FillSampleValues 10
.Series(0).Marks.Visible = False
'here adding another horizontal bar
.AddSeries scHorizBar
.Series(1).FillSampleValues 10
.Series(1).Marks.Visible = False
.Series(0).asHorizBar.MultiBar = mbStacked
'adding the point series
.AddSeries scPoint
'populating the point series to have the stacked "feeling"
For i = 0 To .Series(0).Count - 1
.Series(2).AddXY .Series(0).XValues.Value(i) + _
.Series(1).XValues.Value(i) + _
Rnd(100) * 1000, i, "", vbYellow
Next
.Series(2).Marks.Visible = True
.Series(2).Marks.Style = smsXValue
TChart1.Aspect.ApplyZOrder = False
End With
End Sub
-
Shurik
- Newbie
- Posts: 4
- Joined: Thu Oct 31, 2002 5:00 am
Post
by Shurik » Mon Feb 14, 2005 3:47 pm
Narcís,
That's exactly what I needed.
Thanks a lot again,
Shurik.