Commit 05707358 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Introduce bar.width.max - #174

parent c7288d84
...@@ -257,6 +257,7 @@ ...@@ -257,6 +257,7 @@
// bar // bar
var __bar_width = getConfig(['bar', 'width']), var __bar_width = getConfig(['bar', 'width']),
__bar_width_ratio = getConfig(['bar', 'width', 'ratio'], 0.6), __bar_width_ratio = getConfig(['bar', 'width', 'ratio'], 0.6),
__bar_width_max = getConfig(['bar', 'width', 'max']),
__bar_zerobased = getConfig(['bar', 'zerobased'], true); __bar_zerobased = getConfig(['bar', 'zerobased'], true);
// area // area
...@@ -2166,7 +2167,8 @@ ...@@ -2166,7 +2167,8 @@
//-- Bar --// //-- Bar --//
function getBarW(axis, barTargetsNum) { function getBarW(axis, barTargetsNum) {
return typeof __bar_width === 'number' ? __bar_width : barTargetsNum ? (axis.tickOffset() * 2 * __bar_width_ratio) / barTargetsNum : 0; var w = typeof __bar_width === 'number' ? __bar_width : barTargetsNum ? (axis.tickOffset() * 2 * __bar_width_ratio) / barTargetsNum : 0;
return __bar_width_ratio && w > __bar_width_max ? __bar_width_max : w;
} }
//-- Type --// //-- Type --//
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
}, },
bar: { bar: {
width: { width: {
ratio: 0.3 ratio: 0.3,
// max: 30
}, },
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment