첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
본 블로그는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 블로그 콘텐츠 향상을 위해 쓰여집니다.

728x90
반응형

▶ 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>

 

728x90

 

▶ 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;

 

728x90
반응형
그리드형(광고전용)
Posted by 사용자 icodebroker

댓글을 달아 주세요