Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Chart stylesheet & Text field
Qt 6.11 is out! See what's new in the release blog

Chart stylesheet & Text field

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 1 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    ec960183-85bf-4d73-99cb-2cd74ad8294d-image.png

    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?

    8969a434-2b72-4b9a-9f8d-b9e1366fce62-image.png

    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?

    I 1 Reply Last reply
    0
    • I IknowQT

      ec960183-85bf-4d73-99cb-2cd74ad8294d-image.png

      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?

      8969a434-2b72-4b9a-9f8d-b9e1366fce62-image.png

      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?

      I Offline
      I Offline
      IknowQT
      wrote on last edited by
      #2

      m_pChartViewer->chart()->setBackgroundVisible(false);
      //m_pChartViewer->chart()->setBackgroundBrush(QColor(0, 0, 0, 0));

      3615f052-edc1-4fed-8dba-747fe08b3d21-image.png

      1 Reply Last reply
      0
      • I Offline
        I Offline
        IknowQT
        wrote on last edited by
        #3
        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);
        }
        

        b1192b8e-5313-41bc-97a6-67eec3737cb2-image.png

        It's not transparent.

        9dc969a5-0f35-44be-bf2a-33c63a402332-image.png

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved