chart.js 5

[Chart.js] 분산형 차트 4분할로 hover하고 click하기

원래 chart.js 에서 함수를 직접 작성해가면서 기능을 추가했는데기존 네 영역에도 색을 주고호버하면 색을 또 주고클릭하면 또 주고..코드가 길어질 것 같아서 html 객체를 생성했다.  11번 탭탭탭 22번 탭탭탭 3번 탭탭탭 4번 탭탭탭 .background도 영역 나누기 .chart { position: relative; width: 700px;}.background { width: calc(100% - 47px); height: calc(100% - 61px); left: 27px; ..

언어/Chart.js 2024.06.27

[chart.js] 그래프 hover시 마우스 포인터(v.4.2.1)

options: { onHover: (event, chartElement) => { event.native.target.style.cursor = chartElement.length === 1 ? 'pointer' : 'default'; // console.log(event); // console.log(chartElement); // if(chartElement.length === 1) { // event.native.target.style.cursor = 'pointer'; // } else { // event.native.target.style.cursor = 'default'; // } }, scales: { y: { beginAtZero: true } } } - 그래프가 있으면 chartElem..

언어/Chart.js 2024.03.06

[Chart.js] 그래프 클릭하면 모달 창 띄우기(v.4.2.1)

html WWW.CHARTJS3.COM (Chart JS ) 모달 헤더 body close css .bar_modal { z-index: 10; position: fixed; margin: 0; padding: 0; left: 0; top: 0; height: 100vh; width: 100%; background: rgba(0,0,0,0.3); transition: opacity .2s; } .bar_modal.hide { opacity: 0; z-index: -10; } .modal { background: #fff; width: 300px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: ce..

언어/Chart.js 2024.01.18