示例#1
0
        public ChartJsoptions GetOptions()
        {
            ChartJsoptions        chartoptions = new ChartJsoptions();
            ChartJSoptionsScalesY yAxes        = new ChartJSoptionsScalesY();

            yAxes.ticks.beginAtZero = true;
            chartoptions.scales.yAxes.Add(yAxes);
            chartoptions.title.display = true;
            return(chartoptions);
        }
示例#2
0
        public ChartJsoptions GetOptions(DSoptions _options)
        {
            ChartJsoptions chartoptions = new ChartJsoptions();


            if (_options.Mode == "Synergy" || _options.Mode == "AntiSynergy")
            {
                ChartJsoptionsradar radaroptions = new ChartJsoptionsradar();
                radaroptions.title.text      = _options.Mode + " " + _options.Time;
                radaroptions.legend.position = "bottom";
                if (_options.Player == true)
                {
                    radaroptions.title.text = "Player " + radaroptions.title.text;
                }
                chartoptions = radaroptions;
            }
            else
            {
                ChartJsoptionsBar baroptions = new ChartJsoptionsBar();
                chartoptions = baroptions;

                ChartJSoptionsScalesY yAxes = new ChartJSoptionsScalesY();
                string startdate            = _options.Startdate.ToString("yyyy-MM-dd");
                string enddate = _options.Enddate.ToString("yyyy-MM-dd");
                if (_options.Enddate == DateTime.MinValue)
                {
                    enddate = DateTime.UtcNow.ToString("yyyy-MM-dd");
                }
                yAxes.scaleLabel.labelString = "% - " + startdate + " - " + enddate + " - " + IsDefaultFilter(_options);
                if (_options.BeginAtZero == true)
                {
                    yAxes.ticks.beginAtZero = true;
                }

                if (_options.Mode == "Timeline")
                {
                    baroptions.elements.point = new ChartJSoptionsElementsPoint();
                }

                chartoptions.scales.yAxes.Add(yAxes);
            }

            chartoptions.title.display = true;
            chartoptions.title.text    = _options.Mode + " " + _options.Time;
            if (_options.Player == true)
            {
                chartoptions.title.text = "Player " + chartoptions.title.text;
            }
            return(chartoptions);
        }