Skip to content
Snippets Groups Projects
Select Git revision
  • 0f2283b9a2f863971f74f3c40912d3e1d7ca748d
  • develop default
  • master protected
  • feature/frontend-tests
  • 0.107
  • 0.106
  • 0.105
  • 0.104
  • 0.103
  • 0.102
  • 0.101
  • 0.100
  • 0.99
  • 0.98
  • 0.97
  • 0.96
  • 0.95
  • 0.94
  • 0.93
  • 0.92
  • 0.91
  • 0.90
  • 0.89
  • 0.88
24 results

Budget.tsx

Blame
  • LineGraph.tsx 801 B
    import React, { ReactElement } from 'react';
    import { Line } from 'react-chartjs-2';
    
    
    import {
      Chart as ChartJS,
      CategoryScale,
      LinearScale,
      PointElement,
      LineElement,
      Title,
      Tooltip,
      Legend,
    } from 'chart.js';
    import {BasicDataset} from "../../Schema";
    
    
    ChartJS.register(
      CategoryScale,
      LinearScale,
      PointElement,
      LineElement,
      Title,
      Tooltip,
      Legend
    );
    
    const options = {
      responsive: true,
      plugins: {
        legend: {
          position: 'top' as const,
          onClick: () => { /* intentionally empty */ },
        },
        title: {
          display: true,
          text: '',
        },
      },
    };
    
    interface inputProps {
        data: BasicDataset
    }
    
    function LineGraph({data}: inputProps): ReactElement {
      return (
        <Line data={data} options={options} />
      );
    }
    
    export default LineGraph;