Пример #1
0
    private void CreateLegend(int length)
    {
        Panel firstColumn  = new Panel();
        Panel secondColumn = new Panel();

        LegendHolder.Controls.Add(firstColumn);
        LegendHolder.Controls.Add(secondColumn);
        for (int i = 0; i < length; i++)
        {
            Panel cell     = new Panel();
            Panel colorDiv = new Panel();
            colorDiv.CssClass  = "colorDiv";
            colorDiv.BackColor = PaletteHelper.GetCommonPalletePointColor(i);
            LiteralControl text = new LiteralControl(GetPointName(i));
            cell.Controls.Add(colorDiv);
            cell.Controls.Add(text);
            if (i % 2 == 0)
            {
                firstColumn.Controls.Add(cell);
            }
            else
            {
                secondColumn.Controls.Add(cell);
            }
        }
    }