Reputation: 83
Does anyone know how to create a line chart with a smooth line instead of a jagged line?
I think my chart would present much better to end users with a smooth line.
Here's an example URL:
Upvotes: 8
Views: 9183
Reputation: 20862
From Google Chart API docs:
You can smooth the lines by setting the curveType option to function
In code:
var options = {
title: 'Company Performance',
curveType: 'function',
legend: { position: 'bottom' }
};
Upvotes: 10
Reputation: 11
If you are using a line graph, you can always use curveType: 'function'
in your series options and that will make the "series" smooth.
Upvotes: 1
Reputation: 1821
I simply used
var options = {smoothLine: true,}
var chart = new google.visualization.LineChart(document.getElementById('some_id'));
chart.draw(data, options);
Disclaimer: if you have very sharp corners the rounding/smoothing can be misleading (for ex. if your curve goes quickly to f(x) = 0 it can become negative to fit the corner.
Upvotes: 8