Пример #1
0
        private void SetChart()
        {
            cellClicked.HoldStrength = GameModel.CellsInView[cellClicked.ID].HoldStrength;

            List <Entry> entries = new List <Entry>
            {
                new Entry(GameModel.maxHoldStrength - cellClicked.HoldStrength)
                {
                    Color      = SKColor.Parse("#ffffff"),
                    Label      = "Remaining",
                    ValueLabel = (GameModel.maxHoldStrength - cellClicked.HoldStrength).ToString()
                },
                new Entry(cellClicked.HoldStrength)
                {
                    Color      = SKColor.Parse(ColorCode.BrightHexColorCode(cellClicked.TeamID)),
                    Label      = "Hold Strength",
                    ValueLabel = cellClicked.HoldStrength.ToString()
                },
            };

            DonutChart chart = new DonutChart()
            {
                Entries         = entries,
                HoleRadius      = 0.6f,
                BackgroundColor = SKColor.Parse("#202020")
            };

            donutChart.Chart = chart;
        }