title: How to automatically rescale axis in QtCharts?
body: <p>I am using <a href="https://doc.qt.io/qt-5/qtcharts-index.html" rel="noreferrer">QtCharts</a>.</p>
  
  <p>I need both axes to be rescaled after appending values. The values I appended are not between 0 and 1 and also not from the year 1970.</p>
  
  <p><a href="https://i.stack.imgur.com/73HO3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/73HO3.png" alt="QtChart axis wrong scaled"></a></p>
  
  <p>Constructor code of my dialog looks like this:</p>
  
  <pre><code>m_series = new QLineSeries;
  m_series-&gt;setName(name);
  
  auto chart = new QChart;
  chart-&gt;legend()-&gt;setVisible(false);
  chart-&gt;addSeries(m_series);
  
  m_axisX = new QDateTimeAxis;
  //m_axisX-&gt;setFormat("HH:mm:ss");
  m_axisX-&gt;setTitleText(tr("Zeitpunkt"));
  chart-&gt;addAxis(m_axisX, Qt::AlignBottom);
  
  m_series-&gt;attachAxis(m_axisX);
  
  auto axisY = new QValueAxis;
  axisY-&gt;setTitleText(unit);
  chart-&gt;addAxis(axisY, Qt::AlignLeft);
  
  m_series-&gt;attachAxis(axisY);
  
  auto chartView = new QChartView(chart, this);
  chartView-&gt;setRenderHint(QPainter::Antialiasing);
  </code></pre>
  
  <p>My MainWindow emits signals containg new values. Multiple opened chart dialogs are connected to that signal.</p>
  
  <pre><code>void ChartDialog::liveUpdate(const RealTimeMeasureRegisters &amp;registers)
  {
      auto result = ((&amp;registers)-&gt;*m_methodPtr)();
  
      m_series-&gt;append(registers.timestamp(), result);
  }
  </code></pre>
  
  <p><strong>Is there some easy way to tell QDateTimeAxis (in my case <code>m_axisX</code>) to automatically adjust to the new values?</strong></p>
  
  <p><a href="https://doc.qt.io/qt-5/qdatetimeaxis.html#setRange" rel="noreferrer">QDateTimeAxis::setRange()</a> does not look good, because I need to set a minimum and maximum.</p>