I am trying to show all values on h axis e.g. 12 13 14 15 16 17 18 19 20 currently it is displaying as image attached 12 14 16 18 20
I tried using 'ticks: dataTable.getDistinctValues(0);' does not working. My code is as follow <html><head><script type="text/javascript" src=" https://www.google.com/jsapi"></script><script type="text/javascript"> google.load("visualization", "1.1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('datetime', 'Dates'); data.addColumn('number','Glucose'); data.addColumn({type: 'string', role: 'tooltip', 'p': {'html': true}}); data.addColumn('number','Glucose'); data.addColumn({type: 'string', role: 'tooltip', 'p': {'html': true}}); data.addColumn('number','Glucose'); data.addColumn({type: 'string', role: 'tooltip', 'p': {'html': true}}); data.addColumn('number','Glucose'); data.addColumn({type: 'string', role: 'tooltip', 'p': {'html': true}}); data.addColumn('number','Glucose'); data.addColumn({type: 'string', role: 'tooltip', 'p': {'html': true}}); data.addColumn('number','Glucose'); data.addColumn({type: 'string', role: 'tooltip', 'p': {'html': true}}); data.addColumn('number','Glucose'); data.addColumn({type: 'string', role: 'tooltip', 'p': {'html': true}}); data.addRows([ [new Date(2014,1,7,11,25,0,0), 110.00, '02 feb - 11:25 | 110.00\nSunday', null, null, null, null, null, null, null, null, null, null, null, null], [new Date(2014,1,7,11,26,0,0), null, null, null, null, 150.00, '04 feb - 11:26 | 150.00\nTue', null, null, null, null, null, null, null, null], [new Date(2014,1,7,11,35,0,0), null, null, null, null, null, null, 90.00, '05 feb - 11:35 | 90.00\nHhgg', null, null, null, null, null, null], [new Date(2014,1,7,11,36,0,0), null, null, null, null, null, null, null, null, 70.00, '06 feb - 11:36 | 70.00\nHhj', null, null, null, null], [new Date(2014,1,7,11,54,0,0), null, null, null, null, 100.00, '04 feb - 11:54 | 100.00\nCc', null, null, null, null, null, null, null, null], [new Date(2014,1,7,13,27,0,0), null, null, null, null, null, null, 258.00, '05 feb - 13:27 | 258.00\nThu', null, null, null, null, null, null], [new Date(2014,1,7,15,57,0,0), null, null, null, null, 123.00, '04 feb - 15:57 | 123.00\nGhgggf', null, null, null, null, null, null, null, null], [new Date(2014,1,7,20,0,0,0), null, null, null, null, null, null, null, null, null, null, null, null, 120.00, '01 feb - 20:00 | 120.00\nSat'], [new Date(2014,1,7,20,42,0,0), null, null, 115.00, '03 feb - 20:42 | 115.00\nMon', null, null, null, null, null, null, null, null, null, null] ]); var chart = new google.visualization.ScatterChart(document.getElementById('chart_div')); chart.setAction({ id: 'sample', text: 'Ver detalles', action: function() { selection = chart.getSelection(); var selectedRow = selection[0].row; window.location.href = "yourapp://"+selectedRow; } }); chart.draw(data, {width: 280, height: 140, actionsMenu: {textStyle: {color: '#343434',fontName: 'verdana',fontSize:12}}, chartArea:{top:20,left:35,width: '85%',height: '70%'}, legend: { position: 'bottom', alignment:'start'}, backgroundColor:'transparent', legend: {position: 'none'}, titleTextStyle:{color: 'black', fontName: 'verdana', fontSize: 8}, hAxis: {format: 'H', textStyle: {color: '#343434',fontName: 'verdana',fontSize:6},baselineColor:'transparent',gridlineColor: 'transparent',viewWindowMode:'explicit', viewWindow:{ min: new Date(2014,1,7,11,25,0,0), max: new Date(2014,1,7,20,42,0,0)}}, vAxis: {title:'Glucosa',textStyle: {color: '#343434',fontName: 'verdana',fontSize:6},baselineColor:'transparent',gridlineColor: 'transparent'}, fontSize: 6, tooltip:{textStyle:{color: '#343434', fontName:'verdana',fontSize: 10},trigger: 'selection'}, series: { 0:{color: '#CCCCCC', visibleInLegend:true, pointSize:6}, 1:{color: '#ffff00', visibleInLegend:true, pointSize:6}, 2:{color: '#ff0000', visibleInLegend:true, pointSize:6}, 3:{color: '#0000ff', visibleInLegend:true, pointSize:6}, 4:{color: '#008000', visibleInLegend:true, pointSize:6}, 5:{color: '#696969', visibleInLegend:true, pointSize:6}, 6:{color: '#ff00ff', visibleInLegend:true, pointSize:6} },}); google.visualization.events.addListener(chart, 'click', function(e) { var targetType = e.targetID ? e.targetID.split('#')[0] : null; if (targetType && targetType !== 'point' && targetType !== 'action' && targetType !== 'tooltip') { chart.setSelection([]); } }); } </script> </head><body style="-webkit-tap-highlight-color: rgba(0,0,0,0);"> <div id="chart_div"></div></head></html> -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/groups/opt_out.
<<attachment: IMG_2034.PNG>>
