0
私は、システムで未解決の問題の数を数えた積み上げ棒グラフを設計しました。しかし、これらの問題があまりにも長い間開いている場合は、2本のグリッド線を置く必要があります。ChartJSの色に特化したグリッドライン
私は必要なもの:
OrderAgeOptions = {
observeChanges: true, throttle: 100,
title: { display: true, text: "Leeftijd openstaande tickets", fontFamily: 'ASSA Vesta Light', fontSize: 20, },
legend: { display: true, labels: { fontFamily: 'Open Sans', }, position: "top", },
maintainAspectRatio: false,
tooltips: { enabled: false },
hover: { animationDuration: 0 },
scales: {
xAxes: [{ ticks: { beginAtZero: true, fontFamily: "'Open Sans Bold', sans-serif", fontSize: 11, max: 175 }, scaleLabel: { display: true }, gridLines: {}, stacked: true }],
yAxes: [{ ticks: { fontFamily: "'Open Sans Bold', sans-serif", fontSize: 11 }, gridLines: { display: true, }, stacked: true }]
},
animation: { duration: 0.1, onComplete: function() { var chartInstance = this.chart; var ctx = chartInstance.ctx; ctx.textAlign = "right"; ctx.font = "10px Open Sans"; ctx.fillStyle = "#fff"; Chart.helpers.each(this.data.datasets.forEach(function (dataset, i) { var meta = chartInstance.controller.getDatasetMeta(i); Chart.helpers.each(meta.data.forEach(function (bar, index) { data = dataset.data[index]; if (data != 0) ctx.fillText(data, bar._model.x - 2, bar._model.y - 7); }), this) }), this); } },
pointLabelFontFamily: "Open Sans",
scaleFontFamily: "Open Sans",
};
誰もがこれを達成するためにどのようなアイデアを持っていますか?今まで私が見つけたのは、特定のものではなく、すべてのグリッドラインの外観を変更することでした。
どうもありがとうFrederiek!私が混乱しているのは、lineAtIndexが正確に何をしているかだけです。 – Shadowfox