From Dark and Darker Wiki

(Removed Title Name)
(Checking out Chart.js)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
     var BuffDurationModGraph = {
 
        x: [0.0, 1.0, 5.0, 7.0, 11.0, 15.0, 19.0, 20.0, 21.0, 27.0, 30.0, 35.0, 36.0, 38.0, 39.0, 44.0, 50.0, 51.0, 58.0, 59.0, 64.0, 70.0, 71.0, 76.0, 86.0, 87.0, 98.0, 100.0],
 
        y: [-80.0, -70.0, -30.0, -20.0, -8.0, 0.0, 4.0, 5.0, 6.0, 12.0, 15.0, 20.0, 21.0, 23.0, 24.0, 29.0, 35.0, 35.5, 39.0, 39.5, 42.0, 45.0, 45.5, 48.0, 53.0, 53.5, 59.0, 60.0],
  const ctx = document.getElementById('myChart');
        type: 'scatter'
 
    };
  new Chart(ctx, {
   
    type: 'bar',
    var data = [BuffDurationModGraph];
     data: {
      
  labels: labels,
     var layout = {
  datasets: [{
  paper_bgcolor:'rgba(0,0,0,0)',
    label: 'My First Dataset',
  plot_bgcolor:'rgba(0,0,0,0)'
    data: [{
     };
                x: 1,
var config = {responsive: true}
                y: 0.5
   
            }, {
      
                x: 2,
    Plotly.newPlot('BuffDurationModGraph', data, layout, config);
                y: 60
            }, {
                x: 3,
                y: 20
            }],
     fill: false,
     borderColor: 'rgb(75, 192, 192)',
    tension: 0.1
  }]
},
     options: {
      scales: {
        y: {
          beginAtZero: true
        }
      }
     }
  });

Revision as of 09:37, 5 January 2023

/* Any JavaScript here will be loaded for all users on every page load. */


  const ctx = document.getElementById('myChart');

  new Chart(ctx, {
    type: 'bar',
    data: {
  labels: labels,
  datasets: [{
    label: 'My First Dataset',
    data: [{
                x: 1,
                y: 0.5
            }, {
                x: 2,
                y: 60
            }, {
                x: 3,
                y: 20
            }],
    fill: false,
    borderColor: 'rgb(75, 192, 192)',
    tension: 0.1
  }]
},
    options: {
      scales: {
        y: {
          beginAtZero: true
        }
      }
    }
  });