I have a bar chart and would like to be able to assign a pattern to one or more bars in the chart at runtime using vb6. If I use .asBar.BarBrush.Style = bsBDiagonal then all the bars have the pattern but I can't figure out how to assign a given pattern to only one bar.
Thanks
I am using v6.0.0.5.
How do I add a pattern to only 1 bar in a bar chart
Hi,
using the latest TeeChart Pro v7.013, available at the private customers download page, you coud use similar code to the following :
using the latest TeeChart Pro v7.013, available at the private customers download page, you coud use similar code to the following :
Code: Select all
Private Sub TChart1_OnGetSeriesBarStyle(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, BarStyle As TeeChart.EBarStyle)
If ValueIndex = 1 Then
TChart1.Series(0).asBar.BarBrush.Style = bsBDiagonal
Else
TChart1.Series(0).asBar.BarBrush.Style = bsSolid
End If
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com
Dear Josep,
Kind thanks for your response. It is shame that there is no way to access any point of series and assign it individual properties rather than through events. Reason I say this is that I have built a small wrapper class around Tchart and don't necessarily want the behaviour via the event for all bar charts I draw. As a workaround in the meantime I plotted two bar series and got the behaviour I wanted by setting the bar I want patterned as AddNullXY and the second series only contains the patterned bar whilst all other in the second series are Null points.
Kind thanks for your response. It is shame that there is no way to access any point of series and assign it individual properties rather than through events. Reason I say this is that I have built a small wrapper class around Tchart and don't necessarily want the behaviour via the event for all bar charts I draw. As a workaround in the meantime I plotted two bar series and got the behaviour I wanted by setting the bar I want patterned as AddNullXY and the second series only contains the patterned bar whilst all other in the second series are Null points.