<script type="text/javascript">
google.load('visualization', '1', {packages: ['corechart']});
function drawVisualization() {
// Populate the data table.
var dataTable = google.visualization.arrayToDataTable([
['Mon',20,28,38,45],
['Tues',31,38,55,66],
['Wed',50,55,77,80],
['Thurs',77,77,66,50],
['Fri',68,66,22,15],
], true);
// Draw the chart.
var chart = new google.visualization.CandlestickChart(document.getElementById('visualization'));
chart.draw(dataTable,
{
legend:'none',
width:600,
height:400,
hAxis.textStyle: {color: 'red', fontName: 'arial', fontSize: 10}
}
);
}
google.setOnLoadCallback(drawVisualization);
when I write this code in Google chart api playground and debug the code it give me uncaught syntax error. I am totally new in this api and I was exploring. So can anyone please tell me why this error occur?? The error occur when I add hAxis.textStyle option in the code.
Seems that Google docs is a bit funky there; I think that’s supposed to be an object:
hAxis: { textStyle: {color: 'red', fontName: 'arial', fontSize: 10} }