Q6001019. Creating color palettes for ChartFX for .NET

The information on this article applies to
Summary
This article describes how to create color palettes for use in any ChartFX for .NET product. To create a palette you will have to create a txt file that follows our color palette syntax, compile this palette (or multiple palettes) into a .resources file and finally you will have to set this palette using the Palette property.

Palette Syntax
A color palette is a text file composed by a physical palette (a list of 49 RGB colors) followed by one or more logical palettes (a list of indexes in the physical palette that specifies the default settings for series, labels, axes, etc.), any line that starts with a semicolon is considered a comment and ignored by our parser.

R0,G0,B0
R1,G1,B1
...
R48,G48,B48
SubPaletteName.
S0
S1
...
S15
Background
Alternate Background (used in gradients)
Inside
Border
AxesAndGridLines
Axes Alternate (used in Interlaced mode)
ConstantLines
Stripes
Labels
PointLabels
MarkerBorder
TitlesText
Legend
LegendBackground
DataEditorBackground (background of the cells in the data editor)
DataEditorText
DataEditorAlternateBackground
DataEditorAlternateText
DataEditorTitlesBackground
DataEditorTItlesText
DataEditorGridLines
DataBackgound (background of the data editor)

Note that

Predefined logical colors

; 255 Transparent;
; 254 SystemColors.Window
; 253 SystemColors.Control
; 252 SystemColors.ControlDark
; 251 SystemColors.WindowText
; 250 SystemColors.ControlText
; 249 SystemColors.ControlLight
; 248 SystemColors.ControlLightLight
; 247 SystemColors.ControlDarkDark
; 246 SystemColors.Caption
; 245 SystemColors.CaptionText

Compiling the palettes
To compile one or more palettes into a resources file you will need a tool called CfxResPkg as follows

CfxResPkg PaletteFileName.resources User1.pal [User2.pal User3.pal]

Note that the palette files should have a pal extension and that a resource file may contain more than one palette.

Using the palette
To use one of your palettes you will use the Palette property as follows

chart1.Palette = "PhysicalPath | PaletteName | SubPalette"

where

- PhysicalPath is the fully qualified name of the palette file.
- PaletteName is the name of the palette (including the pal extension).
- SubPalette is the name of the subpalette defined inside the pal file.

e.g.

chart1.Palette = "C:\\Temp\\User.resources|User.Pal|Yellows"

Related Articles
Q6001043 How to change the line color for a selected series while the markers keep the original series color
Q6002027 Color displayed incorrectly in the UI for the Stripe Object
Q6002126 Setting BorderColor for ‘All Series’ using the run-time property dialog is ignored
Q6002138 Adding a custom palette to the chart causes Property dialog to crash
Q6002193 Alternate color for an interlaced grid is ignored

Download
Use the following links to download additional files. We recommend you maintain the directory structure when uncompressing ZIP files

Download User.pal
Sample Palette file

FTP Mirror Site Location File(s)
ModernWorld Europe (UK) User.pal
SFX Korea Asia (Korea) User.pal
Interland USA User.pal


ArticleID:Q6001019
Keywords:
Reviewed:5/31/2002 2:16:00 PM

DISCLAIMER INFORMATION:
Information in this document is subject to change without notice and does not represent a commitment on the part of Software FX, Inc. The software, which includes the information contained in any databases, described in this document is furnished under a license agreement or nondisclosure agreement. The software may be used or copied only in accordance with the terms of those agreements. It is against the law to copy the software on any medium except as copy of the software for backup purposes. No part of this article may be reproduced or transmitted in any form or by any means including recording, or information storage and retrieval systems, for any purpose other than the purchaser's personal use, without the express written permission of Software FX, Inc.

Software FX, Inc. disclaim all warranties, either express or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to the instructions contained in this article.

In no event shall Software FX, Inc. be liable for any damages whatsoever including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss, even if Software FX, Inc. has been advised of the possibility of such damages. Because some states do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.