Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Plot #6

Open
pabloariasmora opened this issue Jan 21, 2018 · 0 comments
Open

Time Plot #6

pabloariasmora opened this issue Jan 21, 2018 · 0 comments

Comments

@pabloariasmora
Copy link

pabloariasmora commented Jan 21, 2018

Hi!
I'm trying to plot time chart, time(hours) vs temperature.

class simple_time_chart(_DrawingEditorMixin, Drawing):
    def __init__(self, width=600, height=400, *args, **kw):
        Drawing.__init__(self, width, height, *args, **kw)
        self._add(self, SimpleTimeSeriesPlot(), name='chart', validate=None,
                  desc=None)
        self.chart.x = 30
        self.chart.y = 30
        self.chart.height = 90
        self.chart.yValueAxis.forceZero = 0
        self._add(self, String(10, 10, 'text'), name='title', validate=None,
                  desc=None)
        self.title.text = 'Prueba'
        self.title.fontSize = 16
        self.chart.lines[0].strokeColor = PCMYKColor(100, 0, 90, 50, alpha=100)
        self.chart.lines.strokeWidth = 1
        self.chart.xValueAxis.labelTextFormat  = '{dd} {mm} {YY} {HH}:{MM}:{SS}'
        self.chart.data = [[('21 01 2018 15:23:27', 10), ('21 01 2018 15:24:14', 100), ('21 01 2018 15:24:24', 200), ('21 01 2018 15:24:26', 30)]]
        self.chart.width = 335
        self.title.y = 160
        self.title.x = 115

simple_time_chart (width=600, height=400)

But it fails showing this error:

reportlab.lib.normalDate.NormalDateException: unable to setNormalDate('21 01 2018 15:23:27')

As far as I could understand on the NormalDate class hours are not allowed. So in order to create a graph with time as part of it, what will be the best approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant