qchart 图表_QChart双Y轴实时更新曲线图

QChart双Y轴,X轴设置时间轴

前言

工作上需要做一个双Y轴的折线图,除了看QT的相关类的文档,找到的资料不多,所以记录下来。

准备

首先,通过QT的帮助文档了解下QChart、QSplineSeries(或者其他的Series类)、QValueAxis等类的描述,翻译用的是有道的在线翻译,自己再稍微修改一下不通顺的地方。

QChart

The QChart class manages the graphical representation of the chart's series, legends, and axes.

QChart类管理图表中的线、图例和轴的图形表示。

QChart is a QGraphicsWidget that you can show in a QGraphicsScene. It manages the graphical representation of different types of series and other chart related objects like legend and axes. To simply show a chart in a layout, the convenience class QChartView can be used instead of QChart. In addition, line, spline, area, and scatter series can be presented as polar charts by using the QPolarChart class.

QChart是一个可以在QGraphicsScene中显示的QGraphicsWidget。它管理不同类型的系列和其他图表相关对象(如图例和轴)的图形表示。要简单地在布局中显示图表,可以使用便利类QChartView代替QChart。此外,直线、平滑曲线、面积和散射图可以通过QPolarChart类来表示为极坐标图。

QSplineSeries

The QSplineSeries class presents data as spline charts.

QSplineSeries类将数据表示为平滑曲线图。

A spline series stores the data points and the segment control points needed by QPainterPath to draw a spline. The control points are automatically calculated when the data changes. The algorithm computes the points so that the normal spline can be drawn.

一个spline series存储QPainterPath绘制平滑曲线所需的数据点和段控制点。当数据发生变化时,控制点会自动计算。该算法对点进行计算,以便绘制平滑曲线。

QValueAxis

QValueAxis class adds values to a chart's axes.

QValueAxis类将值添加到图表的轴中。

A value axis can be set up to show an axis line with tick marks, grid lines, and shades. The values on the axis are drawn at the positions of tick marks.

可以设置一个值轴来显示带有标记、网格线和阴影的轴线。在轴上的值是在标记的位置绘制的。

QDateTimeAxis

The QDateTimeAxis class adds dates and times to a chart's axis.

QDateTimeAxis类将日期和时间添加到图表的轴中。

QDateTimeAxis can be set up to show an axis line with tick marks, grid lines, and shades. The labels can be configured by setting an appropriate DateTime format. QDateTimeAxis works correctly with dates from 4714 BCE to 28

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值