Beispiel #1
0
 /// <summary>
 /// 得到对象数据所占的百分比
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public Double GetItemPercent(PieChartItem item)
 {
     return(item.Value * 100 / TotalDataValue);
 }
Beispiel #2
0
 /// <summary>
 /// 得到对象数据所占的比例
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public Double GetItemScale(PieChartItem item)
 {
     return(item.Value / TotalDataValue);
 }
Beispiel #3
0
 /// <summary>
 /// Called to fire an ItemDoubleClicked event.
 /// </summary>
 /// <param name="item">The event arguments.</param>
 private void FireItemDoubleClicked(PieChartItem item)
 {
   if (ItemDoubleClicked != null)
     ItemDoubleClicked(this, new PieChartItemEventArgs(item));
 }
Beispiel #4
0
 /// <summary>
 /// Constructs a new instance.
 /// </summary>
 /// <param name="oldItem">The item that is losing focus.</param>
 /// <param name="newItem">The item that is gaining focus.</param>
 public PieChartItemFocusEventArgs(PieChartItem oldItem, PieChartItem newItem)
 {
   this.oldItem = oldItem;
   this.newItem = newItem;
 }
Beispiel #5
0
 /// <summary>
 /// Constructs a new instance.
 /// </summary>
 /// <param name="item">The item involved with an event.</param>
 public PieChartItemEventArgs(PieChartItem item)
 {
   this.item = item;
 }
Beispiel #6
0
 /// <summary>
 /// Called to fire an ItemFocusChanging event.
 /// </summary>
 /// <param name="oldItem">The item that was previously focused.</param>
 /// <param name="newItem">The item that is gaining focus.</param>
 private void FireItemFocusChanging(PieChartItem oldItem, PieChartItem newItem)
 {
   if (ItemFocusChanging != null)
     ItemFocusChanging(this, new PieChartItemFocusEventArgs(oldItem, newItem));
 }
Beispiel #7
0
    /// <summary>
    /// Set the currently focused PieChartItem.
    /// </summary>
    /// <param name="item">The item that currently has mouse focus.</param>
    private void SetFocusedItem(PieChartItem item)
    {
      if (item != this.FocusedItem)
      {
        FireItemFocusChanging(this.FocusedItem, item);
        this.focusedItem = item;
        FireItemFocusChanged();

        MarkVisualChange(true);
      }

      // check to see if the item has a tool tip and if it should be displayed
      if (this.FocusedItem != null && this.FocusedItem.ToolTipText != null && this.Style.ShowToolTips)
      {
        toolTip.SetToolTip(this, this.FocusedItem.ToolTipText);
      }
      else
      {
        toolTip.RemoveAll();
      }
    }