Browse Source

Add axis.x.min and axis.x.max - #74

pull/80/merge
Masayuki Tanaka 11 years ago
parent
commit
c60b63b6f7
  1. 8
      c3.js
  2. 4
      c3.min.js

8
c3.js

@ -89,6 +89,8 @@
__axis_x_tick_format = getConfig(['axis', 'x', 'tick', 'format'], null),
__axis_x_tick_culling = getConfig(['axis', 'x', 'tick', 'culling'], __axis_x_type === 'categorized' ? false : true),
__axis_x_tick_count = getConfig(['axis', 'x', 'tick', 'count'], 10),
__axis_x_max = getConfig(['axis', 'x', 'max'], null),
__axis_x_min = getConfig(['axis', 'x', 'min'], null),
__axis_x_default = getConfig(['axis', 'x', 'default'], null),
__axis_x_label = getConfig(['axis', 'x', 'label'], null),
__axis_y_max = getConfig(['axis', 'y', 'max'], null),
@ -872,10 +874,10 @@
return isSub || currentDiff === 0 ? 1 : orgDiff / currentDiff;
}
function getXDomainMin(targets) {
return d3.min(targets, function (t) { return d3.min(t.values, function (v) { return v.x; }); });
return __axis_x_min ? __axis_x_min : d3.min(targets, function (t) { return d3.min(t.values, function (v) { return v.x; }); });
}
function getXDomainMax(targets) {
return d3.max(targets, function (t) { return d3.max(t.values, function (v) { return v.x; }); });
return __axis_x_max ? __axis_x_max : d3.max(targets, function (t) { return d3.max(t.values, function (v) { return v.x; }); });
}
function getXDomainPadding(targets, domain) {
var firstX = domain[0], lastX = domain[1], diff = Math.abs(firstX - lastX), maxDataCount, padding;
@ -3055,7 +3057,7 @@
function updateLegend(targets, options) {
var ids = getTargetIds(targets), l;
var xForLegend, xForLegendText, xForLegendRect, yForLegend, yForLegendText, yForLegendRect;
var paddingTop = 4, paddingRight = 26, maxWidth, maxHeight, posMin = 10;
var paddingTop = 4, paddingRight = 26, maxWidth = 0, maxHeight = 0, posMin = 10;
var totalLength = 0, offsets = {}, widths = {}, heights = {}, margins = {}, steps = {}, step = 0;
var withTransition;

4
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save