You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found it useful to create a feature that toggles the reset button similar to the examples in the annotated source, except using the visibility:hidden property instead of the display: none property.
I found that the appearance / disappearance of the reset button was impacting my page layout and making the charts jump around a bit: http://jsfiddle.net/6k8ytsfg/1/
I created a new CSS class for this feature (called "reset-hidden" instead of "reset") and added a few lines to the existing functions (noted with comments):
_chart.turnOnControls = function () {
if (_root) {
_chart.selectAll(".reset").style("display", null);
// added by Shannon
_chart.selectAll(".reset-hidden").style("visibility", null);
_chart.selectAll(".filter").text(_filterPrinter(_chart.filters())).style("display", null);
}
return _chart;
};
_chart.turnOffControls = function () {
if (_root) {
_chart.selectAll(".reset").style("display", "none");
// added by Shannon
_chart.selectAll(".reset-hidden").style("visibility", "hidden");
_chart.selectAll(".filter").style("display", "none").text(_chart.filter());
}
return _chart;
};
cherry-picking functionality from dev to master
and reversing the default for backward compatibility
fixes#888fixes#1016
changing bar chart spec to use the new functionality;
pie chart spec uses the old functionality
I found it useful to create a feature that toggles the reset button similar to the examples in the annotated source, except using the visibility:hidden property instead of the display: none property.
I found that the appearance / disappearance of the reset button was impacting my page layout and making the charts jump around a bit: http://jsfiddle.net/6k8ytsfg/1/
I created a new CSS class for this feature (called "reset-hidden" instead of "reset") and added a few lines to the existing functions (noted with comments):
Here is what the result looks like: http://tsaltas.github.io/2014-cleantech-investments/
I thought I would share since it's only a few extra lines.
Thanks,
Shannon
The text was updated successfully, but these errors were encountered: