Skip to content
Snippets Groups Projects
Commit 647bae64 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #1394 from metabase/skinny_time_bars_fix

Fix skinny time series bar charts
parents ff187041 d54eaede
No related branches found
No related tags found
No related merge requests found
......@@ -224,6 +224,11 @@ function applyChartTimeseriesXAxis(chart, card, coldefs, data) {
// calculate the x-axis domain
chart.x(d3.time.scale().domain(xDomain));
// prevents skinny time series bar charts by using xUnits that match the provided column unit, if possible
if (coldefs[0] && coldefs[0].unit && d3.time[coldefs[0].unit + "s"]) {
chart.xUnits(d3.time[coldefs[0].unit + "s"]);
}
}
// mostly matches https://github.com/mbostock/d3/wiki/Time-Scales
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment