2014년 12월 31일 수요일

Re: [visualization-api] Annotated Timeline Chart

Do you think this looks right? When I run the script on jsfiddle it does not work.


 
<script type="text/javascript" src='https://www.google.com/jsapi?autoload={
        "modules":[{
        "name":"visualization",
        "version":"1"
        }]
      }'></script>
<script type="text/javascript">
    google.setOnLoadCallback(drawVisualization);

    function drawVisualization() {
        var wrap = new google.visualization.ChartWrapper({
            'chartType': 'AnnotationChart',
                'containerId': 'visualization',
                'query': 'SELECT A,C',
                 'options':var options = {
  chart: {   ?????
    hAxis: {    ?????
      gridlines: {    ?????                      WHAT SHOULD I PUT IN THESE ROWS?
        units: {    ????/
          "days": {   ?????
            "format": [   ???? 
              "MM/dd/yyyy"]   }   }  }  }  }

        });
        wrap.draw();
    }
</script>
</head>
<body>
    <div id="visualization" style="height: 400px; width: 500px;"></div>
</body>

</html>



No, the value after the 'options:' should be just the variable options, if you move your "var options = ..." expression to before the ChartWrapper call.  Like this:

var options = ...
var wrap = new google.visualization.ChartWrapper({
   ..
  'options': options

}


댓글 없음:

댓글 쓰기