zoom function on date not working continious vs discrete

28 views
Skip to first unread message

Karl Venter

unread,
May 23, 2021, 4:40:27 AMMay 23
to Google Visualization API
Hi All
I am having problems with zoom funtion in haxis
I have an array of data from PHP to Json to chart
i would like to zoom the h axis but suspect my data is not continious
The data points are taken at a specific time say 12:02:01 and next at say 12:02:59
so I have an array -- first point is time , them solar power then used power etc
I dont now how to change my 1st value (haxis value) so that the zoom function will work  
my chart var
///////////////////////////////////////////////////////////////////////////////////////////////////
fo var options = {
          crosshair: { orientation: 'both' },
          title: 'SOLAR POWER <?php echo ($new_date); ?>',
//           hAxis: { title: 'TIME', titleTextStyle: {color: 'red'},},
          hAxis: {title: 'TIME',  titleTextStyle: {color: '#333'},

                   slantedText:true, slantedTextAngle:80,
                        minValue: 0,    maxValue: 24, ticks: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]},

          vAxis: {title: 'POWER', minValue: 0},


           explorer: {
            actions: ['dragToZoom', 'rightClickToReset'],
            axis: 'horizontal',}
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////
my php array generator
 
for ($x = 0; $x <= (count($points)); $x+=1) {
$ar1 = array(date("H:i",strtotime(substr($points[$x][1],0,10))),intval($points[$x][$select1]),intval($points[$x][$select2]),intval($points[$x][$select3]),intval($points[$x][$select4]));

array_push($chartData1,$ar1);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
Any help would be apprecaited  -- PS I am very new at google charts

sample graph.PNG



Karl Venter

unread,
Jun 7, 2021, 10:21:48 AMJun 7
to Google Visualization API
Nobody here can help ?
Reply all
Reply to author
Forward
0 new messages