示例#1
0
        public static ChartJScolorhelper GetChartColorFromLabel(string cmdr)
        {
            string             cmdr_col = DSdata.CMDRcolor[cmdr];
            Color              color    = ColorTranslator.FromHtml(cmdr_col);
            string             temp_col = color.R + ", " + color.G + ", " + color.B;
            ChartJScolorhelper col      = new ChartJScolorhelper();

            col.backgroundColor      = "rgba(" + temp_col + ", 0.5)";
            col.borderColor          = "rgba(" + temp_col + ",1)";
            col.barborderColor       = "rgb(255, 0, 0)";
            col.pointBackgroundColor = "rgba(" + temp_col + ", 0.2)";
            return(col);
        }
示例#2
0
        public static ChartJScolorhelper GetChartColor_bak(int myi)
        {
            string temp_col;

            if (myi == 1)
            {
                temp_col = "26, 94, 203";
            }
            else if (myi == 2)
            {
                temp_col = "203, 26, 59";
            }
            else if (myi == 2)
            {
                temp_col = "203, 26, 59";
            }
            else if (myi == 3)
            {
                temp_col = "47, 203, 26";
            }
            else if (myi == 4)
            {
                temp_col = "26, 203, 191";
            }
            else if (myi == 5)
            {
                temp_col = "203, 26, 177";
            }
            else if (myi == 6)
            {
                temp_col = "203, 194, 26";
            }
            else
            {
                temp_col = "72, 69, 9";
            }

            ChartJScolorhelper col = new ChartJScolorhelper();

            col.backgroundColor      = "rgba(" + temp_col + ", 0.5)";
            col.borderColor          = "rgba(" + temp_col + ",1)";
            col.pointBackgroundColor = "rgba(" + temp_col + ", 0.2)";
            return(col);
        }
示例#3
0
        public ChartJScolorhelper GetRandomChartColor()
        {
            Random rnd = new Random();

            string temp_col = "50, 51, 0";

            if (mycolorPool.Count() > 0)
            {
                int iCol = rnd.Next(0, mycolorPool.Count());
                temp_col = mycolorPool[iCol];
                mycolorPool.RemoveAt(iCol);
            }
            ChartJScolorhelper col = new ChartJScolorhelper();

            col.backgroundColor      = "rgba(" + temp_col + ", 0.5)";
            col.borderColor          = "rgba(" + temp_col + ",1)";
            col.barborderColor       = "rgb(255, 0, 0)";
            col.pointBackgroundColor = "rgba(" + temp_col + ", 0.2)";
            return(col);
        }
示例#4
0
        public static ChartJScolorhelper GetChartColor(int myi)
        {
            string temp_col;

            if (myi == 1)
            {
                temp_col = "0, 0, 255";
            }
            else if (myi == 2)
            {
                temp_col = "204, 0, 0";
            }
            else if (myi == 2)
            {
                temp_col = "0, 153, 0";
            }
            else if (myi == 3)
            {
                temp_col = "204, 0, 153";
            }
            else if (myi == 4)
            {
                temp_col = "0, 204, 255";
            }
            else if (myi == 5)
            {
                temp_col = "255, 153, 0";
            }
            else if (myi == 6)
            {
                temp_col = "0, 51, 0";
            }
            else if (myi == 7)
            {
                temp_col = "0, 101, 0";
            }
            else if (myi == 8)
            {
                temp_col = "0, 151, 0";
            }
            else if (myi == 9)
            {
                temp_col = "0, 251, 0";
            }
            else if (myi == 10)
            {
                temp_col = "0, 51, 50";
            }
            else if (myi == 11)
            {
                temp_col = "0, 51, 100";
            }
            else if (myi == 12)
            {
                temp_col = "0, 51, 150";
            }
            else if (myi == 13)
            {
                temp_col = "0, 51, 200";
            }
            else if (myi == 14)
            {
                temp_col = "0, 51, 250";
            }
            else if (myi == 15)
            {
                temp_col = "50, 51, 0";
            }
            else
            {
                temp_col = "102, 51, 0";
            }

            ChartJScolorhelper col = new ChartJScolorhelper();

            col.backgroundColor      = "rgba(" + temp_col + ", 0.5)";
            col.borderColor          = "rgba(" + temp_col + ",1)";
            col.barborderColor       = "rgb(255, 0, 0)";
            col.pointBackgroundColor = "rgba(" + temp_col + ", 0.2)";
            return(col);
        }