os dejo el codigo por si alguien pudiera ayudarme
Código HTML:
Ver original
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ var datos2; var dani=$.getJSON("https://api.humanapi.co/v1/human/blood_pressure/readings?access_token=demo",function(data){ var datos; datos=""; $.each( data, function( key, val ) { //alert('id:'+val.id+'\r\n'+'UserId:'+val.userId+'\r\ntimestamp:'+val.timestamp+'\r\n systolic:'+val.systolic+'\r\n timestamp:'+val.diastolic+'\r\ndiastolic:'+val.timestamp+'\r\n unit:'+val.unit); //alert("period:2500,Systolic: 2666,Diastolic: null,HeartRate: 2647"); datos+= "{period: '2010 Q1',Systolic: "+val.systolic+",Diastolic: "+val.diastolic+",HeartRate: "+val.heartRate+"},"; }); dani.done(function() { alert('ha cargado'); //console.log( "second success" ); alert(datos); var undato="dani"; Morris.Area({ element: 'morris-area-chart', /* data: [{ period: '2010 Q1', Systolic: 2666, Diastolic: null, HeartRate: 2647 }, { period: '2010 Q2', iphone: 2778, ipad: 2294, itouch: 2441 }, { period: '2010 Q3', iphone: 4912, ipad: 1969, itouch: 2501 }, { period: '2010 Q4', iphone: 3767, ipad: 3597, itouch: 5689 }, { period: '2011 Q1', iphone: 6810, ipad: 1914, itouch: 2293 }, { period: '2011 Q2', iphone: 5670, ipad: 4293, itouch: 1881 }, { period: '2011 Q3', iphone: 4820, ipad: 3795, itouch: 1588 }, { period: '2011 Q4', iphone: 15073, ipad: 5967, itouch: 5175 }, { period: '2012 Q1', iphone: 10687, ipad: 4460, itouch: 2028 }, { period: '2012 Q2', iphone: 8432, ipad: 5713, itouch: 1791 }]*/ data:undato, xkey: 'period', ykeys: ['Systolic', 'Diastolic', 'HeartRate'], labels: ['Systolic', 'Diastolic', 'HeartRate'], pointSize: 2, hideHover: 'auto', resize: true }); }) }); }); </script>