Skip to content
Snippets Groups Projects
Select Git revision
  • f91407ba91b02ed966692e491aa684a96437297c
  • main default protected
  • test
  • uat.20230605160823
  • uat.latest
5 results

sq_webapp.py

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;