Browse Source

Merge remote-tracking branch 'philt2001/master'

pull/91/merge
Florian Mounier 11 years ago
parent
commit
0df9f1a443
  1. 3
      pygal/config.py
  2. 3
      pygal/graph/datey.py

3
pygal/config.py

@ -213,6 +213,9 @@ class Config(object):
y_label_rotation = Key(
0, int, "Label", "Specify y labels rotation angles", "in degrees")
x_label_format = Key(
"%Y-%m-%d %H:%M:%S.%f", str, "Label", "Date format for strftime to display the DateY X labels")
############ Value ############
human_readable = Key(
False, bool, "Value", "Display values in human readable format",

3
pygal/graph/datey.py

@ -50,7 +50,8 @@ class DateY(XY):
def _todate(self, d):
""" Converts a number to a date """
return str(self._offset + datetime.timedelta(seconds=d or 0))
currDateTime = self._offset + datetime.timedelta(seconds=d or 0)
return currDateTime.strftime( self.x_label_format )
def _tonumber(self, d):
""" Converts a date to a number """

Loading…
Cancel
Save