일부 디버그?
SCRIPT
<script src="https://www.gstatic.com/charts/loader.js"></script>
////Callback that draws the scatter
function draw0RiskChart() {
var data = google.visualization.arrayToDataTable([
['Risk in %', 'Return in %'],
[ 9.87, 6.53]
]);
var options = {
title: 'Risk vs. Return with 0% Hedge Fund',
hAxis: {title: 'Risk', minValue: 5, maxValue: 10},
vAxis: {title: 'Return', minValue: 5, maxValue: 10},
width:400,
height:300
};
var container = new google.visualization.ScatterChart(document.getElementById('0risk_chart_div'));
var chart = new google.visualization.ScatterChart(container);
// Wait for the chart to finish drawing before calling the getImageURI() method.
google.visualization.events.addListener(chart, 'ready', function() {
var layout = chart.getChartLayoutInterface();
container.innerHTML = '<img src="' + chart.getImageURI() + '">';
for (var i = 0; i < data.getNumberOfRows(); i++) {
// add image above in every element
var xPos = layout.getXLocation(data.getValue(i, 0));
var yPos = layout.getYLocation(data.getValue(i, 1));
var whiteHat = container.appendChild(document.createElement('img'));
whiteHat.src = 'http://findicons.com/files/icons/512/star_wars/16/clone_old.png';
whiteHat.className = 'whiteHat';
// 16x16 (image size in this example)
whiteHat.style.top = (yPos - 16) + 'px';
whiteHat.style.left = (xPos) + 'px';
}
console.log(container.innerHTML);
});
chart.draw(data, options);
}
STYLE
.whiteHat {
border: none;
position: absolute;
}
BODY
<div id="0risk_chart_div"></div>
저는 금융에 관해서는 전혀 알지 못하지만 공통점이없는 것 같습니다 ...? – zer00ne
그들은 실제로 그 점을 이미지로 대체 할 수는 없지만 어쩌면 그럴 수 있습니까? – brotherperes
분산 형 차트의 [포인트] (https://developers.google.com/chart/interactive/docs/points)는 사각형 및 별처럼 크기와 모양이 수정 될 수 있습니다. – zer00ne