Volume series and color each

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Adrian
Advanced
Posts: 116
Joined: Thu Jun 23, 2005 4:00 am

Volume series and color each

Post by Adrian » Fri Nov 17, 2006 1:11 am

I have a volume series that I want to control the colour of each bar. I use the following

Code: Select all

 
'serVolume(iPoint).Color = System.Drawing.Color.FromName(row(ColourName))
serVolume.Colors(iPoint) = System.Drawing.Color.FromName(row(ColourName))
serVolume.ColorEach = True
Neither of these options sets the colour of each bar, they execute and the serVolume(iPoint).Color is set to the colour that I want however they are not drawn witht he correct colour. The following code will set the colours for all bars to that specified so I figure it's something to do with the coloureach setting

Code: Select all

serVolume.Color =  System.Drawing.Color.FromName(row(ColourName))
Also could you explain the difference between the two colouring options.

Code: Select all

 
'serVolume(iPoint).Color = System.Drawing.Color.FromName(row(ColourName))
serVolume.Colors(iPoint) = System.Drawing.Color.FromName(row(ColourName))
serVolume.ColorEach = True
It seems that on some series types the first option works and on others the second.

Thanks...
Adrian Heald
Captell Developments
www.captelldevelopments.com

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Nov 17, 2006 12:42 pm

Hi Adrian,

You are right, ColorEach is not working fine for volume series. This is a defect (TF02011902) which I've added to our bug list to be fixed for future releases.
Also could you explain the difference between the two colouring options.
The two calls are basically the same. You can check this using Lutz Roeder's .NET Reflector:
  • 1. Open Teechart.dll using reflector.
    2. Go to volume series at Steema.TeeChart.Styles.
    3. Open base types and go to the series class.
    4. Press Control + T and you will see a property called Steema.TeeChart.Styles.Series.Item[Int32] : SeriesXYPoint, which is "serVolume(iPoint)".
    5. Now with that property selected, hit the space bar and then click on SeriesXYPoint. This property only has the X and Y values.
    6. If you open the base type you can see it derives from Steema.TeeChart.Styles.SeriesPoint which has color.
    7. Now hit the space bar again with Color selected and you get:

    Code: Select all

    [Description("Indexed Point Color")]
    public Color Color
    {
          get
          {
                return this.series.Colors[this.index];
          }
          set
          {
                this.series.Colors[this.index] = value;
                this.series.Invalidate();
          }
    }
    8. Now let's go back to the volume series, back again to the Series class from the base type and to the Colors property. This is the same as serVolume.Colors(iPoint) so serVolume(iPoint).Color and serVolume.Colors(iPoint) is the same.
It seems that on some series types the first option works and on others the second.


Could you please send us any example you may have found where those two calls behave differently?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply