Is it possible to start the graph from a negative value to a positive one?
ACTUAL
EXPECTED:
That is, the value starts from a negative number and extends to the positive defined in the dataset.
var canvas = document.getElementById('myChart');
var data = {
labels: ["January"],
datasets: [
{
label: "My First dataset",
backgroundColor: "rgba(255,99,132,0.2)",
borderColor: "rgba(255,99,132,1)",
borderWidth: 2,
hoverBackgroundColor: "rgba(255,99,132,0.4)",
hoverBorderColor: "rgba(255,99,132,1)",
data: [100],
}
]
};
var option = {
scales: {
yAxes:[{
stacked:true,
gridLines: {
display:true,
color:"rgba(255,99,132,0.2)"
}
}],
xAxes:[{
gridLines: {
display:false
}
}]
}
};
var myBarChart = Chart.Bar(canvas,{
data:data,
options:option
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.bundle.js"></script>
<canvas id="myChart" width="400" height="200"></canvas>
Jsfiddle link