SmartLabelStyle 類別

定義

提供方法與屬性用於執行智慧型、具規則的資料點標籤定位,以解決重疊資料點標籤的問題。

public ref class SmartLabelStyle
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.DataVisualization.Charting.NoNameExpandableObjectConverter))]
public class SmartLabelStyle
[<System.ComponentModel.TypeConverter(typeof(System.Web.UI.DataVisualization.Charting.NoNameExpandableObjectConverter))>]
type SmartLabelStyle = class
Public Class SmartLabelStyle
繼承
SmartLabelStyle
衍生
屬性

範例

Imports System.Web.UI.DataVisualization.Charting  

Private Function SetSmartLabelsOptions()  

   ' Enabling the SmartLabels™ attribute.  
   Chart1.Series("Series1").SmartLabels.Enabled = true  

   ' Set the callout style.  
   Chart1.Series("Series1").SmartLabels.CalloutStyle = LabelCalloutStyle.Underlined  

   ' Set the callout line color.  
   Chart1.Series("Series1").SmartLabels.CalloutLineColor = Color.Goldenrod;  

   ' Set the callout line style.  
   Chart1.Series("Series1").SmartLabels.CalloutLineStyle = ChartDashStyle.Dash  

   ' Set the callout line width.  
   Chart1.Series("Series1").SmartLabels.CalloutLineWidth = 3   

   ' Set the callout line anchor cap.  
   Chart1.Series("Series1").SmartLabels.CalloutLineAnchorCap = LineAnchorCap.Arrow  
End Function  
using System.Web.UI.DataVisualization.Charting  

private void SetSmartLabelsOptions()  
{  
   // Enabling the SmartLabels™ attribute.  
   Chart1.Series["Series1"].SmartLabels.Enabled = true;  

   // Set the callout style.  
   Chart1.Series["Series1"].SmartLabels.CalloutStyle = LabelCalloutStyle.Underlined;  

   // Set the callout line color.  
   Chart1.Series["Series1"].SmartLabels.CalloutLineColor = Color.Goldenrod;  

   // Set the callout line style.  
   Chart1.Series["Series1"].SmartLabels.CalloutLineStyle = ChartDashStyle.Dash;  

   // Set the callout line width.  
   Chart1.Series["Series1"].SmartLabels.CalloutLineWidth = 3;  

   // Set the callout line anchor cap.  
   Chart1.Series["Series1"].SmartLabels.CalloutLineAnchorCap = LineAnchorCap.Arrow;  
}  

備註

啟用智慧標籤時,圖表會根據一組使用者定義的規則重新置放重迭的資料點標籤。

將會繪製標注線來將標籤與資料點連結。 您可以控制標注線的視覺屬性。 這些視覺屬性包括色彩、線條樣式和線條寬度。 CalloutStyleCalloutLineAnchorCapStyle 屬性會控制出現在注標線結尾的 embellishments,例如箭頭。

CalloutLineColor屬性可以設定為任何 Color 物件。 如果您設定注標線的色彩,則也會自動設定的色彩 CalloutLineAnchorCapStyle 和所定義的修飾 CalloutStyle

CalloutLineWidth屬性控制標注線的圖元寬度。 使用這個屬性也會調整和的 embellishments CalloutLineAnchorCapStyle CalloutStyle

您可以使用數個動作相關的屬性來控制智慧標籤的移動。 這些會定義方向、距離以及資料點標籤是否允許離開繪圖區域的移動規則。 預設的移動規則通常會解決大部分的問題。 MaxMovingDistance會定義值,這個值會指定資料點的最大距離(以圖元為單位),這是在重迭時允許移動資料點標籤的位置。 MinMovingDistance屬性會定義值,這個值會指定資料點的最小距離(以圖元為單位),以便在重迭時移動資料點標籤。 當需要重新置放資料點標籤時,標籤將會以至少指定的圖元數來移動。

IsOverlappedHidden當無法解決重迭問題時,屬性會指出是否隱藏標籤。 如果 IsOverlappedHidden 屬性為 true ,而且無法在指定的區域內繪製資料點,則 MinMovingDistance 不會 MaxMovingDistance MovingDirection 繪製資料點標籤。

MovingDirection屬性會定義可以移動資料點標籤 (s) 方向。 這個屬性會接受一個 LabelAlignmentStyles 值或多個值的位 or LabelAlignmentStyles 。 預設值是所有值的位 OR LabelAlignmentStyles ,以允許在資料點中央以外的所有可能方向中重新置放。

下列圖表類型不支援智慧標籤:

  • 橫條圖:橫條圖和一百% 堆疊橫條圖。

  • 形狀圖:圓形圖、環圈圖、極座標圖和雷達圖。

  • 範圍圖:範圍、範圍資料行和範圍橫條圖。

  • 堆疊區域圖:堆疊區域圖和一百% 堆疊區域圖。

建構函式

SmartLabelStyle()

初始化 SmartLabelStyle 類別的新執行個體。

屬性

AllowOutsidePlotArea

取得或設定旗標,指定是否可以在繪圖區之外繪製 SmartLabelStyle 物件。

CalloutBackColor

取得或設定標籤註標的背景色彩。

CalloutLineAnchorCapStyle

取得或設定標籤註標線的錨點端點樣式。

CalloutLineColor

取得或設定標籤註標線的色彩。

CalloutLineDashStyle

取得或設定標籤註標線的樣式。

CalloutLineWidth

取得或設定標籤註標線的寬度。

CalloutStyle

取得或設定已重新定位之 SmartLabelStyle 物件的註標樣式。

Enabled

取得或設定旗標,指出是否已啟用 SmartLabelStyle 演算法。

IsMarkerOverlappingAllowed

取得或設定旗標,指出是否允許資料點標籤重疊資料點標記。

IsOverlappedHidden

取得或設定旗標,指出是否會隱藏無法重新定位的重疊標籤。

MaxMovingDistance

取得或設定重疊的 SmartLabelStyle 物件可以從標記移動的最大距離 (以像素為單位)。

MinMovingDistance

取得或設定重疊的 SmartLabelStyle 物件可以從標記移動的最小距離 (以像素為單位)。

MovingDirection

取得或設定方向,這是允許重疊的 SmartLabelStyle 物件移動的方向。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於