I am using the plugin Timemanager which works really great but there is one thing I'd like to improve.

Instead of displaying the date and time on each frame, I would like to display a timeline stretching from *date_start* to *date_end* which shows the current frame time within this timespan.

I understand this possibility is not (yet?) offered by the plugin and therefore I am looking for an amazing idea on how to implement this. A core Qgis functionality that could be a workaround? An already existing plugin that I have missed? A small python script?

Obviously, in order for this to work nicely with the timemanager plugin, this timeline should be displayed in the map canvas, not in the composer.

A solution for Qgis 2.0 would be nice but I could also live with something for 1.8.

If someone has an idea or (even better) has already implemented something similar, please raise your hand!

2 Answers 2


I'm not aware of an already existing solution. But if you want to get started on your own, you can add your own graphics items onto the map canvas.

Normally, such things would derive from QgsMapCanvasItem but in your case, as you probably don't want to place your item in map coordinates, but rather in screen coordinates, you should derive it from QGraphicsItem and assign that item to the mapCanvas.scene().

The following script should get you started. Just expand the paint method to your needs.

from qgis.PyQt.QtWidgets import QGraphicsItem
from qgis.PyQt.QtCore import QRectF

class TimelineItem(QGraphicsItem):
    def __init__(self, mapCanvas):
        QGraphicsItem.__init__(self, None, mapCanvas.scene())

    def boundingRect( self ):
        penWidth = 1
        return QRectF(10 - penWidth / 2, 10 - penWidth / 2, 200 + penWidth, 20 + penWidth)

    def paint(self, painter, option, widget):
        painter.drawRoundedRect(10, 10, 200, 20, 5, 5)

timelineItem = TimelineItem(iface.mapCanvas())

To get access to the timemanager information you can use code like this:

import TimeManager
ctrl = TimeManager.timemanager.control

  • If you have something useful, it would be much appreciated if you can share your results. Maybe it will even be included upstream. Aug 28, 2013 at 9:53
  • I don't promise anything on the short-term but if I manage to ge something working I'll definitely share. Thanks again Aug 28, 2013 at 13:26

Just a strategy,

QGIS supports graphs which can be attached to objects. Could you display your timeline in a pie graph for example. The pie graph could be associated with a point and could be based on an attribute table which supplies the data. A function could be written to update the attributes in the table and to regenerate the pie graph. Alternatively, a pie graph could be generated for one selected record in your data table and as the selected record changes, the pie graph updates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.