/*========================================================================================= File Name: line.js Description: Chartjs simple line chart ---------------------------------------------------------------------------------------- Item Name: Modern Admin - Clean Bootstrap 4 Dashboard HTML Template Author: PIXINVENT Author URL: http://www.themeforest.net/user/pixinvent ==========================================================================================*/ // Line chart // ------------------------------ $(window).on("load", function(){ //Get the context of the Chart canvas element we want to select var ctx = $("#different-point-sizes"); // Chart Options var chartOptions = { responsive: true, maintainAspectRatio: false, legend: { position: 'bottom', }, hover: { mode: 'label' }, scales: { xAxes: [{ display: true, gridLines: { color: "#f3f3f3", drawTicks: false, }, scaleLabel: { display: true, labelString: 'Month' } }], yAxes: [{ display: true, gridLines: { color: "#f3f3f3", drawTicks: false, }, scaleLabel: { display: true, labelString: 'Value' } }] }, title: { display: true, text: 'Chart.js Line Chart - Legend' } }; // Chart Data var chartData = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [{ label: "dataset - big points", data: [65, 59, 80, 81, 56, 55, 40], fill: false, borderDash: [5, 5], pointRadius: 15, pointHoverRadius: 10, backgroundColor: "#FFF", borderColor: "#9C27B0", pointBorderColor: "#9C27B0", pointBackgroundColor: "#FFF", }, { label: "dataset - individual point sizes", data: [28, 48, 40, 19, 86, 27, 90], fill: false, borderDash: [5, 5], pointRadius: [2, 4, 6, 18, 0, 12, 20], backgroundColor: "#FFF", borderColor: "#00A5A8", pointBorderColor: "#00A5A8", pointBackgroundColor: "#FFF", }, { label: "dataset - large pointHoverRadius", data: [45, 25, 16, 36, 67, 18, 76], fill: false, pointHoverRadius: 30, backgroundColor: "#FFF", borderColor: "#FF7D4D", pointBorderColor: "#FF7D4D", pointBackgroundColor: "#FFF", pointRadius: 5, }] }; var config = { type: 'line', // Chart Options options : chartOptions, data : chartData }; // Create the chart var lineChart = new Chart(ctx, config); });