Is there a way to ensure the bubble chart boundaries don't cut off the bubbles? I attach a chart example as a png.
My code is as follows. Thanks very much!
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var jsonData = $.ajax({
url: "../../charts/chart_handler.php?chart=chart_bondRisk",
dataType:"json",
async: false
}).responseText;
var data = new google.visualization.DataTable(JSON.parse(jsonData)); // Create our data table out of JSON data loaded from server.
var options = {
hAxis: {title: 'Current allocation to bonds', minValue:-10},
vAxis: {title: 'Loss', maxValue:2},
chartArea: {top:10, left:100},
legend: {textStyle: {fontSize: 11}},
tooltip: {textStyle: {color: '#000000', fontSize: 11, fontName: "Trebuchet MS"}},
sizeAxis: {minSize:15, maxSize:30},
bubble: {textStyle: {fontSize: 11, fontName: "Trebuchet MS"}}
};
var chart = new google.visualization.BubbleChart(document.getElementById('chart'));
chart.draw(data, options);
// track user selection
google.visualization.events.addListener(chart, 'select', selectHandler);
function selectHandler() {
var selection = chart.getSelection(); // only 1 item selected at a time with bubble charts
// strategy = '{row:' + selection[0].row + '}';
strategy = data.getValue(selection[0].row,3); // return symbol from chart data table
// alert('Selected ' + strategy + ' as your champion portfolio?');
window.location.href = "chart_bondRisk.php?strategy=" + strategy; // transfer to processing page
}
}