0👍
I think you’re close. I think the only thing you need to do is to change your options and make a few minor modifications (it took a while for me to get it to work; originally, I tried what you had posted):
In your .js file:
$scope.data = [{
x: -10,
y: 0
}, {
x: 0,
y: 10
}, {
x: 10,
y: 5
}];
// The angular-chart directive will use this as the label
$scope.series = ['Scatter Dataset'];
$scope.options = {
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
}]
}
};
And then, in your html file:
<canvas class="chart chart-line"
chart-data="data"
chart-series="series"
chart-options="options">
</canvas>
- Chartjs-Generating different chart results on fly causes flickering
- Chartjs-I am trying to rotate an ellipse with an arbitrary angle in JavaScript. But the outcome is not even an ellipse
Source:stackexchange.com