Hide axis #9077
-
Hello, Is it possible to hide an axis while keeping the ticks? Or change an axis' color, ... It's possibile to hide the axis but it hides the ticks as well:
In chart.js 2 it was possible with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
If I understand you correctly you want to use |
Beta Was this translation helpful? Give feedback.
-
Are you sure this should still be working with version 4.x? var stockChart = new Chart(stockChartElement, {
"type": "line",
"data": {
"datasets": [],
"labels": []
},
"options": {
"responsive": true,
"maintainAspectRatio": false,
"scales": {
"x": {
"grid": {
"display": false
}
},
"y-quantity": {
"type": "linear",
"display": true,
"grid": {
"drawBorder": false, /* attempt 1 */
"zeroLineWidth": 0 /* attempt 2*/
},
"min": 0,
"ticks": {
"precision": 0
},
"position": "left"
},
"y-price": {
"type": "linear",
"display": true,
"grid": {
"drawBorder": false, /* attempt 1 */
"drawOnChartArea": false,
"zeroLineWidth": 0 /* attempt 2 */
},
"min": 0,
"ticks": {
"precision": 0
},
"position": "right"
}
}
}
}); ; with no result: do you have an idea how to hide the two y axises? |
Beta Was this translation helpful? Give feedback.
If I understand you correctly you want to use
drawOnChartArea: false
instead ofdisplay: false