AnsweredAssumed Answered

Cedar chart not updating

Question asked by bem08c on Dec 23, 2016

HI all. I'm using Cedar to build a chart on a website. The data for the chart is being pulled from a Survey123 layer. This way when I submit something to Survey123 the chart will be automatically. My problem is that when I submit somthing to Survey123 my chart is not updating when the page is reloaded. Does anyone see anything wrong with my chart code? Im very new to JavaScript..




  var chart = new Cedar({"type": "bar-horizontal"});

  //create the dataset w/ mappings
  var dataset = {
    "query": {
      "groupByFieldsForStatistics": "field_0",
      "outStatistics": [{
        "statisticType": "count",
        "onStatisticField": "field_0",
        "outStatisticFieldName": "Number_of_SUM"
      "y": {"field":"field_0","label":"Food?"},
      "x": {"field":"Number_of_SUM","label":"# of Eats"}
  //show the chart{
    elementId: "#chart"
  //assign to the chart
  chart.dataset = dataset;