Annotations
을 사용하여 성공했습니다. 시각적 일관성을 유지하기 위해이 두 축에 대해 만들었습니다. 다음은 세로 축에 대한 코드입니다. AnchorY
가 있지만 인덱스와 차트의 이름으로 작동하지 않았다 설정 이상하게
Dim caLabelAxisY As New TextAnnotation
With caLabelAxisY
.AnchorX = 0
.AxisX = ChartAmortisation.ChartAreas(0).AxisX
.AnchorY = ChartAmortisation.ChartAreas(0).AxisY.Maximum
.AxisY = ChartAmortisation.ChartAreas(0).AxisY
.Name = "Label AxisY"
.Text = "Investition/Überschuss"
.Font = New Font("Microsoft Sans Serif", 9, FontStyle.Bold)
.AnchorAlignment = ContentAlignment.TopLeft
End With
. 이는 : 또한
'What works:
caLabelAxisY.AnchorY = ChartAmortisation.ChartAreas(0).AxisY.Maximum
'What doesnot work:
caLabelAxisY.AnchorY = ChartAmortisation.ChartAreas("Amortisation").AxisY.Maximum
, 내가 프로그래밍 Annotations
를 설정할 때이 만했다. Visual Studio 2010의 디자이너에서이 값을 설정하면 결과를 시각화 할 수 있었지만 런타임에는 아무 것도 표시하지 않았습니다.
마지막으로, 이제 어떻게 생겼는지 보여줍니다.
라벨이 더 편의를 위해 차트 안에있는 것은 그들을 배치 또한 좋은 해결책이었다 것
감사합니다, (그렇지 않으면 나는 축에서 숫자의 크기에 귀찮게한다). 방금 게시 한 솔루션을 선호합니다. 더욱 복잡하고 축의 "안쪽"에 레이블이있는 단점이 있습니다. – Nicolas