Exemple #1
0
        /// <summary>
        /// Gets the legend.
        /// </summary>
        /// <param name="size">The size.</param>
        /// <param name="entries">The entries.</param>
        /// <param name="columnCount">The column count.</param>
        /// <returns></returns>
        public static Image GetLegend(Size size, string[] entries, int columnCount)
        {
            rand   = new Random(100);
            legend = SetUpLegend(size, columnCount);
            LegendEntryCollection lec = new LegendEntryCollection();

            for (int i = 0; i < entries.Length; i++)
            {
                lec.Add(new LegendEntry(GetRandomColor(), entries[i]));
            }
            legend.LegendEntryCollection = lec;
            LegendRenderer lr = new LegendRenderer();

            return(lr.DrawLegend(legend));
        }
Exemple #2
0
        /// <summary>
        /// Draws the legend.
        /// </summary>
        /// <param name="legend">The legend.</param>
        /// <returns></returns>
        public static Image DrawLegend(Legend legend)
        {
            LegendRenderer lr = new LegendRenderer();

            return(lr.DrawLegend(legend));
        }