コード例 #1
0
 void AddPathToDictionary(Path path, PieSegment ps)
 {
     pathDictionary.Add(path, ps);
     path.MouseEnter += new MouseEventHandler(Path_MouseEnter);
     path.MouseMove  += new MouseEventHandler(Path_MouseMove);
     path.MouseLeave += new MouseEventHandler(PieControl_MouseLeave);
 }
コード例 #2
0
        void Path_MouseEnter(object sender, MouseEventArgs e)
        {
            piePopup.Visibility = Visibility.Visible;
            PieSegment seg = pathDictionary[sender as Path];

            popupData.Text = seg.Name + " : " + ((seg.Value / Data.GetTotal()) * 100).ToString("N2") + "%";
            Point point = Mouse.GetPosition(this);

            piePopup.Margin = new Thickness(point.X - piePopup.ActualWidth / 4, point.Y - (18 + piePopup.ActualHeight), 0, 50);
        }
コード例 #3
0
            protected override int ConvertFromSegment(PieSegment segment)
            {
                string strArg = (string)segment.Argument;

                if (!arguments.Contains(strArg))
                {
                    arguments.Add(strArg);
                }
                return(arguments.IndexOf(strArg));
            }
        private PieSegment CreatePieSegment(object argument, double value, object colorKey)
        {
            PieSegment segment = new PieSegment();

            segment.Argument = argument;
            segment.Value    = value;
            segment.Attributes.Add(new MapItemAttribute()
            {
                Name = "color", Value = colorKey
            });
            return(segment);
        }
コード例 #5
0
 private void AddPathToDictionary(Path path, PieSegment ps)
 {
     _pathDictionary.Add(path, ps);
     path.MouseEnter += Path_MouseEnter;
 }
コード例 #6
0
 protected override int ConvertFromSegment(PieSegment segment)
 {
     return(Array.IndexOf(categories, segment.Argument));
 }