Thanks for a GREAT library. Having a lot of fun using this. Thanks for everyones effort.
When I set the xAxis
tick configuration to be mirror: true
I don't see the ticks mirrored. I think my config is correct but I'm a newbie here so hopefully I haven't committed a school boy error!
https://codepen.io/benfrain/pen/xrmzdE
var drawChart = function() {
var ctx = document.getElementById("chtChart").getContext("2d");
myChart = new Chart(ctx, {
type: "line",
data: {
labels: ["6", "5", "4", "3", "2", "Yesterday", "Today"],
datasets: [
{
label: "metric",
data: [3, 2, 6, 5, 3, 4, 8],
backgroundColor: "rgba(74, 207, 165, 0.1)",
borderColor: "rgb(74, 207, 165)",
borderWidth: 2,
lineTension: 0,
pointBackgroundColor: "rgb(74, 207, 165)",
yAxisID: "y-axis-0",
},
],
},
options: {
layout: {
padding: {
left: -10,
right: 0,
top: 10,
bottom: 10,
},
},
scales: {
yAxes: [
{
ticks: {
beginAtZero: false,
mirror: true,
},
gridLines: {
display: true,
borderDash: [4, 4],
color: "rgba(64,64,64,100)",
},
},
],
xAxes: [
{
display: true,
gridLines: {
display: false,
},
ticks: {
beginAtZero: true,
mirror: true,
},
},
],
},
legend: {
display: false,
},
},
});
};
drawChart();
With that config I was expecting the xAxis to display inside the chart area
The tick are displaying outside the chart area
Chrome or Safari
Chartjs v2.6.0
I think at the moment on vertical axes support mirroring. Should not be hard to implement for horizontal axes as well.
Most helpful comment
I think at the moment on vertical axes support mirroring. Should not be hard to implement for horizontal axes as well.