# Customization of Graph Colors

You can change the color used for a data point, curve or bar on a graph by right clicking on it in the graph, or on its corresponding item in the key, and selecting Change Series Color... on the right-mouse context menu. This brings up the following dialog.

Select a new color and press OK and the color far that data series will use the new color.

## Designing a Color Series

From the Change Color Series dialog, you can view the current series of colors.

In the top left half, you can see the current sequence of key labels and colors. The labels for your current color dimension display, allowing you to see which color is used for each label. You can select a label, select a new color for it on the left, then select another label and repeat. Once you have the series as you like it, press OK.

If you leave the radio button at To this graph only, your changes apply only to the current graph. The graph of other variables will be unaffected. If you love your color series, you may want to use the radio button to use it As the default for all graphs. If you do that, all other graphs in your model will use this color series, except of course, those graphs where you've customized the colors.

## Undoing customizations

If you've customized the color series for a particular graph, and you decide you don't like it and want to go back to using the model default, click the As the default for all graphs. It will ask you whether you want reset your customized colors to use the default, which you do, so you'll answer Yes. Your color customization for the graph will be deleted.

## Color Templates

If you create a color scheme that you really like and want to reuse not just for a particular index, you can include it in a Graph Style Template. You can also include other style options from the Graph Setup dialog in the template. You can then apply the template from the Graph Setup dialog to other graphs.

To include a color scheme in a template:

1. Display a graph with the Key index.
2. Double-click the graph to open the Graph Setup dialog.
3. From the bottom of that dialog, select a Style Template] from the pulldown menu. Or if you are starting a template, select New Template and enter a name for the template. Press Set Template button to start using this template for this graph.
1. Right-click on a curve, bar, data point, or item in the Key and select Change Series Color....
2. Select the colors you want for the items in the Key.
3. Select the third radio button and click OK to include these colors in the current template.

Now any graph using this template will use these colors. It won't affect graphs that don't use this template.

## Color Associations

It is helpful to maintain a consistent color scheme throughout your model. You may have specific colors in mind for particular items that show up in your key, and you want to keep these consistent throughout your model. For example, for you may want to always use Yellow for Energy_technology="Solar", black for "Coal", blue for "Hydroelectric", red-orange for "Geothermal", and cyan for "Natural gas". These don't apply to every graph, and not even to every pivot of the same graph, you want to use these colors for these items.

To accomplish this, you can associate a color sequence with an index. In this example, you define a color sequence for the Energy_technology index. You do this by selecting the following radio button:

Once you've associated a color series with an index, the same colors are used in any graph in the model that uses this index as the color key. Also, if the index is a slicer for the graph and there is no other color key, it will determine the color of the curve displayed. Hence, you'll see a consistent coloration for the items in this index across the whole model.

## Using colors from another index

Large models often have several indexes that contain many of the same values. For example, in a model of electric power plants, you might have an Index Energy_technology, containing 'Coal', 'Gas', 'Hydro', 'Wind', 'Solar' along with Indexes Renewable_technology containing 'Hydro', 'Wind', 'Solar' and Fossil_technology containing 'Coal', 'Gas'. Index Sorted_technology might contains all the labels in Energy_technology in a different order 'Wind', 'Solar', 'Hydro', 'Gas', 'Coal' sorted by increasing dispatch cost. It's helpful to your users to use consistent colors for each technology in graphs that use these indexes. For example 'Hydro' should always be blue, "Solar" yellow, and "Coal" black.

You can do this conveniently by specifying the color scheme you want for a superset Index that contains all the labels used by any of these overlapping Indexes -- in this case, Energy_technology contains all the technologies. You do this in the usual way: Display a graph using this Index in the Key. Right-click on a color in the Key or graph, and select Change series Color... as above. Make sure to select radio button Color sequence associated with Index Energy_technology before you click "OK".

Then, you can associate each of the other indexes, Renewable_technology, Fossil_technology, and Sorted_technology, with this superset index: For each subset index,

1. display a graph with that index as its key.
2. Right-click on a key value or curve, and select Change series Color... from the menu.
1. Now, select the radio button By using the colors of a superset index for Index <name>.
2. It immediately shows a dialog Select an Index that is a superset of <name>. Select the superset index for which you specified the general color scheme -- e.g. Energy_technology.
3. Click OK in the Index dialog to accept the superset index.
4. Click OK in the Change series Color... dialog to apply the relevant colors from the superset index.

Repeat this for each subset index to define tje associated superset. Any Graph that uses the subset index in its Key will now use the standard colors you set for the superset index for all key labels that it has in common. This also works if the subset actually contains all the values of the "superset", perhaps reordered, as in Sorted_technology. After associating a superset index in this way, any change to the color scheme of the superset will change the corresponding colors in any graph using a subset index.

If a "subset" index contains any labels not in its "superset" -- i.e. it isn't a perfect subset -- it will warn you, and use a default color for these labels.

## History of Change Color Series

The Change color series dialog was introduced around Analytica 4.3. Other features, including color associations, color templates, and using colors from another index were introduced in Analytica 4.6.