Browser Settings?

16 views
Skip to first unread message

Rebecca

unread,
May 23, 2017, 12:35:37 PM5/23/17
to Google Visualization API
We are using a simple line chart to display data. 

Generally its perfect, however I have 2 specific computers on the latest version of chrome where the chart does not load.
It does not throw any Jacascript error, its simply doesn't load.

I've pasted the code below.
Can you advise if this may be related to the browser- and what can be done to rectify.
Thank you.



        function drawTemperatureChart(JSONData, buildingID, virtualID, fromDate) {
            
            var year = fromDate.split('-')[0];
            var month = fromDate.split('-')[1];
            var date = fromDate.split('-')[2];

            var dateSelected = new Date(year, month - 1, date);
            var prevDate = new Date(dateSelected - (1000 * 60 * 60 * 24));//1000 ms * 60 sec * 60 min * 24 hours
            
            try {
                var data = new google.visualization.DataTable(JSONData);
                var minPipe = data.getColumnRange(1).min;
                var minRoom = data.getColumnRange(2).min;
                var minY = Math.min(minPipe, minRoom) - 15;
            }
            catch (err) {
                alert(err);
            }
           
            var options_lines = {
                curveType: 'function',
                backgroundColor: 'transparent',
                axisTitlesPosition: 'out',
                chartArea: {
                    width: '95%',
                    height: '75%',
                    right: 20,
                    //bottom: -30
                },
                legend: { position: 'none' },
                interpolateNulls: true,
                hAxis: {
                    textPosition: 'bottom',
                    format:'haa',
                    textStyle: {
                        color: '#b1b1b1',
                        fontSize: 9
                    },
                    gridlines: {
                        color: 'transparent',
                        count: 15
                    },
                    viewWindow: {
                        min: new Date(prevDate.getFullYear(), prevDate.getMonth(), prevDate.getDate(), 22, 00),
                        max: new Date(dateSelected.getFullYear(), dateSelected.getMonth(), dateSelected.getDate(), 23, 59)
                    }
                },
                vAxis: {
                    textStyle: {
                        fontSize: 11
                    },
                   
                    viewWindow: {
                        min: minY
                    }
                }
            };
            
            try {
                var chart_lines = new google.visualization.LineChart(document.getElementById('tempChart_' + buildingID + '_' + virtualID));
            }
            catch (err) {
                alert(err);
            }
            chart_lines.draw(data, options_lines);
)
Reply all
Reply to author
Forward
0 new messages