Qt literacy-QSplineSeries theory summary

QSplineSeries theory summary

I. Overview

QSplineSeries is actually a smooth curve. This class stores the data points and segment control points needed by QPainterPath to draw spline curves. Control points are automatically calculated as the data changes. The algorithm draws a normal spline by computing these points.
insert image description here

QSplineSeries is actually the implementation class of QLineSeries, which implements a smooth line graph.
All functions of QLineSeries are inherited from QXYSeries.

Basically all the functions are available in QXYSeries, so we only need to learn to use QXYSeries. Controlling the left and right movement and zooming of this graph is what QChart should do. QLineSeries only maintains this data point and does not interact. The color of this line, the click response and so on.

It is recommended to take a look at my Qt literacy-QXYSeries theory summary

2. Easy to use

  QSplineSeries* series = new QSplineSeries();
  series->append(0, 6);
  series->append(2, 4);
  ...
  chart->addSeries(series);

Guess you like

Origin blog.csdn.net/qq_43680827/article/details/130230060