Chart stylesheet & Text field
Solved
General and Desktop
-
Hi. I'm drawing the chart real-time. I have a question.
The red letter stage1 starts with the 8.5 number on the x-axis. I want to mark it, so if it's drawn in real time, I'll have to go back in the direction of the arrow. Is there a way to do this?The second question is, is there a way to decorate the chart like this? Will the chart be a style sheet? And my chart is based on the theme provided by qt, but if the background is white, can you change this color or make it transparent?
-
void QTemperatureChart::InitializeChart() { //m_pChartViewer = new QChartView(createAreaChart()); m_pChartViewer = new QChartView(createSplineChart()); //m_pChartViewer->chart()->setTheme(QChart::ChartTheme::ChartThemeDark); m_pChartViewer->chart()->legend()->hide(); m_pChartViewer->chart()->setAnimationOptions(QtCharts::QChart::SeriesAnimations); m_pChartViewer->chart()->setAnimationDuration(500); //m_pChartViewer->chart()->setBackgroundRoundness(20); //m_pChartViewer->chart()->setBackgroundVisible(false); //m_pChartViewer->chart()->backgr; m_pChartViewer->chart()->setBackgroundBrush(QBrush(Qt::darkGray)); //m_pChartViewer->chart()->setBackgroundVisible(false); m_pChartViewer->setRenderHint(QPainter::Antialiasing); m_pChartViewer->setBackgroundBrush(QBrush(Qt::darkYellow)); //m_pChartViewer->setStyleSheet("ChartView{background-color: none;}"); //m_pChartViewer->setBackgroundBrush(QColor(255,255,255,0)); this->ui.verticalLayout->addWidget(m_pChartViewer); }
It's not transparent.