added .xTickFormat() and .yTickFormat() API methods to make chart axis public I/F as capable as that of lineWithFocus.js - from which this code was ripped and then adjusted to compensate for the slightly different way the 2nd x and y axis are named internally.
This commit is contained in:
parent
c856a295e4
commit
ef3a7aefb0
17
nv.d3.js
17
nv.d3.js
@ -3741,6 +3741,23 @@ nv.models.lineWithFocusChart = function() {
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Chart has multiple similar Axes, to prevent code duplication, probably need to link all axis functions manually like below
|
||||
chart.xTickFormat = function(_) {
|
||||
if (!arguments.length) return xAxis.tickFormat();
|
||||
xAxis.tickFormat(_);
|
||||
x2Axis.tickFormat(_);
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.yTickFormat = function(_) {
|
||||
if (!arguments.length) return yAxis.tickFormat();
|
||||
yAxis.tickFormat(_);
|
||||
y2Axis.tickFormat(_);
|
||||
return chart;
|
||||
};
|
||||
|
||||
|
||||
return chart;
|
||||
}
|
||||
|
||||
|
6
nv.d3.min.js
vendored
6
nv.d3.min.js
vendored
File diff suppressed because one or more lines are too long
@ -332,5 +332,22 @@ nv.models.lineWithFocusChart = function() {
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Chart has multiple similar Axes, to prevent code duplication, probably need to link all axis functions manually like below
|
||||
chart.xTickFormat = function(_) {
|
||||
if (!arguments.length) return xAxis.tickFormat();
|
||||
xAxis.tickFormat(_);
|
||||
x2Axis.tickFormat(_);
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.yTickFormat = function(_) {
|
||||
if (!arguments.length) return yAxis.tickFormat();
|
||||
yAxis.tickFormat(_);
|
||||
y2Axis.tickFormat(_);
|
||||
return chart;
|
||||
};
|
||||
|
||||
|
||||
return chart;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user