| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- /*=========================================================================================
- File Name: line-area.js
- Description: Chartjs line area chart
- ----------------------------------------------------------------------------------------
- Item Name: Robust - Responsive Admin Theme
- Version: 1.2
- Author: PIXINVENT
- Author URL: http://www.themeforest.net/user/pixinvent
- ==========================================================================================*/
- // Line area chart
- // ------------------------------
- $(window).on("load", function(){
- //Get the context of the Chart canvas element we want to select
- var ctx = $("#area-chart");
- // 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: "My First dataset",
- data: [0, 150, 140, 105, 190, 230, 270],
- backgroundColor: "rgba(201,187,174,.3)",
- borderColor: "transparent",
- pointBorderColor: "#C9BBAE",
- pointBackgroundColor: "#FFF",
- pointBorderWidth: 2,
- pointHoverBorderWidth: 2,
- pointRadius: 4,
- }, {
- label: "My Second dataset",
- data: [0, 90, 120, 240, 140, 250, 190],
- backgroundColor: "rgba(29,233,182,.6)",
- borderColor: "transparent",
- pointBorderColor: "#1DE9B6",
- pointBackgroundColor: "#FFF",
- pointBorderWidth: 2,
- pointHoverBorderWidth: 2,
- pointRadius: 4,
- }]
- };
- var config = {
- type: 'line',
- // Chart Options
- options : chartOptions,
- // Chart Data
- data : chartData
- };
- // Create the chart
- var areaChart = new Chart(ctx, config);
- });
|