【发布时间】:2020-04-29 17:49:44
【问题描述】:
当数据被填充时,它会到达行的顶部。有没有限制顶部的选项,我需要显示带有货币符号的数字。
我需要更改 x 轴以显示超过上限。有什么选择吗
<Bar
data={incomePropertyData}
width={100}
height={450}
options={{
maintainAspectRatio: false,
legend: {
display: true,
fontColor: "#686868",
fontFamily: "kanit, sans-serif",
},
tooltips: {
titleAlign: "center",
titleMarginBottom: 8,
bodyFontFamily: "'Nunito', sans-serif",
callbacks: {
label: function (tooltipItem, data) {
var label =
data.datasets[tooltipItem.datasetIndex].label || "";
if (label) {
label += " : ";
}
label += "₹ " + tooltipItem.yLabel;
return label;
},
},
},
responsive: true,
scales: {
yAxes: [
{
ticks: {
fontFamily: "'Nunito', sans-serif",
fontSize: 14,
},
},
],
yAxes: [
{
ticks: {
fontFamily: "'Nunito', sans-serif",
fontSize: 14,
beginAtZero: true,
callback: function (value, index, values) {
return "₹ " + value;
},
},
},
],
},
}}
/>
【问题讨论】:
-
你能发布一些代码
-
这是代码 sn-p。
标签: reactjs chart.js react-chartjs chartjs-2.6.0