JavaScript Chart

Set the padding property of the jqxChart. Author: http://jqwidgets.com

by Vrushali Kulkarni

HTML

<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id='chartContainer' style="width:450px; height:400px"></div>

JavaScript

var data = [{
    Person: "Planning",
    M1_From: new Date('2/7/2017'),
    M1_To: new Date('2/27/2017')
  }, {
    Person: "Dev 1",
    M1_From: new Date('1/24/2017'),
    M1_To: new Date('2/13/2017')
  }, ];

  var toolTipCustomFormatFn = function(value, itemIndex, serie, group, categoryValue, categoryAxis) {
    var dataItem = data[itemIndex];
    return '<DIV style="text-align:left"><b>Team: ' + categoryValue +
      '</b><br />Start day: ' + value.from +
      '<br />End day: ' + value.to;
  };

  // prepare jqxChart settings
  var settings = {
    title: "Monthly Project Schedule",
    description: "Website update plan",
    enableAnimations: true,
    showLegend: true,
    padding: {
      left: 5,
      top: 5,
      right: 10,
      bottom: 5
    },
    titlePadding: {
      left: 90,
      top: 0,
      right: 0,
      bottom: 10
    },
    source: data,
    xAxis: {
      dataField: 'Person',
      unitInterval: 1,
      tickMarks: {
        visible: false,
        interval: 1,
        color: '#BCBCBC'
      }
    },
    colorScheme: 'scheme03',
    seriesGroups: [{
        orientation: 'horizontal',
        type: 'rangecolumn',
        columnsGapPercent: 50,
        toolTipFormatFunction: toolTipCustomFormatFn,
        valueAxis: {
          flip: true,
          //minValue: '1/1/2017',
          // maxValue: '2/28/2017',
          dataField: 'M1_From',
          type: 'date',
          baseUnit: 'day',
          labels: {
            angle: 90
          },
          title: {
            text: 'Day '
          },
          tickMarks: {
            color: '#BCBCBC'
          }
        },
        series: [{
          dataFieldFrom: 'M1_From',
          dataFieldTo: 'M1_To',
          displayText: 'Sprint 1',
          opacity: 1
        }, ],
      }

    ]
  };

  // setup the chart
  $('#chartContainer').jqxChart(settings);