Esempio n. 1
0
        private void PiePiece_MouseIn(PiePiece sender)
        {
            Panel.SetZIndex(sender, ElementToForegroundIndex);
            var curScope = Scopes[sender.EnumType];

            DiagramInfo.Clear();
            DiagramInfo.Header = curScope.EnumMember.ToString();

            foreach (var item in curScope)
            {
                DiagramInfo.Add(item.GetTotal.ToString("f2"), (item.GetTotal / curScope.Sum).ToString("p2"));
            }

            DiagramInfo.Add($"Total: {curScope.Sum:f2}", DiagramStatInfo.ColumnType.Data);
            DiagramInfo.Add($"Average: {curScope.Average(x => x.GetTotal):f2}", (curScope.Sum / Scopes.TotalSum).ToString("p2"));
        }
Esempio n. 2
0
        private void InitializePiePieces()
        {
            var generalVol = Scopes.TotalSum;
            var genAngle   = 0.0;

            for (int i = 0; i < Scopes.Count(); i++)
            {
                if (Scopes[i].Sum != 0)
                {
                    var angle    = Convert.ToDouble((Scopes[i].Sum * FullAngle) / generalVol);
                    var piePiece = new PiePiece(Scopes[i].EnumMember, angle, UsersBrushes[i]);
                    piePiece.MouseIn  += PiePiece_MouseIn;
                    piePiece.MouseOut += PiePiece_MouseOut;
                    piePiece.Rotate(genAngle);
                    genAngle += angle;
                    piePieces.Add(piePiece);
                    PiecesGrid.Children.Add(piePiece);
                }
            }
        }
Esempio n. 3
0
 private void PiePiece_MouseOut(PiePiece sender)
 {
     Panel.SetZIndex(sender, ElementToBachgroundIndex);
     ShowGeneralInfo();
 }