问题标签 [qtcharts]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c++ - Qt 图表条形图调整大小崩溃
情况:
QtCharts
我用, QChartView
, QChart
, QBarSeries
,和写了一个条形图QBarSet
,效果很好。QValueAxis
QCategoryAxis
问题:
当我调整窗口大小或QRubberband
在绘图上使用时,它会崩溃。
我尝试了什么:
我写的所有其他情节都不受该问题的影响,包括使用QStackedBarSeries
. 这个问题也出现在我在相同情况下编写的另一个程序中。
代码 - 头:
代码 - 正文:
c++ - 如何修复 xychart.cpp 中的“index < m_series->count()”错误?
我开始QtCharts
在我的应用程序中使用。我正在考虑的图表是折线图,使用对象QChart
和QLineSeries
。由于所有点都是动态添加的,我使用信号/槽系统来更新图表:
当在(对象)onPointAdded
中添加一个点时调用该函数。我给出的代码片段删除了图中的第一个点,例如图中的点数始终是固定的(开头除外)。serie
QLineSeries
serie
当我在 中运行此代码时Release
,没有问题。但是,当我运行它Debug
并且点数达到阈值时,我收到以下错误消息:
此对话框不会停止程序,但每次添加一个点(并达到阈值)时,都会在前一个对话框的顶部出现一个新对话框。
以下是重现错误的最少代码:
主窗口.h
主窗口.cpp
我使用UI 表单来生成图形界面。这个接口包含一个QChartView
和一个QPushButton
(动态添加点)。
我的 Qt 版本是5.11.2,并且该错误是使用MSVC 2017 64-bits产生的。需要插件QtCharts才能使用QChart
,QChartView
和QLineSeries
.
我想知道是否可以解决此问题或禁用 Qt 调试对话框消息。
c++ - 将常规值轴更改为对数轴的问题
我有一个带有常规值轴的 QT 图表。当我切换复选框时,我想将 X 轴从 QValueAxis 更改为 QLogValueAxis。问题是,当我这样做时,我的数据不再绘制到正确的点。
我已经尝试了两种方法(以及它们的一系列变体)来使对数刻度起作用,但是我没有尝试过,似乎数据本身可以线性缩放以适合窗口并完全忽略对数轴。
方法 1 - 更换旧轴:
方法 2 - 制作一个全新的图表:
关于如何在运行时热交换到日志轴的任何想法?提前致谢!
c++ - QTCharts“cartesianchartaxis_p.h”处的 QT nmake 异常“未定义接口”
我正在尝试将 QTCharts 2.1.0 用于 QT 5.4.1 版本。我使用开源 QT 并尝试按照此qtcharts github release-2.1.0 链接中显示的说明安装 QTCharts
我构建没有任何问题,但是当我尝试使用 nmake 运行它时,我得到了下面显示的异常,我真的不知道原因。所以,我会很感激任何帮助。顺便说一句,我正在使用 VS2012 x86 Native Tools 命令提示符。
例外:
qt - y-Axis Maximum in QML BarSeries Not Updating
I'm using a QML BarSeries
to display some data and encountered a problem: the y-axis of the BarSeries doesn't update automatically.
Below is an mcve copied and modified from the BarSeries docs. It updates the bar series when the user clicks on the background.
From the code, we could see that the click on the mouse area should update the series to have a y-axis of up to 200 (due to Susan's new set of values).
The screenshots below show the columns updating but not the y-axis. (Note that I'm expecting the y-axis maximum to update to 200.)
Before the mouse click:
After the mouse click:
What changes should I make to update the maximum of the chart's y-axis?
After the multiple mySeries.append
statements in MouseArea::onClicked
, I tried doing chartView.update()
but this worked to no avail.
I searched and researched but found nothing. Most answers from the web concern only QtCharts run from C++ or describe a different issue (unless I searched with the wrong keywords?).
For completeness, here's the main.cpp
file:
c++ - 带有多页按钮的 Qt 图表
我有一些数据可视化(在 main.cpp 中),我想拥有它,以便它根据按下的按钮选择要显示的内容。这是一段 main.cpp:
我已经注释掉并拆分了每个部分。如果我使用charts.ui 放置按钮,我不确定如何根据按下的内容显示和拆分每个可视化
c++ - QtCharts 轴对齐中心
我正在尝试在图表中心使用带有 X 轴和 Y 轴的 QtCharts。
因此,中心点将位于我的 QtChart 的中间......有将轴对齐到顶部/底部或左/右(addAxis(QValueAxis*,Qt::AlignTop)
)的选项。但是,没有选项可以将其对齐到中心。当我AlignCenter
用作addAxis
参数时,我得到一个错误。
有什么帮助吗?
坦克。
编辑(提供代码和错误):
当我将这两行更改为:
我面临这个错误: ErrorScreenshot
python - 如何在 PySide2 中更改图形的颜色
我正在 PySide2 中制作一个简单的图表,只是想知道您是否可以将颜色更改为其他颜色。这是目前我的代码。
任何帮助都会很棒
c++ - c++ 使用getter函数时无法检索到正确的值
我正在尝试从“void readJson();”中检索值 使用 getter 的函数。
void readJson() - 我创建的一个函数,用于为我的类中声明的各个变量设置值
我试图将每个变量设置为公共,但它似乎也不起作用。
调试后,我应该得到这些类似的值作为我的输出:
但是,我得到了这些:
有什么线索吗?一些帮助将不胜感激(: