I am using google.visualization.PatternFormat to format the url in the column into a hyperlink in Google Chart Table. The current approach will format the whole column into a hyperlink. I would like to skip the format if the cell in that column is empty.
function handleSampleDataQueryResponse(response) {
var data = response.getDataTable();
var format_demo = new google.visualization.PatternFormat(
'<a href="{0}">Link</a>');
format_demo.format(data, [7]);
var chartTbl = new google.visualization.Table(document.getElementById('dataTable'));
chartTbl.draw(view, {showRowNumber: true, allowHtml: true, page: 'enable', pageSize: 5, width: '100%', height: '100%'
});
As the column is optional, I would like to leave the cell blank rather than have a hyperlink that will go nowhere.