how can i adjust width of the bar with respect to each serie

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

how can i adjust width of the bar with respect to each serie

Post by Aravind » Mon Sep 11, 2006 4:17 pm

How can i adjust the width of the bar with respect to each series and each bar

i want to have different bar widths in each series in each y value



i want to have different bar widths for each series in each y value
for example
i have 3 series ,a b & c in a bar graph

for a barwidth is kept 40
for b bar width is 30
for c bar width is 100
barwidth option changes for all values of y axis , i need to different bar widths for different y values

pls advise me
aravind

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

i have posted sample tee file

Post by Aravind » Mon Sep 11, 2006 4:23 pm

i have posted sample tee file in group

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Sep 12, 2006 8:45 am

Hi Aravind,

Have you tried setting the BarWidthPercent for each of the series? For example:

Code: Select all

    TChart1.Series(0).asBar.BarWidthPercent = 70
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

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

bar width for in a series

Post by Aravind » Tue Sep 12, 2006 12:58 pm

enclosing a bar graph with 3 bars drawn in it ( posted in newsgroup)

for example :

x values are 10 ,950,1350

bar plotted at x=10 should have size corresponding to its value

bar plotted at 950 should have 90% size ...

how to set differenct bar sizes in a series .....

thx
aravind

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Sep 12, 2006 2:53 pm

Hi Aravind,

Ok, now I understand what you are looking for. Then you can try doing something like this:

Code: Select all

Private Sub Form_Load()
    Me.TeeCommander1.Chart = Me.TChart1
    
    TChart1.Import.LoadFromFile "e:\temp\samplebargraph.tee"
    TChart1.Environment.InternalRepaint
End Sub

Private Sub TChart1_OnBeforeDrawSeries()
    With TChart1.Series(0)
        For i = 0 To .Count - 1
            .asBar.BarWidth = (.XValues.Value(i) / .XValues.Maximum) * 100
        Next
    End With
End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

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

Post by Aravind » Wed Sep 13, 2006 1:29 pm

bar width is changing but i have to insert my own calculations for bar width
if insert the below code , bar widths are not changing ..
With TChart1.Series(0)

For i = 0 To .Count - 1
Select Case i
Case 0
.asBar.BarWidth = 15
Case 1
.asBar.BarWidth = 35
Case 2
.asBar.BarWidth = 50
End Select
' .asBar.BarWidth = (.XValues.Value(i) / .XValues.Maximum) * 100

Next
End With

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

Post by Pep » Mon Sep 18, 2006 8:30 am

Hi Aravind,

I'm afraid there's no way to do this in the latest TeeChart Pro version, however it's on our wish list to be considered for the next releases.
In meantime a trick could be to use more than one Bar Series, each one with the desired barWidth.

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

can you give sample code to draw the trick

Post by Aravind » Thu Sep 21, 2006 11:46 am

can you give sample code to draw the trick

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

Post by Pep » Mon Sep 25, 2006 10:37 am

Hi,

you can do :

Code: Select all

Private Sub Form_Load()
With TChart1
    .AddSeries scBar
    .AddSeries scBar
    .AddSeries scBar
    
    .Series(0).Color = vbRed
    .Series(1).Color = vbRed
    .Series(2).Color = vbRed
    
    
    .Series(0).AddXY 0, 10, "", clTeeColor
    .Series(1).AddXY 1, 20, "", clTeeColor
    .Series(2).AddXY 2, 30, "", clTeeColor
    .Series(0).asBar.MultiBar = mbSideAll
    
    .Series(0).asBar.BarWidth = 15
    .Series(1).asBar.BarWidth = 35
    .Series(2).asBar.BarWidth = 50
    
    .Legend.LegendStyle = lsLastValues
End With
End Sub

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

Post by Aravind » Mon Sep 25, 2006 11:33 am

i need to set the widths of the first x value

for x=1 barwidth=10
for x=2 barwidth=30
for x=3 barwidth=100
not with respect to series
this is nothing but a carpetchart calculations ....

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Sep 25, 2006 1:47 pm

Hi Aravind,

You should create one bar series for each X value, SelfStack the series and set a different BarWidth for each of them:

Code: Select all

Private Sub Form_Load()
    For X = 0 To 3
        TChart1.AddSeries scBar
        TChart1.Series(X).asBar.MultiBar = mbSelfStack
        TChart1.Series(X).asBar.BarWidth = 15 + (15 * X)
        TChart1.Series(X).ColorEachPoint = True
        TChart1.Series(X).Marks.Visible = False
        
        For Y = 0 To 10
            TChart1.Series(X).AddXY X, Rnd, "", clTeeColor
        Next Y
    Next X
End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

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

still having problems with barwidth for mulitple series

Post by Aravind » Thu Sep 28, 2006 11:58 am

i have enclosed a sample chart in xls file need to draw this chart ..

in the x-axis i have plotted a.b.c with 5 series ...
i need to have for a bar width for all 5 series should be 77.7
for b it is 16.8 and for c it should be 5.4 ( i.e. for a i should give 70% width , b 16 % width and c 5% width) but now i can create equal bar width in tchart ...

the sample code which is given by you does not suite my requirement ... because values are not been plotted correctly and also coloring each series becomes a issue ... if i set color for series entire bar becomes same color which is not correct for us because for bar @a there is 5 series plotted ...

your code :
For X = 0 To 1
TChart1.AddSeries scBar
TChart1.Series(X).asBar.MultiBar = mbSelfStack
TChart1.Series(X).asBar.BarWidth = 15 + (15 * X)
TChart1.Series(X).ColorEachPoint = True
TChart1.Series(X).Marks.Visible = False

For Y = 0 To 2
TChart1.Series(X).AddXY X, Y, Y, clTeeColor
Next Y
Next X

need code to adjust barwidth for each position at x-axis ...

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Sep 28, 2006 2:44 pm

Hi Aravind,

I have posted an example at the newsgroups which creates a chart similar to your excel file.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

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

I Cannot able to find it could you pls send me to this email

Post by Aravind » Thu Sep 28, 2006 2:48 pm

I Cannot able to find it could you pls send me to this email asreenivasan@dtc-worldwide.com

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Sep 28, 2006 2:50 pm

Hi Aravind,

Yes, just forwarded the message to your address.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply