Does this work for you?
If so, could you please explain what made it hard for you ? Perhaps we could
improve the documentation.

Unformatted code:

<html> <head>
<script type='text/javascript' src='http://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages':['annotatedtimeline']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable(
{
cols: [{label: 'Date', type: 'date'},
{label: 'Sold Pencils', type: 'number'},
{label: 'title1', type: 'string'},
{label: 'text1', type: 'string'},
{label: 'Sold Pens', type: 'number'},
{label: 'title2', type: 'string'},
{label: 'text2', type: 'string'}],
rows: [
{c:[{v: new Date(2008, 1 ,1)}, {v: 30000}, , , {v: 40645}]},
{c:[{v: new Date(2008, 1 ,2)}, {v: 14045}, , , {v: 20374}]},
{c:[{v: new Date(2008, 1, 3)}, {v: 55022}, , , {v: 50766}]},
{c:[{v: new Date(2008, 1, 4)}, {v: 75284}, , , {v: 14334},
{v: 'Out of Stock'}, {v: 'Ran out of stock on pens at 4pm'}]},
{c:[{v: new Date(2008, 1, 5)}, {v: 41476}, {v: 'Bought Pens'}, {v: 'Bought
200k pens'}, {v: 66467}]},
{c:[{v: new Date(2008, 1, 6)}, {v: 33322}, , , {v: 39463}]}]
}, 0.5);
var chart = new
google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));

chart.draw(data, {displayAnnotations: true});


}
</script>
</head>
<body>
<div id='chart_div' style='width: 700px; height: 240px;'></div>
</body>
</html>
Formatted code:

<html>  <head>
  <script type='text/javascript' src='http://www.google.com/jsapi'></script
>
  <script type='text/javascript'>
  google.load('visualization', '1', {'packages':['annotatedtimeline']});
  google.setOnLoadCallback(drawChart);
function drawChart() {
    var data = new google.visualization.DataTable(
      {
        cols: [{label: 'Date', type: 'date'},
               {label: 'Sold Pencils', type: 'number'},
               {label: 'title1', type: 'string'},
               {label: 'text1', type: 'string'},
               {label: 'Sold Pens', type: 'number'},
               {label: 'title2', type: 'string'},
               {label: 'text2', type: 'string'}],
        rows: [
          {c:[{v: new Date(2008, 1 ,1)}, {v: 30000}, , , {v: 40645}]},
          {c:[{v: new Date(2008, 1 ,2)}, {v: 14045}, , , {v: 20374}]},

          {c:[{v: new Date(2008, 1, 3)}, {v: 55022}, , , {v: 50766}]},

          {c:[{v: new Date(2008, 1, 4)}, {v: 75284}, , , {v: 14334},
              {v: 'Out of Stock'}, {v: 'Ran out of stock on pens at 4pm'}]},
          {c:[{v: new Date(2008, 1, 5)}, {v: 41476}, {v: 'Bought Pens'}, {v
: 'Bought 200k pens'}, {v: 66467}]},
          {c:[{v: new Date(2008, 1, 6)}, {v: 33322}, , , {v: 39463}]}]
      },   0.5);
    var chart = new google.visualization.AnnotatedTimeLine(document.
getElementById('chart_div'));
    chart.draw(data, {displayAnnotations: true});


  }
</script>
  </head>
  <body>
  <div id='chart_div' style='width: 700px; height: 240px;'></div>
  </body>
  </html>

Regards,
   VizBoy.

On Thu, Jan 29, 2009 at 4:21 PM, jago <[email protected]> wrote:

>
> Can somebody post the following Javascript example in JSon?
>
>
> http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html
>
> I try to rewrite this thing in JSon but fail. No clue where the
> problem is.
>
> Cheers,
> jago
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to