Page 1 of 1

scHorizBar + scPoint series displaying

Posted: Tue Feb 08, 2005 5:16 pm
by 6925467
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.

Posted: Fri Feb 11, 2005 3:38 pm
by narcis
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

Posted: Mon Feb 14, 2005 3:47 pm
by 6925467
NarcĂ­s,

That's exactly what I needed.
Thanks a lot again,

Shurik.