Re: Different background colors on line chart
- From: "Alvin Bruney [MVP - ASP.NET]" <www.lulu.com/owc>
- Date: Mon, 11 Apr 2005 18:29:30 -0400
yup, this is easy enough. You will find that the OWC is capable of a lot.
For instance, you can color each individual series like this. [This code was
lifted out of the black book page 97]
Code-listing 3.24 sample code to customize color
C# Snippet
for (int i = 0; i <
objCSpace.Charts[0].SeriesCollection[0].Points.Count;i++)
{
object val = (object)objCSpace.Charts[0]. SeriesCollection[0].
Points[i].GetValue
(OWC10.ChartDimensionsEnum.chDimValues, null);
if(Int32.Parse(val.ToString()) > 40)
objCSpace.Charts[0].SeriesCollection[0].Points[i]. Interior.Color = "red";
else if(Int32.Parse(val.ToString()) < 15)
objCSpace.Charts[0].SeriesCollection[0].Points[i]. Interior.Color =
"limegreen";
}
--
Regards,
Alvin Bruney - ASP.NET MVP
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
<mottebelke@xxxxxxxxxxx> wrote in message
news:1113230026.842996.126880@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I just discovered the Office Web Components to use them for plotting
> charts on a web page (C# .NET). It all seems very interesting and I
> definitly want to work with it. But there is one thing I want to know
> before hand.
>
> Say that I want to display the properties of an object over a certain
> time period. This would be done by displaying a few lines in the chart,
> where each point would be the value of that property on a certain time.
>
> This object also has a location property. Over the time it will move
> from location to location, and I want to display this by using
> different background colors for each location.
> Is this possible using OWC? Is there a way of setting different
> background colors for different areas of the chart? Or maybe by using
> bars for the location and lines for the other properties?
>
> I hope that someone knows this, and a little 'push' in the right
> direction would be appreciated.
>
>
> Tom
>
.
- References:
- Different background colors on line chart
- From: mottebelke
- Different background colors on line chart
- Prev by Date: Re: Alvyn's Book website
- Next by Date: Dropdown list using OWC11 in VB .Net
- Previous by thread: Different background colors on line chart
- Next by thread: Alvyn's Book website
- Index(es):
Relevant Pages
|