areski / django-nvd3

Django wrapper for nvd3 - It's time for beautiful charts
Other
416 stars 124 forks source link

y-axis labels #62

Open eckara opened 8 years ago

eckara commented 8 years ago

Thanks for the great wrapper! Is there a way to add y-axis labels to lineCharts? Could not find any documentation.

eckara commented 8 years ago

Here is a temporary hack for the above:

var plot=d3.select('#linechart_container'); 
plot.append("text")
      .attr("x", x2_loc)
          .attr("y", y2_loc)
      .attr("dy", ".35em")
      .attr("dx", "-1em")
      .style("fill", "black")
      .style("text-anchor", "center")
      .attr("transform", function(d) {
                return "rotate(-90)" 
                })
      .text('YLABEL');

plot.append("text")
  .attr("x", x1_loc)
  .attr("y", y1_loc)
  .attr("dy", ".35em")
  .attr("dx", "-1em")
  .style("fill", "black")
  .text('XLABEL');
harrelm commented 8 years ago

What is x1_loc etc.?