Trying to create a line chart using the Google Chart API, I encountered an issue. Everything seems to work fine when I use arrayToDataTable and the chart looks good.
Check out the first example here
However, when I populate a data object with the necessary data, it appears as if it's being cut off from the right side.
See the second example here for comparison
The options in both examples are set the same way:
var options = {
height: 245,
width: '100%',
chartArea: {top: 15, left: 30, width: '100%', height: 190},
areaOpacity: 0.1,
tooltip: {trigger: 'both'},
legend: 'none',
pointSize: 5,
hAxis: {
format: 'MM-dd',
gridlines: {
color: '#fff',
count: 365 /* \_(ツ)_/ */
},
textStyle: {
fontSize: 11
}
},
vAxis: {
gridlines: {
color: '#dedede',
count: 5
},
viewWindow: {
min: 0
},
textStyle: {
fontSize: 11
},
baselineColor: 'dedede'
}
};
Note: The width is set to 100% as the page is dynamic and used on mobile devices.
UPDATE: The display issue persists even after updating.
Click here for the latest update
FINAL UPDATE: The problem was related to the Date type in the Google Chart API and the 100% width implementation.