첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
유용한 소스 코드가 있으면 icodebroker@naver.com으로 보내주시면 감사합니다.
블로그 자료는 자유롭게 사용하세요.

■ SparklineEdit 엘리먼트 사용하기

------------------------------------------------------------------------------------------------------------------------

XAML

 

 

<Grid xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">

    <dxe:SparklineEdit x:Name="sparklineEdit"

        PointArgumentMember="ArgumentColumn"

        PointValueMember="ValueColumn">

        <dxe:SparklineEdit.PointArgumentRange>

            <dxe:Range

                Auto="False"

                Limit1="01/02/2000"

                Limit2="01/07/2000" />

        </dxe:SparklineEdit.PointArgumentRange>

        <dxe:SparklineEdit.StyleSettings>

            <dxe:AreaSparklineStyleSettings

                LineWidth="3"

                AreaOpacity="0.5"

                ShowMarkers="True"

                    

                MarkerSize="3"

                MaxPointMarkerSize="10"

                MinPointMarkerSize="9"

                StartPointMarkerSize="8"

                EndPointMarkerSize="7"

                NegativePointMarkerSize="6"

                    

                HighlightMaxPoint="True"

                HighlightMinPoint="True"

                HighlightStartPoint="True"

                HighlightEndPoint="True"

                HighlightNegativePoints="True"

                    

                Brush="DarkBlue"

                MaxPointBrush="#fff5da2a"

                MinPointBrush="#ff2B0dea"

                StartPointBrush="#ff127a0d"

                EndPointBrush="#fff71616"

                NegativePointBrush="#ff9c0404"

                MarkerBrush="Black" />

        </dxe:SparklineEdit.StyleSettings>

    </dxe:SparklineEdit>

</Grid>

 

 

C#

 

 

using System.Collections.ObjectModel;

 

/// <summary>

/// 커스텀 엘리먼트

/// </summary>

public class CustomElement

{

    /// <summary>

    /// 인자 컬럼

    /// </summary>

    public object ArgumentColumn { get; set; }

 

    /// <summary>

    /// 값 컬럼

    /// </summary>

    public int ValueColumn { get; set; }

 

    /// <summary>

    /// 필터 컬럼

    /// </summary>

    public int FilteringColumn { get; set; }

}

 

...

 

ObservableCollection<CustomElement> collection = new ObservableCollection<CustomElement>();

 

Random random = new Random();

 

for(int i = 1; i <= dayCount; i++)

{

    collection.Add

    (

        new CustomElement()

        {

            ArgumentColumn  = new DateTime(2000, 1, i),

            ValueColumn     = pRandom.Next(20),

            FilteringColumn = 1

        }

    );

}

 

this.sparklineEdit.EditValue = collection;

 

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker

댓글을 달아 주세요