Change individual column color in chart (OWC10)

J

Jason Chan

I would like to change the individual column color in column chart.
e.g in a chart with 10 columns, i want column 1, 3, 5, 7, 9 color in red,
and else color in blue

Anyone would point what object and property control the color on individual
coloumn.

I am developing a classic ASP pages using OWC10.

Telling me it is not possible to do would be helpful too.

Thanks in advance.

Jason Chan
 
A

Alvin Bruney [MVP - ASP.NET]

here is some example code excerpted from the black book


A sample implementation example




For our sample, we will attempt to color the individual bars according to a
set criteria.




Code-listing 2.14 Sample code to manipulate color




C# Snippet




for (int i = 0; i <
objCSpace.Charts[0].SeriesCollection[0].Points.Count;i++)

{

OWC10.ChInterior interior = objCSpace.Charts[0].SeriesCollection
[0].Points.Interior;




interior.SetTwoColorGradient
(OWC10.ChartGradientStyleEnum.chGradientDiagonalUp,

OWC10. ChartGradientVariantEnum.chGradientVariantCenter, "limegreen","red");

}




VB.NET Snippet




Dim i As Integer

For i = 0 To objCSpace.Charts(0).SeriesCollection(0).Points.Count- 1 Step i
+ 1

Dim interior As OWC10.ChInterior = objCSpace.Charts(0).
SeriesCollection(0).Points(i).Interior




interior.SetTwoColorGradient

(OWC10.ChartGradientStyleEnum.chGradientDiagonalUp,

OWC10. ChartGradientVariantEnum. chGradientVariantCenter, "limegreen","red")

Next





--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top