c# Winform MSChart를 사용하다가
파일에서 데이터를 불러와 표현 할 때 기존의 데이터 스케일이 너무 커서
새로 불러들인 데이터의 스케일이 작게 나타나 보이는 현상이 발생하였다.
![](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
![](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
이를 자동으로 영역을 재 설정 하기 위해서는 다음과 같은 코드가 필요하다
chart.ChartAreas[0].AxisY.Maximum = Double.NaN;
chart.ChartAreas[0].AxisY.Minimum = Double.NaN;
chart.ChartAreas[0].RecalculateAxesScale();
위 코드를 삽입 후 데이터를 확인하면 아래와 같이 영역이 재 설정 되는 것을 확인 할 수 있다.
![](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
출처
.net - How do I force a chart to auto adjust Y Axis Maximum? - Stack Overflow
반응형
'C#' 카테고리의 다른 글
[c#][.NET Core] 콘솔 애플리케이션으로 실행 (0) | 2023.01.17 |
---|---|
[C#][MSChart] Cursor 없애기 (0) | 2022.06.23 |
[C#] 숫자만 입력받는 TextBox 만들기 (0) | 2021.03.23 |
[C#, DataGridView] 실시간 데이터 추가시 느려지는 현상 해결 (0) | 2020.07.08 |
[C#, DataGridView] 데이터 추가시 DataGridView 깜빡임 문제 해결 (0) | 2020.07.08 |