Qt의 차트의 경우
축에 있는 Range에 따라 차트를 그리는게아니라
데이터전체의 min max값을 파악하여 그래프를 먼저그린후 해당 데이터에 맞춰 축데이터를 수정한다 ㄱ-
d->mChart->removeAllSeries();
d->mChart->addSeries(series);
d->mChart->createDefaultAxes(); // always need this function after addSeries
따라서 createDefaultAxes 함수를 addSeries 이후에 반드시 호출해줘야 오류가 없다.
다음 도큐먼트 참고
//Referance : QtDocument 5.11.1
Creates axes for the chart based on the series that have already been added to the chart. Any axes previously added to the chart will be deleted.
Note: This function has to be called after all series have been added to the chart. The axes created by this function will NOT get automatically attached to any series added to the chart after this function has been called. A series with no axes attached will by default scale to utilize the entire plot area of the chart, which can be confusing if there are other series with properly attached axes also present.
Series type |
X-axis |
Y-axis |
None |
None |
If there are several QXYSeries derived series added to the chart and no series of other types have been added, then only one pair of axes is created. If there are several series of different types added to the chart, then each series gets its own axes pair.
The axes specific to the series can be later obtained from the chart by providing the series as the parameter for the axes() function call. QPieSeries does not create any axes.
See also axisX(), axisY(), axes(), setAxisX(), setAxisY(), and QAbstractSeries::attachAxis().
'Qt' 카테고리의 다른 글
QPropertyAnimation 예제 Circle형태의 PrograssBar (0) | 2018.11.02 |
---|---|
QTableWidgetItem 대신 ComboBox를 테이블 안에 넣는 예제(QTableWidget In QComboBox Example) (0) | 2018.10.16 |
Qt의 QrCode 라이브러리 (0) | 2018.07.19 |
QSystemInfo를 못찾아서 Qt추가설치 (0) | 2018.07.03 |
QTableWidget을 Excel로 복사 붙여넣기 커스텀 클래스만들기 (0) | 2018.06.22 |