I have a form with an UltraChart that often has more than one line graphs on it concurrently. There is also an UltraDockManager on the form, with a panel that allows the user to select which series they want to show on the graph. When I hide one series and show it again, the icons seem to be chosen at random and re-selected every time the list of series displayed on the chart changes. I would like the legend icon and line color of a series to be the same each time a series is shown.
The chart's FillSceneGraph() event fires every time I check or uncheck one of the series on the graph. So I was thinking of saving the legend icons and line colors in lists or dictionaries the first time that FillSceneGraph() fires on an instance of the chart. Is this the best strategy? Or is there a simpler way to do this?
The legend icons always match up in color to the displayed lines. Are you saying that both are changing when you add/remove series? If so, you must have selected one of the random color models for your chart. You can change that to display fixed colors instead of random ones by using chart.ColorModel.ModelStyle property. Here's more about color models:http://help.infragistics.com/NetAdvantage/WinForms/2010.2/CLR2.0/?page=Chart_Assign_Custom_Colors_to_Chart_Elements.html
http://help.infragistics.com/NetAdvantage/WinForms/2010.2/CLR2.0/?page=Chart_Custom_Skins_and_Paint_Elements.html
The legend icons' colors always match the displayed lines'. The colors don't change; only the symbols do. I meant to say that the symbols change after unchecking and rechecking a series.