Search code examples
gantt-chartcolumn-widthanychart

How to set month Column width in AnyGantt?


Is it possible to change the width of month column in AnyGantt from AnyChart ?

This how my table look like

anychart.onDocumentReady(function() {
      // create data tree on our data
      var treeData = anychart.data.tree(getData(), anychart.enums.TreeFillingMethod.AS_TABLE);

      // create resource gantt chart
      chart = anychart.ganttResource();

      // set container id for the chart
      chart.container("container");

      // set data for the chart
      chart.data(treeData);

      // set start splitter position settings
      chart.splitterPosition(200);

      // get chart data grid link to set column settings
      var dataGrid = chart.dataGrid();

      // initiate chart drawing
      chart.draw();

Solution

  • Are you looking for zoom control?

    chart.xScale().minimum(Date.UTC(2000, 1, 2));    
    chart.xScale().maximum(Date.UTC(2000, 3, 6));
    
    // Set zoom to range.
    chart.zoomTo("week", 2, "firstDate");
    

    https://api.anychart.com/7.14.3/anychart.charts.Gantt#zoomTo https://playground.anychart.com/api/7.14.3/charts/anychart.charts.Gantt.zoomTo_set_asInterval-plain

    Also, there are:

    https://api.anychart.com/7.14.3/anychart.charts.Gantt#fitAll
    https://api.anychart.com/7.14.3/anychart.charts.Gantt#zoomIn
    https://api.anychart.com/7.14.3/anychart.charts.Gantt#zoomOut