■ ChartControl 클래스의 BoundDataChanged 이벤트를 사용해 바인딩 데이터 변경시 처리하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
using DevExpress.XtraCharts; ... ChartControl chartControl; ... chartControl.BoundDataChanged += chartControl_BoundDataChanged; ... private void chartControl_BoundDataChanged(object sender, EventArgs e) { ChartControl chartControl = sender as ChartControl; XYDiagram diagram = chartControl.Diagram as XYDiagram; if(diagram == null) { return; } foreach(Series series in chartControl.Series) { if(series.Name == "Temperature") { LineSeriesView seriesView = series.View as LineSeriesView; if(seriesView == null) { break; } seriesView.AxisX = diagram.SecondaryAxesX[0]; } } } |