I am working on an application that graphs time-based data stored in a file. Each file can have up to 5 data sets that can be graphed. The application itself can render up to 10 of these files (so it's possible for 50 graphs to be rendered on screen).
Since there could possibly be several graphs on screen-- they are line graphs, by the way-- I am looking to provide a way for users to select the color of each of the 50 possible line graphs.
I already have the user interface that will provide a simple way for users to do that. The problem is that I can't come up with an elegant way to store the color information for each of the 50 possible line graphs (persistent storage, by the way).
What I've tried so far is storing each of the 50 line color choices in an application settings file (e.g., the Properties.Settings.Default
namespace). Unfortunately, there are 50 settings and they're all named sequentially, e.g. File1DataSet1Color
, File1DataSet2Color
, File1DataSet3Color
, File1DataSet4Color
, File1DataSet5Color
, File2DataSet1Color
, and so on. This, unfortunately, makes for some exceptionally long and repetitive graph rendering code.
So my question is this: what is an elegant solution for persistent storage of color settings for 50 line graphs, which doesn't result in brittle or repetitive code in my rendering code?