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. QLogValueAxis doesn't show up help
Qt 6.11 is out! See what's new in the release blog

QLogValueAxis doesn't show up help

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 306 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.
  • B Offline
    B Offline
    BadHombre
    wrote on last edited by
    #1

    I have some Problems with the log axis.
    The axis doesn't show up
    Anyone any idea ?

    // Here i set up the charts -> 2 Charts
        QChart *Buger = new QChart();
        Buger->legend()->setVisible(true);
        QChart *BugerFlux = new QChart();
        BugerFlux->legend()->setVisible(true);
    
    //Here i set up the X Axis which with a DateTimes
        QDateTimeAxis *axisX = new QDateTimeAxis;
        axisX->setFormat("dd MMM yyyy - hh:mm");
        axisX->setTitleText("Time Step");
        Buger->addAxis(axisX, Qt::AlignBottom);
    
    // This is the same Axis for the second chart
        QDateTimeAxis *axisXflux = new QDateTimeAxis;
        axisXflux->setFormat("dd MMM yyyy - hh:mm");
        axisXflux->setTitleText("Time Step");
        BugerFlux->addAxis(axisXflux, Qt::AlignBottom);
    
    // Here i set up a normal value axis as Y axis for the first Chart which works fine (the second chart is the Problem)
        QValueAxis *axisY = new QValueAxis;
        axisY->setTitleText("Mean Speed [<html>kms<sup>-1</sup></html>]");
        Buger->addAxis(axisY, Qt::AlignLeft);
    
    //Here i want to set up the Log Axis 
        QLogValueAxis *axisYflux = new QLogValueAxis;
        axisYflux->setLabelFormat("%g");
        axisYflux->setTitleText("Values");
        axisYflux->setBase(10.0);
        BugerFlux->addAxis(axisYflux, Qt::AlignLeft); // Here i add it to the QChart
    
    // Here i set up the Series in a (It depends how many the user has selected) MicronStatus is a vector with true or 
    // False  
    
     for(int m =0;m<MicronStatus.size();m++)
                {
                        QLineSeries *bugerseries1 = new QLineSeries();
                        QLineSeries *bugerseriesFlux = new QLineSeries();
    
                        if(MicronStatus[m]==true) //If the Status is True 
                        {
    
                        for(int i = 0 ; i<value[m].size();i++)
                            {
                                  bugerseries1->append(AllStepDatesAsQDatetime[i].toMSecsSinceEpoch(), value[m][i])
                            }
    
                        for(int i = 0 ; i<value2[m].size();i++)
                            {
                              bugerseriesFlux->append(AllStepDatesAsQDatetime[i].toMSecsSinceEpoch(), value2[m][i])
                            }
                                 bugerseries1->setColor(Qt::red);
                                 bugerseries1->setName("1");
                                 bugerseriesFlux->setColor(Qt::red);
                                 bugerseriesFlux->setName("1");
    
                        }
                       
    // This is maybe the Problem :/
                        BugerFlux->addSeries(bugerseriesFlux);
                        bugerseriesFlux->attachAxis(axisXflux);
                        bugerseriesFlux->attachAxis(axisYflux);
    
                            Buger->addSeries(bugerseries1);
                            bugerseries1->attachAxis(axisX);
                            bugerseries1->attachAxis(axisY);
    
                    }
                        
                }
    
                axisY->setRange(0,maxplotvalue+maxplotvalue/4);
                Buger->addAxis(axisY, Qt::AlignLeft);
    
               BugerFlux->addAxis(axisYflux, Qt::AlignLeft); // Or this could be the Problem 
    
                QChartView *BugerView = new QChartView(Buger);
                BugerView->setRenderHint(QPainter::Antialiasing);
                QChartView *BugerViewFlux = new QChartView(BugerFlux);
                BugerView->setRenderHint(QPainter::Antialiasing);
    
    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