C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[49712] 엑셀 차트 코딩하기
ljagho [] 2715 읽음    2007-06-25 23:38
첨부파일의 data입력 부분에 나오는 차트를 코딩하고 싶습니다. 초보러  메크로로 돌려서 나오는 소스를 보고도 어떻게 코딩해야 되는지 모르겠습니다. 이 차트의 전체 코딩은 바라지도 않습니다. 어떻게 코딩해야 되는지 예를 들어 설명
해주시면 고맙겠습니다. 참고로 OLE로 하는 법은 모릅니다. 꼭 도와주세요.
<각축>
ActiveChart.Axes(xlValue).Select
    With ActiveChart.Axes(xlValue)
        .MinimumScale = -6
        .MaximumScale = 6
        .MinorUnit = 0.4
        .MajorUnit = 2
        .Crosses = xlCustom
        .CrossesAt = 0
        .ReversePlotOrder = False
        .ScaleType = xlLinear
        .DisplayUnit = xlNone
    End With
    Selection.TickLabels.AutoScaleFont = True
    With Selection.TickLabels.Font
        .Name = "돋움"
        .FontStyle = "보통"
        .Size = 8
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
        .Background = xlAutomatic
    End With
    Selection.TickLabels.NumberFormatLinked = True
End Sub
<각 주축선>
ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("07-02892-001(60WN1064).xls").Activate
    ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("07-02892-001(60WN1064).xls").Activate
    ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveChart.Axes(xlValue).MajorGridlines.Select
    With Selection.Border
        .ColorIndex = 57
        .Weight = xlThin
        .LineStyle = xlContinuous
    End With
    With ActiveChart.Axes(xlValue)
        .MinimumScale = -6
        .MaximumScale = 6
        .MinorUnit = 0.4
        .MajorUnit = 2
        .Crosses = xlCustom
        .CrossesAt = 0
        .ReversePlotOrder = False
        .ScaleType = xlLinear
        .DisplayUnit = xlNone
    End With
<그림영역>
ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveChart.PlotArea.Select
    With Selection.Border
        .Weight = xlThin
        .LineStyle = xlAutomatic
    End With
    With Selection.Interior
        .ColorIndex = 24
        .PatternColorIndex = 2
        .Pattern = xlSolid
    End With
<차트영역>
ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveChart.ChartArea.Select
    With Selection.Border
        .Weight = 1
        .LineStyle = -1
    End With
    Selection.Interior.ColorIndex = xlAutomatic
    Sheets("Sheet4").DrawingObjects("Chart 1").RoundedCorners = False
    Sheets("Sheet4").DrawingObjects("Chart 1").Shadow = False
    Selection.AutoScaleFont = True
    With Selection.Font
        .Name = "돋움"
        .FontStyle = "보통"
        .Size = 8
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
        .Background = xlAutomatic
    End With
    With Sheets("Sheet4").DrawingObjects("Chart 1")
        .Placement = xlMoveAndSize
        .PrintObject = True
    End With
    Sheets("Sheet4").DrawingObjects("Chart 1").Locked = True
<항목 축>
ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveChart.Axes(xlCategory).Select
    With Selection.Border
        .Weight = xlHairline
        .LineStyle = xlAutomatic
    End With
    With Selection
        .MajorTickMark = xlInside
        .MinorTickMark = xlNone
        .TickLabelPosition = xlNextToAxis
    End With
    With ActiveChart.Axes(xlCategory)
        .CrossesAt = 1
        .TickLabelSpacing = 1
        .TickMarkSpacing = 1
        .AxisBetweenCategories = True
        .ReversePlotOrder = False
    End With
    Selection.TickLabels.AutoScaleFont = True
    With Selection.TickLabels.Font
        .Name = "돋움"
        .FontStyle = "보통"
        .Size = 8
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
        .Background = xlAutomatic
    End With
    Selection.TickLabels.NumberFormatLinked = True
    With Selection.TickLabels
        .Alignment = xlCenter
        .Offset = 100
        .ReadingOrder = xlContext
        .Orientation = xlAutomatic
    End With
    ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
<계열1>
ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveWindow.Visible = False
    ActiveSheet.ChartObjects("Chart 1").Activate
    Windows("Book1").Activate
    ActiveChart.SeriesCollection(1).Select
    With Selection.Border
        .Weight = xlThin
        .LineStyle = xlAutomatic
    End With
    With Selection
        .MarkerBackgroundColorIndex = xlAutomatic
        .MarkerForegroundColorIndex = xlAutomatic
        .MarkerStyle = xlX
        .Smooth = False
        .MarkerSize = 5
        .Shadow = False
    End With
    ActiveChart.SeriesCollection(1).AxisGroup = 1
    ActiveChart.SeriesCollection(1).ErrorBar Direction:=xlY, Include:=xlNone, _
        Type:=xlFixedValue, Amount:=2

+ -

관련 글 리스트
49712 엑셀 차트 코딩하기 ljagho 2715 2007/06/25
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.