user2657817 user2657817 - 8 months ago 57
jQuery Question

Javascript: Add label at beginning and end of axes

I want to add to the beginning of the axes a label to indicate "not very important" and a label to the end of the axes "very important." I am using the following slider program:

As a beginner to JS, would appreciate your help on how it would be best to do that.

enter image description here

Answer Source

How about this:

<!DOCTYPE html>

  <link rel="stylesheet" type="text/css" href="" media="screen" />
  <script src=""></script>
  <script src=""></script>

  <div id="slider"></div>
    var tickFormatter = function(d) {
      return d === 0 ? "not important" : "very important"

    var slider = d3.slider().min(0).max(1).ticks(1).tickFormat(tickFormatter)'#slider').call(slider);".tick>text").style("text-anchor", "start");".tick:last-of-type>text").style("text-anchor", "end");