linegraph.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #include <string.h>
  2. /* location of graph origin in terms of % of screen */
  3. #define ORIGIN_X 0.10
  4. #define ORIGIN_Y 0.20
  5. /* y-coordinate of end of y-axis */
  6. #define YAXIS_END 0.86
  7. /* x-coordinate of end of x-axis */
  8. #define XAXIS_END 0.90
  9. /* minimum distance between numbered tic-marks on x-axis */
  10. #define XTIC_DIST 20
  11. /* minimum distance between numbered tic-marks on y-axis */
  12. #define YTIC_DIST 20
  13. /* sizes of tic-marks */
  14. #define BIG_TIC 0.025
  15. #define SMALL_TIC 0.015
  16. /* y-coordinate of the x axis label */
  17. #define LABEL_1 0.07
  18. /* x-coordinate of the y axis label */
  19. #define LABEL_2 0.02
  20. /* y-coordinate of x-axis tic-mark numbers */
  21. #define XNUMS_Y 0.14
  22. /* x-coordinate of y-axis tic-mark numbers */
  23. #define YNUMS_X 0.05
  24. /* text width and height */
  25. #define TEXT_HEIGHT 0.04
  26. #define TEXT_WIDTH TEXT_HEIGHT*0.5
  27. /* structures for determining tic-mark numbering scheme */
  28. struct units
  29. {
  30. char *name; /* name of unit (text) */
  31. int unit; /* tic-mark interval */
  32. int every; /* tic_mark number interval */
  33. };
  34. struct units tics[] = {
  35. {"", 1, 2},
  36. {"", 1, 5},
  37. {"in tens", 10, 10},
  38. {"in tens", 10, 20},
  39. {"in tens", 10, 50},
  40. {"in hundreds", 100, 100},
  41. {"in hundreds", 100, 500},
  42. {"in thousands", 1000, 1000},
  43. {"in thousands", 1000, 5000},
  44. {"in thousands", 1000, 10000},
  45. {"in thousands", 1000, 50000},
  46. {"in tens of thousands", 10000, 10000},
  47. {"in tens of thousands", 10000, 20000},
  48. {"in tens of thousands", 10000, 50000},
  49. {"in hundreds of thousands", 100000, 100000},
  50. {"in hundreds of thousands", 100000, 200000},
  51. {"in hundreds of thousands", 100000, 500000},
  52. {"in millions", 1000000, 1000000},
  53. {"in millions", 1000000, 2000000},
  54. {"in millions", 1000000, 5000000},
  55. {"in tens of millions", 10000000, 10000000},
  56. {"in tens of millions", 10000000, 20000000},
  57. {"in tens of millions", 10000000, 50000000},
  58. {"in hundreds of millions", 100000000, 100000000},
  59. {"in hundreds of millions", 100000000, 200000000},
  60. {"in hundreds of millions", 100000000, 500000000},
  61. {"in billions", 1000000000, 1000000000}
  62. };