Accepted answer

I've not used NVD3 in Python but I could point you out how its done using the JavaScript library. Here's the answers to your questions.

  1. By default NVD3 reduces the amount of ticks rendered in the chart based on the chart width.

    a) One way of showing more ticks on your chart XAxis is to increase the width of the chart. Maybe not the best way but it works.

    chart = lineChart(..., width="500").

    b) Another way is by defining the points you want displayed on the chart and passing it as an array to the chart. Check line 29 here.


    Keep in mind the tick labels might overlap depending on the width of the chart and the amount you are trying to display in a chart

  2. Append the % at the end of the tick when rendered.

    chart.yAxis.tickFormat(function (d) {
        var format = d3.format(",.f");
        return format(d) + '%';
  3. You can pass the date as it is e.g: 1998-02-11 More information on date & time parsing here

    var format = d3.time.format("%Y-%m-%d");
    format.parse("1998-02-11"); // returns a Date
    format(new Date(1998, 02, 11)); // returns a string

Hope this help you.

Related Query

More Query from same tag