Skip to content
Snippets Groups Projects
Commit 1e7c08a1 authored by Tom Robinson's avatar Tom Robinson
Browse files

Reduce padding on histogram scales

parent 2d7afb56
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import { parseTimestamp } from "metabase/lib/time";
import { computeTimeseriesTicksInterval } from "./timeseries";
import { getFriendlyName } from "./utils";
import { isHistogram } from "./renderer_utils";
// label offset (doesn't increase padding)
const X_LABEL_PADDING = 10;
......@@ -273,6 +274,11 @@ export function applyChartOrdinalXAxis(chart, series, { xValues }) {
chart.xAxis().tickFormat("");
}
if (isHistogram(chart.settings)) {
// reduces x axis padding. see https://stackoverflow.com/a/44320663/113
chart._outerRangeBandPadding(0);
}
chart.x(d3.scale.ordinal().domain(xValues)).xUnits(dc.units.ordinal);
}
......
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