function drawChart() {
    var chart = new Cedar({"type":"bar"});

    //create the dataset w/ mappings
    var dataset = {
      "url":"https://services.arcgis.com/uDTUpUPbk8X8mXwl/arcgis/rest/services/Public_Schools_in_Onondaga_County/FeatureServer/0",
      "query": {
        "groupByFieldsForStatistics": "Zip",
        "outStatistics": [{
          "statisticType": "sum", 
          "onStatisticField": "Number_of", 
          "outStatisticFieldName": "Number_of_SUM"
        }]
      },
      "mappings":{
        "x": {"field":"Zip","label":"ZIP Code"},
        "y": {"field":"Number_of_SUM","label":"Total Students"}
      }
    };

    //assign to the chart
    chart.dataset = dataset;

    //show the chart
    chart.show({
      elementId: "#chart"
    });

    window.chart = chart;
  };


  drawChart();

  window.onresize = updateChart;

  function updateChart() {
    var el = document.getElementById("chart");
    var width = el.offsetWidth;

    var labels;
    if(width <= 200) {
      labels = {
        "fontSize": {"value": 0},
      }
    } else if (200 < width && width <= 600) {
      labels = {
        "angle": {"value": 50},
        "align": {"value": "left"},
        "baseline": {"value": "middle"}
      }
    } else {
      labels = {
        "angle": {"value": 0},
        "align": {"value": "center"},
        "baseline": {"value": "middle"}
      }
    }

    chart.override = {
      "axes": [{"properties": {
        "labels": labels
      }}]
    }

    chart.update();
  }