I want to switch between showing actual values ββand percentages on a scale. Currently, the data is imported from the csv file, and I am processing csv to find the domain for the data and display the graph in order. I can switch to showing percent because the axis area becomes from 0 to 100, but I want to be able to return to the actual data domain without processing the csv file.
Is it possible to bind data to an axis so that I can get it? Something like that:
vis.append("g") .data([calculated_y_domain, [0, 100]]) .attr("class", "axis yaxis") .attr("transform", "translate("+padding+",0)") .call(yAxis);
Or is there a better approach?
Here is an example of http://bl.ocks.org/3131368 which I am in the process of cleaning, but the way I do this will depend on the best approach for switching the axis.
source share