Example #1
0
        public void SetCmdrPics(ChartJS chart)
        {
            if (chart.type != "bar")
            {
                return;
            }

            List <ChartJSPluginlabelsImage> images = new List <ChartJSPluginlabelsImage>();

            foreach (string lcmdr in chart.data.labels)
            {
                foreach (string cmdr in DSdata.s_races)
                {
                    if (lcmdr.StartsWith(cmdr))
                    {
                        ChartJSPluginlabelsImage myimage = new ChartJSPluginlabelsImage();
                        //myimage.src = "images/btn-unit-hero-" + cmdr.ToLower() + ".png";
                        myimage.src = "_content/sc2dsstats.shared/images/btn-unit-hero-" + cmdr.ToLower() + ".png";
                        images.Add(myimage);
                    }
                }
            }
            ChartJsoptionsBar opt = new ChartJsoptionsBar();

            opt = chart.options as ChartJsoptionsBar;
            opt.plugins.labels.images = images;
            chart.options             = opt;
        }
Example #2
0
 public ChartJSsorthelper(string label, double winrate, ChartJSPluginlabelsImage image, string color, string srace)
 {
     Label   = label;
     Winrate = winrate;
     Image   = image;
     Color   = color;
     s_race  = srace;
 }