Bars in Grayscale

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Oli
Newbie
Newbie
Posts: 42
Joined: Fri Jan 13, 2012 12:00 am

Bars in Grayscale

Post by Oli » Sun Mar 25, 2012 12:13 pm

Hi,

I am trying to apply grayscale to a bar graph. My code based on a previous discussion in this forum, but it seems something is wrong.

Dim Plotpalette As Steema.TeeChart.Styles.PaletteStyles = PaletteStyles.GrayScale
Steema.TeeChart.Themes.ColorPalettes.ApplyPalette(tChartPreview.Chart, Plotpalette)
For Me.i = 0 To tChartPreview.Series.Count - 1
tChartPreview(i).Color = Plotpalette(i)
Next

I would appreciate any help to change the color palette to grayscale for a bar graph.

Oli

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

Re: Bars in Grayscale

Post by Narcís » Mon Mar 26, 2012 12:10 pm

Hi Oli,

Code snippet below works fine for me here using latest TeeChart .NET 2012 release.

Code: Select all

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Dim bar1 As New Steema.TeeChart.Styles.Bar(TChart1.Chart)
        bar1.FillSampleValues()
        bar1.ColorEach = True

        Steema.TeeChart.Themes.ColorPalettes.ApplyPalette(TChart1.Chart, Steema.TeeChart.Themes.Theme.GrayscalePalette)
    End Sub
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

Oli
Newbie
Newbie
Posts: 42
Joined: Fri Jan 13, 2012 12:00 am

Re: Bars in Grayscale

Post by Oli » Tue Mar 27, 2012 9:12 pm

Thanks Narcis, your code works fine...my code was faulty.

Oli

Post Reply