OWC11 diferent bar color in the same serie

  • Thread starter Alhambra-Eidos Kiquenet
  • Start date
A

Alhambra-Eidos Kiquenet

Hello,

I like know if it's possible change the bar color in a same serie into
ChartSpace visual basic object

For example bar with name A set color green
bar with name B set color blue
....

thanks

My Code :

Dim nCount = 5
Dim xValues(nCount)
Dim yValues1(nCount)
Dim yValues2(nCount)

xValues(0) = "A"
xValues(1) = "B"
xValues(2) = "C"
xValues(3) = "D"
xValues(4) = "E"

yValues1(0) = 5186
yValues1(1) = 8955
yValues1(2) = 2055
yValues1(3) = 3075
yValues1(4) = 2866

yValues2(0) = 4661
yValues2(1) = 12254
yValues2(2) = 2562
yValues2(3) = 3558
yValues2(4) = 3064

Me.AxChartSpace1.Clear()
Me.AxChartSpace1.Refresh()

Dim oChart
oChart = AxChartSpace1.Charts.Add

oChart.HasTitle = True
oChart.Title.Caption = "Eleccions"

Dim chConstants
chConstants = AxChartSpace1.Constants

Dim oSeries
oSeries = oChart.SeriesCollection.Add
With oSeries
..Caption = "2006"
'.SetData(chConstants.chDimCategories, chConstants.chDataLiteral,
rsPrcl.Fields(0).name)
..SetData(1, -1, xValues)
'.SetData(chConstants.chDimValues, chConstants.chDataLiteral, yValues1)
..setData(2, -1, yValues1)
'.Type = chConstants.chChartTypeColumnClustered
..Type = chConstants.chChartTypeColumnClustered
..Interior.Color = RGB(192, 192, 192)
End With

End Sub


Regards for you.
 
A

Alvin Bruney [MVP]

actually code has been posted in here to handle this issue several times
over

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
 
A

Alhambra-Eidos Kiquenet

Top