This example uses the built in "pie" chart type and also demonstrates how to use a SQL expression in your query and include the output in your chart.

  var chart = new Cedar({"type":"pie"});

  // build a SQL case when expression that
  // converts month numbers to abbreviations
  var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
  var groupByExpression = "CASE ";
  for (var i = 1, len = months.length; i <= len; i++) {
    var month = months[i - 1];
    groupByExpression = groupByExpression + "WHEN Month = " + i + " THEN '" + month + "'";
  }
  groupByExpression = groupByExpression + " END";

  var datasets = [
    {
      "url":"https://services.arcgis.com/bkrWlSKcjUDFDtgw/arcgis/rest/services/It's_a_Tornado_Map/FeatureServer/0",
      "query": {
        "orderByFields": "FID_Count DESC",
        // because we're using an expression here
        // this will be named EXPR_1 in the JSON response's attributes
        "groupByFieldsForStatistics": groupByExpression,
        "outStatistics": [{
          "statisticType": "count",
          // when counting records (not summing values)
          // it's best to use the id field because
          // it is guaranteed to have a value for every record
          "onStatisticField": "FID",
          "outStatisticFieldName": "FID_Count"
        }]
      }
    }
  ];
  var series = [
    {
      "category": {"field":"EXPR_1","label":"Month"},
      "value": { "field":"FID_Count","label":"Number of Tornados" },
      "radius": 270
    }
  ];
  chart.datasets = datasets;
  chart.series = series;


  chart.tooltip = {
    // this is the month abbreviation returned from the expresssion above
    "title": "{EXPR_1}",
    "content": "{FID_Count} tornados"
  }
  chart.show({
    elementId: "#chart",
    width: 600,
    height: 600,
    autolabels: false
  });