툴팁에는 hour: 시간 이렇게 나오고싶고
아래에는 그냥 숫자만 나오게 하고싶은제
어떻게 수정해야할까요 코드도 첨부합니다
for (var i = 0; i < 24; i++) {
arrError.push(0);
arrCalls.push(0);
arrAjax.push(0);
arrLabel.push("Hour: " + nIndex + '');
nIndex++;
}
var config = {
type: strChartType,
data: {
labels: arrLabel,
datasets: [{
label: 'Errors',
fill: false,
borderWidth: 2,
backgroundColor: chartColors2[0],
borderColor: chartColors2[0],
data: arrError,
yAxisID: 'y-axis-2',
}, {
label: 'Calls',
fill: false,
borderWidth: 2,
backgroundColor: chartColors2[2],
borderColor: chartColors2[2],
data: arrCalls,
yAxisID: 'y-axis-1'
}, {
label: 'AjaxCalls',
fill: false,
borderWidth: 2,
backgroundColor: chartColors2[5],
borderColor: chartColors2[5],
data: arrAjax,
yAxisID: 'y-axis-1'
},]
},
options: {
maintainAspectRatio: true,
aspectRatio: 2,
title: {
display: true, //true
text: MONTHS[paramMonth - 1] + ' ' + paramDay + ' - State chart'
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
label: 'hour',
labelString: 'Hour'
}
}],
yAxes: [{
type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
display: true,
'left',
id: 'y-axis-1',
ticks: {
beginAtZero: true
},
scaleLabel: {
display: true,
labelString: 'Call Count',
min: 0
}
}, {
type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
display: true,
'right',
id: 'y-axis-2',
ticks: {
beginAtZero: true
},
scaleLabel: {
display: true,
labelString: 'Error Count',
min: 0
}
}]
},
tooltips: {
mode: 'nearest',
intersect: false,
},
hover: {
mode: 'nearest',
intersect: false
}
}
};
아래에는 그냥 숫자만 나오게 하고싶은제
어떻게 수정해야할까요 코드도 첨부합니다
for (var i = 0; i < 24; i++) {
arrError.push(0);
arrCalls.push(0);
arrAjax.push(0);
arrLabel.push("Hour: " + nIndex + '');
nIndex++;
}
var config = {
type: strChartType,
data: {
labels: arrLabel,
datasets: [{
label: 'Errors',
fill: false,
borderWidth: 2,
backgroundColor: chartColors2[0],
borderColor: chartColors2[0],
data: arrError,
yAxisID: 'y-axis-2',
}, {
label: 'Calls',
fill: false,
borderWidth: 2,
backgroundColor: chartColors2[2],
borderColor: chartColors2[2],
data: arrCalls,
yAxisID: 'y-axis-1'
}, {
label: 'AjaxCalls',
fill: false,
borderWidth: 2,
backgroundColor: chartColors2[5],
borderColor: chartColors2[5],
data: arrAjax,
yAxisID: 'y-axis-1'
},]
},
options: {
maintainAspectRatio: true,
aspectRatio: 2,
title: {
display: true, //true
text: MONTHS[paramMonth - 1] + ' ' + paramDay + ' - State chart'
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
label: 'hour',
labelString: 'Hour'
}
}],
yAxes: [{
type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
display: true,
'left',
id: 'y-axis-1',
ticks: {
beginAtZero: true
},
scaleLabel: {
display: true,
labelString: 'Call Count',
min: 0
}
}, {
type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
display: true,
'right',
id: 'y-axis-2',
ticks: {
beginAtZero: true
},
scaleLabel: {
display: true,
labelString: 'Error Count',
min: 0
}
}]
},
tooltips: {
mode: 'nearest',
intersect: false,
},
hover: {
mode: 'nearest',
intersect: false
}
}
};
labelString 수정 ""으로
xAxes
초보라서 그런데 예시로 설명 가능하실까요 ㅠㅠ