Page 1 of 1

Bars in Grayscale

Posted: Sun Mar 25, 2012 12:13 pm
by 15661292
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

Re: Bars in Grayscale

Posted: Mon Mar 26, 2012 12:10 pm
by narcis
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

Re: Bars in Grayscale

Posted: Tue Mar 27, 2012 9:12 pm
by 15661292
Thanks Narcis, your code works fine...my code was faulty.

Oli