config/Options/shape/radar.ts

  1. /**
  2. * Copyright (c) 2017 ~ present NAVER Corp.
  3. * billboard.js project is licensed under the MIT license
  4. */
  5. /**
  6. * radar config options
  7. */
  8. export default {
  9. /**
  10. * Set radar options
  11. * - **NOTE:**
  12. * > When x tick text contains `\n`, it's used as line break.
  13. * @name radar
  14. * @memberof Options
  15. * @type {object}
  16. * @property {object} radar Radar object
  17. * @property {number} [radar.axis.max=undefined] The max value of axis. If not given, it'll take the max value from the given data.
  18. * @property {boolean} [radar.axis.line.show=true] Show or hide axis line.
  19. * @property {number} [radar.axis.text.position.x=0] x coordinate position, relative the original.
  20. * @property {number} [radar.axis.text.position.y=0] y coordinate position, relative the original.
  21. * @property {boolean} [radar.axis.text.show=true] Show or hide axis text.
  22. * @property {boolean} [radar.direction.clockwise=false] Set the direction to be drawn.
  23. * @property {number} [radar.level.depth=3] Set the level depth.
  24. * @property {boolean} [radar.level.show=true] Show or hide level.
  25. * @property {Function} [radar.level.text.format] Set format function for the level value.<br>- Default value: `(x) => x % 1 === 0 ? x : x.toFixed(2)`
  26. * @property {boolean} [radar.level.text.show=true] Show or hide level text.
  27. * @property {number} [radar.size.ratio=0.87] Set size ratio.
  28. * @see [Demo](https://naver.github.io/billboard.js/demo/#Chart.RadarChart)
  29. * @see [Demo: radar axis](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarAxis)
  30. * @see [Demo: radar level](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarLevel)
  31. * @see [Demo: radar size](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarSize)
  32. * @see [Demo: radar axis multiline](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarAxisMultiline)
  33. * @example
  34. * radar: {
  35. * axis: {
  36. * max: 50,
  37. * line: {
  38. * show: false
  39. * },
  40. * text: {
  41. * position: {
  42. * x: 0,
  43. * y: 0
  44. * },
  45. * show: false
  46. * }
  47. * },
  48. * direction: {
  49. * clockwise: true
  50. * },
  51. * level: {
  52. * show: false,
  53. * text: {
  54. * format: function(x) {
  55. * return x + "%";
  56. * },
  57. * show: true
  58. * }
  59. * },
  60. * size: {
  61. * ratio: 0.7
  62. * }
  63. * }
  64. */
  65. radar_axis_max: <number | undefined>undefined,
  66. radar_axis_line_show: true,
  67. radar_axis_text_show: true,
  68. radar_axis_text_position: <{x?: number, y?: number}>{},
  69. radar_level_depth: 3,
  70. radar_level_show: true,
  71. radar_level_text_format: (x: number) => (x % 1 === 0 ? x : x.toFixed(2)),
  72. radar_level_text_show: true,
  73. radar_size_ratio: 0.87,
  74. radar_direction_clockwise: false
  75. };