-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ac4348f
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "radar-scope-js", | ||
"version": "1.3.0", | ||
"description": "Create stunning and dynamic radar charts with ease using RadarScope, the versatile open-source JavaScript library built with Chart.js. With customizable scales and multiple datasets support, bring your data to life with dynamic visuals.", | ||
"main": "index.js", | ||
"repository": "https://github.com/bcostaaa01/radar-scope-js.git", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"files": [ | ||
"src/**/*.js" | ||
], | ||
"keywords": [ | ||
"radar", | ||
"chart", | ||
"chartjs", | ||
"radarscope" | ||
], | ||
"author": "Bruno Costa", | ||
"license": "ISC", | ||
"dependencies": { | ||
"chart.js": "^4.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Chart from "chart.js"; | ||
|
||
function createRadarChart(data, options) { | ||
const chartId = `radar-chart-${Math.random() | ||
.toString(36) | ||
.substring(2, 15)}`; | ||
const chartContainer = document.getElementById("div"); | ||
chartContainer.innerHTML = ` | ||
<canvas id="${chartId}"></canvas> | ||
`; | ||
const chartCanvas = chartContainer.querySelector(`#${chartId}`); | ||
const chart = new Chart(chartCanvas, { | ||
type: "radar", | ||
data: data, | ||
options: options, | ||
}); | ||
return chartContainer; | ||
} | ||
|
||
export { createRadarChart }; |