Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions chartkick/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json
import itertools
import functools
from distutils.version import LooseVersion

import jinja2
from jinja2 import nodes
Expand Down Expand Up @@ -67,11 +68,7 @@ def _chart_support(self, name, data, caller, **kwargs):
options = dict(self.environment.options)
options.update(name=name, id=id)

# jinja2 prepends 'l_' or 'l_{{ n }}'(ver>=2.9) to keys
if jinja2.__version__ >= '2.9':
kwargs = dict((k[4:], v) for (k, v) in kwargs.items())
else:
kwargs = dict((k[2:], v) for (k, v) in kwargs.items())
kwargs = dict((k[4:], v) for (k, v) in kwargs.items())

if self._library is None:
self._library = self.load_library()
Expand Down
2 changes: 0 additions & 2 deletions chartkick/js/chartkick.js
Original file line number Diff line number Diff line change
Expand Up @@ -1273,11 +1273,9 @@
options.scales.xAxes[0].time.unit = "day";
step = 1;
} else if (hour || timeDiff > 0.5) {
options.scales.xAxes[0].time.displayFormats = {hour: "MMM D, h a"};
options.scales.xAxes[0].time.unit = "hour";
step = 1 / 24.0;
} else if (minute) {
options.scales.xAxes[0].time.displayFormats = {minute: "h:mm a"};
options.scales.xAxes[0].time.unit = "minute";
step = 1 / 24.0 / 60.0;
}
Expand Down