how to set top axis in horizontal graph

TeeChart for ActiveX, COM and ASP
Post Reply
Aravind
Newbie
Newbie
Posts: 75
Joined: Fri Nov 15, 2002 12:00 am

how to set top axis in horizontal graph

Post by Aravind » Thu Aug 10, 2006 3:01 pm

i am converting bar graph into horizontal graph

1.for bar graph i have left axis and bottom axis
but for horizontal axis i need top axis and left axis .. i
how can i set ?


2. and also for horizontal graph i need the scale to be start from the top i,e.,
o on top and max value on bottom (right now i am getting on on the bottom and max value on the top )


pls advise me
aravind

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Aug 11, 2006 9:54 am

Hi aravind,

you can do :

Code: Select all

Private Sub Command1_Click()
TChart1.ChangeSeriesType 0, scHorizBar
TChart1.Series(0).VerticalAxis = aRightAxis
TChart1.Series(0).HorizontalAxis = aTopAxis
TChart1.Axis.Right.Inverted = True
End Sub

Aravind
Newbie
Newbie
Posts: 75
Joined: Fri Nov 15, 2002 12:00 am

how to bring marks front in Stacked Bar graph

Post by Aravind » Fri Aug 11, 2006 9:59 am

when i draw the stacked bar graph, marks are hiding behing the bar ..? is there any way can i bring front ..?
how to bring marks front in Stacked Bar graph ?

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Aug 11, 2006 11:00 am

Hi Aravid,

yes, we're aware of this, it's already down our bug/wish list to be considered for further releases. In the meantime you can use IAnnotation Tools instead (this code will need touching up):

Code: Select all

Private Sub Form_Load()
TeeCommander1.Chart = TChart1
With TChart1
    .Aspect.View3D = False
    .AddSeries scBar
    .AddSeries scBar
    .AddSeries scBar
    For i = 0 To .SeriesCount - 1
        For j = 1 To 15
            .Series(i).AddXY j, Rnd * 100, "", clTeeColor
            .Tools.Add tcAnnotate
        Next j
       .Series(i).Marks.Visible = False
       .Series(0).asBar.MultiBar = mbStacked

    Next i
    .Environment.InternalRepaint
End With
End Sub

Private Sub TChart1_OnAfterDraw()
With TChart1
    For i = 0 To .SeriesCount - 1
        For j = 1 To 15
            With .Tools.Items((i * 15) + (j - 1)).asAnnotation
                .Shape.Color = RGB(255, 255, 230)
                .Shape.ShadowSize = 0
                .Shape.CustomPosition = True
                .Shape.Left = TChart1.Series(i).CalcXPos(j - 1)
                .Shape.Top = TChart1.Series(i).CalcYPos(j - 1) - 35
                .Text = Round(TChart1.Series(i).YValues.Value(j - 1), 2)
            End With
            .Tools.Items((i * 15) + (j - 1)).Active = True
            .Canvas.Pen.Color = vbWhite
            .Canvas.MoveTo TChart1.Series(i).CalcXPos(j - 1) +
..Series(i).asBar.BarWidth / 2, TChart1.Series(i).CalcYPos(j - 1)
            .Canvas.LineTo TChart1.Series(i).CalcXPos(j - 1) +
..Series(i).asBar.BarWidth / 2, TChart1.Series(i).CalcYPos(j - 1) - 18

        Next j
    Next i
End With
End Sub

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Aug 11, 2006 11:05 am

Hi aravind,

I mistake me here, this problem has been fixed in the latest TeeChart Pro v7 version (it works fine here).

Post Reply