Beispiel #1
0
        private int SetupPartNameAndColor(string[] partiesNames, int partyIndex)
        {
            string partyName   = partiesNames[partyIndex];
            int    colourIndex =
                PartyNameToColoursLookup.ContainsKey(partyName)
                    ? PartyNameToColoursLookup[partyName]
                    : partyIndex;

            return(colourIndex);
        }
Beispiel #2
0
        private void SetupPartiesSeries(string[] partiesNames, List <KeyValuePair <string, LineSeries> > partiesLineSeries)
        {
            for (int i = 0; i < partiesNames.Length; i++)
            {
                string partyName   = partiesNames[i];
                int    colourIndex =
                    PartyNameToColoursLookup.ContainsKey(partyName)
                        ? PartyNameToColoursLookup[partyName]
                        : i;

                OxyPlotUtilities.CreateLongLineSeries(
                    out LineSeries partyLineSeries,
                    ChartAxisKeys.DateKey,
                    ChartAxisKeys.PercentageListVotes,
                    partiesNames[i],
                    colourIndex,
                    128);

                partiesLineSeries.Add(
                    new KeyValuePair <string, LineSeries>(partiesNames[i], partyLineSeries));
            }
        }