config/Options/shape/candlestick.ts

  1. /**
  2. * Copyright (c) 2017 ~ present NAVER Corp.
  3. * billboard.js project is licensed under the MIT license
  4. */
  5. /**
  6. * candlestick config options
  7. */
  8. export default {
  9. /**
  10. * Set candlestick options
  11. * @name candlestick
  12. * @memberof Options
  13. * @type {object}
  14. * @property {object} candlestick Candlestick object
  15. * @property {number} [candlestick.width] Change the width.
  16. * @property {number} [candlestick.width.ratio=0.6] Change the width by ratio.
  17. * @property {number} [candlestick.width.max] The maximum width value for ratio.
  18. * @property {number} [candlestick.width.dataname] Change the width for indicated dataset only.
  19. * @property {number} [candlestick.width.dataname.ratio=0.6] Change the width of bar chart by ratio.
  20. * @property {number} [candlestick.width.dataname.max] The maximum width value for ratio.
  21. * @property {object} [candlestick.color] Color setting.
  22. * @property {string|object} [candlestick.color.down] Change down(bearish) value color.
  23. * @property {string} [candlestick.color.down.dataname] Change down value color for indicated dataset only.
  24. *
  25. * @see [Demo](https://naver.github.io/billboard.js/demo/##Chart.CandlestickChart)
  26. * @example
  27. * candlestick: {
  28. * width: 10,
  29. *
  30. * // or
  31. * width: {
  32. * ratio: 0.2,
  33. * max: 20
  34. * },
  35. *
  36. * // or specify width per dataset
  37. * width: {
  38. * data1: 20,
  39. * data2: {
  40. * ratio: 0.2,
  41. * max: 20
  42. * }
  43. * },
  44. * color: {
  45. * // spcify bearish color
  46. * down: "red",
  47. *
  48. * // or specify color per dataset
  49. * down: {
  50. * data1: "red",
  51. * data2: "blue",
  52. * }
  53. * }
  54. * }
  55. */
  56. candlestick_width: <number | {ratio?: number, max?: number} | undefined>undefined,
  57. candlestick_width_ratio: 0.6,
  58. candlestick_width_max: undefined,
  59. candlestick_color_down: <string | {[key: string]: string}>"red"
  60. };