Search code examples
javascriptc3.js

C3.js : Months name are not showing continuously


I am using C3.js to plot below graph but months name are not showing continuously on x-axis even data is showing, please let me know how can I resolve it for x-axis data should be like [mar-2017 , April-2017,May-2017,June-2017,July-2017...so on]

enter image description here

 var chart = c3.generate({
    bindto: bindingElement,
    data: {
        x:'x',
        columns: plotData,
        order:false,
        type: 'bar',
        groups: datagroup
      },
            bar: {
        width: {
            ratio: 0.70 
        }
        },
      axis: {
        x: {
        type: 'timeseries',
          tick: {
            rotate: 30,
            format: '%b%Y'
          }
        }
      }
  });

Solution

  • Try setting axis.x.tick.culling to false:

    axis: {
      x: {
        tick: {
          culling: false
        }
      }
    }
    

    It prevents c3 from hiding particular ticks.