Login Page - Create Account

Support Board


Date/Time: Tue, 10 Feb 2026 17:27:26 +0000



Post From: How can a DataColor array be reset in ACSIL

[2025-12-27 19:10:43]
curious16 - Posts: 35
Sorry for not explaining this more clearly. Of course all bar indices need to be set when DataColor is initialized and used.

When you first initialize a subgraph, the associated DataColor array is unset, and the color of each point on the subgraph is defined either by PrimaryColor or (if SecondaryColor is used) by SecondaryColor. If you check sc.Subgraph[k].DataColor.GetArraySize() in this uninitialized state, you get array size zero.

To start using the DataColor array, you set at least one element (typically that is DataColor[0] but it could be any element). This initializes the DataColor array and maintains it at the same size as the Subgraphs in the study. As soon as the DataColor array is initialized, it is used for all points while PrimaryColor & SecondaryColor are ignored. This is all perfectly fine as long as you want to use DataColor and have per-point color data.

The problem arises when you change the source of the Subgraph from one that has DataColor information to another one that does not. What you would like to do in this situation is to unset (de-allocate) the DataColor array and revert back to using PrimaryColor & SecondaryColor. However, I did not find a way to do that. A full redraw and reload of the study did not work. I tried to call the DataColor.ResetMembers() method and checked in the debugger. Immediately after calling this, the size of DataColor shrunk to zero, but it subsequently was again established at the previous size. The only thing that worked is to close and reopen the chartbook with this study which obviously is not a desirable scenario. There is another place where SC stores the information whether the DataColor array associated to a subgraph was initialized, and this information seems not to be reset when the ResetMembers() method is called. It would be helpful if the ResetMembers() method was really switching back to using the standard PrimaryColor & SecondaryColor properties.