Hello.
I need to create a ScatterChart with axis X and Y in logarithmic scale and with a power trendline but, as far as I know, Google Charts only supports three types of trendlines (linear, polynomial, and exponential) but not power trendlines. Is there any way to add power trendlines?
I copy a sample of my source code at the end of this message. Attached you can find an image with the result (made with Excel) which I'm looking for.
Thanks a lot.
<html>
<head>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['serie1', 'serie2'],
[0.02891, 750.0],
[0.01292, 750.0],
[0.01385, 750.0],
[0.01487, 750.0],
[1.60000, 1.48161],
[1.70000, 1.90133],
[2.30000, 0.95124],
[27.70000, 0.11861],
[50.00000, 0.06090],
[178.50000, 0.01314],
[11.10000, 0.24285]
]);
var options = {
hAxis: {scaleType:'log'},
vAxis: {scaleType:'log'},
chartArea: {width:'50%'},
trendlines: {
0: {
type: 'linear',
showR2: true,
visibleInLegend: true
}
}
};
var chartLinear = new google.visualization.ScatterChart(document.getElementById('chartLinear'));
chartLinear.draw(data, options);
}
</script>
</head>
<body>
<div id="chartLinear" style="height: 350px; width: 800px"></div>
</body>
</html>