Skip to content

SetPalette Method

See also: ChartAppearance Object

Description

Sets the palette of the chart series styles.

Syntax

Public Sub SetPalette(ByVal Name As String)

Parameters

  • Name (String)
    Name of the palette to set.

The current pre-set palettes include: - Victorian - Vibrant Pastel - Vibrant - Tropical - Summer - Spring Time - Rainbow - Purple - Primary Colors - Postmodern - Photodesign - Pastel - Office - Orange Green - Nature - Natural - Impresionism - Illustration - Harvest - Green Brown - Green Blue - Green - Gray - Four Color - Fire - Earth Tone - Danville - Caribbean - Cappuccino - Blue Gray - Blue

Remarks

This method loads a pre-set palette for the chart series to use. Palettes affect the colors of the series and legend, but don't affect the actual chart data or layout.

Below are examples of the same chart using two different palettes ("Postmodern" and "Photodesign"). Note how only the series and legend are affected:

Postmodern palette example

Photodesign palette example

Example

Dim AppearanceList
Dim AppearanceIndex As Long

Dim PaletteList
Dim PaletteIndex As Long

AppearanceList = Array("Nature", "Black", "Gray")
AppearanceIndex = 0

PaletteList = Array("Victorian", "Vibrant Pastel", "Vibrant", "Tropical", "Summer", "Spring Time", "Rainbow", "Purple", "Primary Colors", _
"Postmodern", "Photodesign", "Pastel", "Office", "Orange Green", "Nature", "Natural", "Impresionism", "Illustration", "Harvest", _
"Green Brown", "Green Blue", "Green", "Gray", "Four Color", "Fire", "Earth Tone", "Danville", "Caribbean", "Cappuccino", "Blue Gray", "Blue")

PaletteIndex = 9

ActiveChartControl.Content.Appearance.SetAppearance AppearanceList(AppearanceIndex)
ActiveChartControl.Content.Appearance.SetPalette PaletteList(PaletteIndex)

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.