@Andeol
Hi,
Maybe I should have started saying that I have a QCandlestickSeries *series where I store financial data. Each single day in the series is stored in its corresponding QCandelstickSets *set. The series is added to a QChart chart and this one presented in a QChartView view.
So far everything works since the date is drawn when I press the button. I even reimplemented the QChartView class to have my own zoom command. And that works also. This is the part of the reimplemented class with respect to the zoom:
void ChartView::keyPressEvent(QKeyEvent *event)
{
QRectF rect = chart()->plotArea();
qreal adjustment = rect.width() / 2;
switch (event->key())
{
case Qt::Key_Up:
{
//rect.setX(chart()->plotArea().x() + adjustment);
rect.adjust(adjustment, 0, 0, 0);
chart()->zoomIn(rect);
}
break;
case Qt::Key_Down:
.
.
.
As you can see, the zoom is only in the X axis.
I would like to zoom the Y axis as well, but in such a way that it takes into account the maximum value of the different sets (QCandlestickSet) that fall inside the x-zoomed area. That is to say, I would like an autoscale in the Y axis to watch the sets as big as possible.
To do that, I was thinking on something like:
QGraphicsScene *scene = chart()->scene();
QList<QGraphicsItem *> itemList;
itemList = scene->items(rect, Qt::IntersectsItemShape, Qt::DescendingOrder);
But this is not working, as you guys said before.
Thank you very much for your help,