tableChart.stories.js 947 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import React from 'react';
  2. import TableChart from 'app/components/charts/tableChart';
  3. export default {
  4. title: 'DataVisualization/Charts/TableChart',
  5. componet: TableChart,
  6. };
  7. export const _TableChart = ({...args}) => {
  8. const ERROR_TYPE_DATA = [
  9. ['TypeError', 50, 40, 30],
  10. ['SyntaxError', 40, 30, 20],
  11. ['NameError', 15, 15, 15],
  12. ['ZeroDivisionError', 20, 10, 0],
  13. ];
  14. return <TableChart data={ERROR_TYPE_DATA} {...args} />;
  15. };
  16. _TableChart.storyName = 'TableChart';
  17. _TableChart.args = {
  18. dataStartIndex: 1,
  19. showRowTotal: true,
  20. showColumnTotal: true,
  21. shadeRowPercentage: true,
  22. rowTotalLabel: 'Row Total',
  23. rowTotalWidth: 120,
  24. widths: [null, 100, 100, 100],
  25. headers: ['Exception Type', 'Project 1', 'Project 2', 'Project 3'],
  26. };
  27. _TableChart.parameters = {
  28. docs: {
  29. description: {
  30. story:
  31. 'A simple table that can calculate totals and relative share as a bar inside of a row',
  32. },
  33. },
  34. };