Re: Different background colors on line chart



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
>


.



Relevant Pages

  • Chart combines values to fit
    ... I have a line chart with many datapoints. ... If I want to plot monthly data for 36 months, OWC plots the first point ... force OWC to display EVERY datapoint, even if it wont fit prettily? ...
    (microsoft.public.office.developer.web.components)
  • Re: column chart with logarithmic scaling
    ... >> chart. ... During this time Excel ... The only reliable way I have found is to display a modal dialog ... >> The only problem I see with owc relates to compatibility. ...
    (microsoft.public.office.developer.web.components)
  • Different background colors on line chart
    ... I just discovered the Office Web Components to use them for plotting ... Say that I want to display the properties of an object over a certain ... This would be done by displaying a few lines in the chart, ... different background colors for each location. ...
    (microsoft.public.office.developer.web.components)
  • Cant bind spreadsheet to chart on Visual Basic form
    ... program to display an OWC11 Excel spreadsheet and chart on a form. ... have been using some example code from Alvin Bruney's "Microsoft OWC ...
    (microsoft.public.office.developer.web.components)
  • Re: column chart with logarithmic scaling
    ... My add-in is supposed to work with excel 2000 and later ... Is OWC always installed or can the user unselect it during ... They can crack the OWC chart code open and find the assumptions. ... >> The Microsoft Office Web Components Black Book with .NET ...
    (microsoft.public.office.developer.web.components)