Sub AddBarColor(BD As BarData, Color As Int)
If BD.BarsColors.IsInitialized = False Then BD.BarsColors.Initialize
'the line below is taken from the add pie point method
If Color = 0 Then Color = Colors.RGB(Rnd(0, 255), Rnd(0, 255), Rnd(0, 255))
BD.BarsColors.Add(Color)
End Sub