title: Draw a point on a QChart
body: <p>I'm trying to draw a point where I click on a QChart. To do so I've created a "ChartWidget" class that inherits QChart and overrided the paint method like this :</p>
  
  <pre><code>void ChartWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
  {
      QtCharts::QChart::paint(painter, option, widget);
  
      if (_pointToDraw != nullptr)
      {
          std::cout &lt;&lt; "Drawing point" &lt;&lt; std::endl;
  
          QPen pen;
  
          pen.setColor(QColor(255, 0, 0, 255));
          pen.setWidth(3);
  
          painter-&gt;setPen(pen);
          painter-&gt;drawPoint(*_pointToDraw);
  
          delete _pointToDraw;
          _pointToDraw = nullptr;
      }
  }
  
  void ChartWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
  {
      std::cout &lt;&lt; "Clicked at " &lt;&lt; event-&gt;pos().x() &lt;&lt; "/" &lt;&lt; event-&gt;pos().y() &lt;&lt; std::endl;
  
      _pointToDraw = new QPointF(event-&gt;pos());
  
      update();
  }
  </code></pre>
  
  <p>It seems that the point is drawn but behind the chart because I can only see it when I click just outside of the chart, like in this screenshot : </p>
  
  <p><img src="https://i.stack.imgur.com/7P5tO.png" alt="Screenshot"></p>
  
  <p>If I click in the middle of the chart nothing is visibly drawn.</p>
  
  <p>Any idea of what I am doing wrong and how I can fix this ?</p>