StripLine.TextOrientation 속성

정의

텍스트 방향을 가져오거나 설정합니다.

public:
 property System::Web::UI::DataVisualization::Charting::TextOrientation TextOrientation { System::Web::UI::DataVisualization::Charting::TextOrientation get(); void set(System::Web::UI::DataVisualization::Charting::TextOrientation value); };
[System.ComponentModel.Bindable(true)]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.Attribute)]
public System.Web.UI.DataVisualization.Charting.TextOrientation TextOrientation { get; set; }
[<System.ComponentModel.Bindable(true)>]
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.Attribute)>]
member this.TextOrientation : System.Web.UI.DataVisualization.Charting.TextOrientation with get, set
Public Property TextOrientation As TextOrientation

속성 값

TextOrientation 텍스트 방향의 맞춤을 나타내는 값입니다.

특성

예제

다음 코드 예제에서는 차트 컨트롤이 디자인 화면에 추가된 후 임계값 선을 추가하는 방법을 보여 줍니다. 차트는 되풀이가 아닌 줄무늬 선을 사용하여 계열에 있는 모든 데이터 포인트의 평균 계산을 표시합니다.

Imports System.Web.UI.DataVisualization.Charting

Public Partial Class StripLines
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        ' Add chart data before adding strip lines.
        AddChartData()

        ' Adds a threshold line using strip lines.
        AddThresholdStripLine()
    End Sub

    ''' <summary>
    ''' Adds a week of data with values between 20 and 35.
    ''' </summary>
    Private Sub AddChartData()
        ' Declare new random variable
        Dim rand As New Random()
        For i As Integer = 0 To 6

            ' Add a week of data
            chart1.Series(0).Points.AddXY(DateTime.Now.AddDays(i), rand.[Next](20, 35))
        Next
    End Sub

    ''' <summary>
    ''' Adds a horizontal threshold strip line at the calculated mean
    ''' value of all data points in the first series of the chart.
    ''' </summary>
    Private Sub AddThresholdStripLine()
        Dim stripLine3 As New StripLine()

        ' Set threshold line so that it is only shown once
        stripLine3.Interval = 0

        ' Set the threshold line to be drawn at the calculated mean of the first series
        stripLine3.IntervalOffset = chart1.DataManipulator.Statistics.Mean(chart1.Series(0).Name)

        stripLine3.BackColor = Color.DarkGreen
        stripLine3.StripWidth = 0.25

        ' Set text properties for the threshold line
        stripLine3.Text = "Mean"
        stripLine3.ForeColor = Color.Black
        stripLine3.TextAlignment = StringAlignment.Near
        stripLine3.TextLineAlignment = StringAlignment.Near
        stripLine3.TextOrientation = TextOrientation.Auto

        ' Add strip line to the chart
        chart1.ChartAreas(0).AxisY.StripLines.Add(stripLine3)
    End Sub
End Class
public partial class StripLines : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Add chart data
            AddChartData();

            // Adds a threshold line using strip lines.
            AddThresholdStripLine();
        }

        /// <summary>
        /// Adds a week of data with values between 20 and 35.
        /// </summary>
        private void AddChartData()
        {
            // Declare new random variable
            Random rand = new Random();

            // Add a week of data
            for (int i = 0; i < 7; i++)
            {
                chart1.Series[0].Points.AddXY(DateTime.Now.AddDays(i), rand.Next(20,35));
            }
        }

        /// <summary>
        /// Adds a horizontal threshold strip line at the calculated mean
        /// value of all data points in the first series of the chart.
        /// </summary>
        private void AddThresholdStripLine()
        {
            StripLine stripLine3 = new StripLine();

            // Set threshold line so that it is only shown once
            stripLine3.Interval = 0;

            // Set the threshold line to be drawn at the calculated mean of the first series
            stripLine3.IntervalOffset = chart1.DataManipulator.Statistics.Mean(chart1.Series[0].Name);

            stripLine3.BackColor = Color.DarkGreen;
            stripLine3.StripWidth = 0.25;

            // Set text properties for the threshold line
            stripLine3.Text = "Mean";
            stripLine3.ForeColor = Color.Black;
            stripLine3.TextAlignment = StringAlignment.Near;
            stripLine3.TextLineAlignment = StringAlignment.Near;
            stripLine3.TextOrientation = TextOrientation.Auto;

            // Add strip line to the chart
            chart1.ChartAreas[0].AxisY.StripLines.Add(stripLine3);
        }
    }

설명

이 속성을 값 Auto으로 설정하면 텍스트는 차트 종류에 따라 방향을 지정합니다. 가로 막대를 제외한 모든 X-Y 차트 유형의 경우 X축 줄무늬 선 텍스트는 줄무늬 선 아래쪽에서 왼쪽에서 오른쪽으로 가로 방향으로 지정됩니다. 가로 막대형 차트의 경우 X축 줄무늬 선 텍스트는 줄무늬 선의 위쪽에서 아래쪽에서 오른쪽으로 세로 방향으로 지정됩니다.

적용 대상