覆盖

本主题包含图表属性说明。 这些属性被处理作为可定制的。 其他属性的自定义则不被支持。

文件的格式:

<属性路径>: <图表库的默认值>

  1. // 支持的值: large, medium, small, tiny
  2. volumePaneSize: "large"
  3. // 在文本编辑器中可用的字体(即,在`文本`绘图工具属性对话框中)
  4. editorFontsList: ['Verdana', 'Courier New', 'Times New Roman', 'Arial']
  5. paneProperties.backgroundType: 'solid' // or 'gradient'
  6. paneProperties.background: "#ffffff"
  7. paneProperties.backgroundGradientStartColor: "#ffffff"
  8. paneProperties.backgroundGradientEndColor: "#ffffff"
  9. paneProperties.vertGridProperties.color: "#E6E6E6"
  10. paneProperties.vertGridProperties.style: LINESTYLE_SOLID
  11. paneProperties.horzGridProperties.color: "#E6E6E6"
  12. paneProperties.horzGridProperties.style: LINESTYLE_SOLID
  13. paneProperties.crossHairProperties.color: "#989898"
  14. paneProperties.crossHairProperties.width: 1
  15. paneProperties.crossHairProperties.style: LINESTYLE_DASHED
  16. // 边际(百分比)。 用于自动缩放。
  17. paneProperties.topMargin: 5
  18. paneProperties.bottomMargin: 5
  19. paneProperties.axisProperties.autoScale: true
  20. paneProperties.axisProperties.lockScale: false
  21. paneProperties.axisProperties.percentage: false
  22. paneProperties.axisProperties.indexedTo100: false
  23. paneProperties.axisProperties.log: false
  24. paneProperties.axisProperties.alignLabels: true
  25. paneProperties.axisProperties.isInverted: false
  26. paneProperties.legendProperties.showStudyArguments: true
  27. paneProperties.legendProperties.showStudyTitles: true
  28. paneProperties.legendProperties.showStudyValues: true
  29. paneProperties.legendProperties.showSeriesTitle: true
  30. paneProperties.legendProperties.showSeriesOHLC: true
  31. paneProperties.legendProperties.showLegend: true
  32. paneProperties.legendProperties.showBarChange: true
  33. paneProperties.legendProperties.showOnlyPriceSource: true
  34. scalesProperties.backgroundColor : "#ffffff"
  35. scalesProperties.fontSize: 11
  36. scalesProperties.lineColor : "#555"
  37. scalesProperties.textColor : "#555"
  38. scalesProperties.scaleSeriesOnly : false
  39. scalesProperties.showSeriesLastValue: true
  40. scalesProperties.showSeriesPrevCloseValue: false
  41. scalesProperties.showStudyLastValue: false
  42. scalesProperties.showStudyPlotLabels: false
  43. scalesProperties.showSymbolLabels: false
  44. scalesProperties.showCurrency: true
  45. scalesProperties.showUnit: true
  46. timeScale.rightOffset: 5
  47. timezone: "Etc/UTC" #查看支持的时区列表(在Symbology页面中的timezone)的可用值
  48. // 数据列风格。 请参阅下面的支持的值
  49. // Bars = 0 #美国线
  50. // Candles = 1 #K线图
  51. // Line = 2 #线形图
  52. // Area = 3 #面积图
  53. // Heiken Ashi = 8 #平均K线图
  54. // Hollow Candles = 9 #空心K线图
  55. // Renko = 4 #转形图
  56. // Kagi = 5 #卡吉图
  57. // Point&Figure = 6 #点数图
  58. // Line Break = 7 #新价图
  59. mainSeriesProperties.style: 1
  60. mainSeriesProperties.showCountdown: true
  61. mainSeriesProperties.visible:true
  62. mainSeriesProperties.showPriceLine: true
  63. mainSeriesProperties.priceLineWidth: 1
  64. mainSeriesProperties.priceLineColor: ''
  65. mainSeriesProperties.showPrevClosePriceLine: false
  66. mainSeriesProperties.prevClosePriceLineWidth: 1
  67. mainSeriesProperties.prevClosePriceLineColor: 'rgba( 85, 85, 85, 1)'
  68. mainSeriesProperties.lockScale: false
  69. mainSeriesProperties.minTick: "default"
  70. mainSeriesProperties.minTick: minTick 值是 3 个值的字符串表示: pricescale, minmove, fractional (见下文)
  71. mainSeriesProperties.priceAxisProperties.autoScale:true (see #749)
  72. mainSeriesProperties.priceAxisProperties.autoScaleDisabled:false (see #749)
  73. mainSeriesProperties.priceAxisProperties.percentage:false
  74. mainSeriesProperties.priceAxisProperties.percentageDisabled:false
  75. mainSeriesProperties.priceAxisProperties.log:false
  76. mainSeriesProperties.priceAxisProperties.logDisabled:false
  77. // 可能的值包括: description, ticker, ticker-and-description
  78. mainSeriesProperties.statusViewStyle.symbolTextSource: 'description'
  79. symbolWatermarkProperties.color : "rgba(0, 0, 0, 0.00)"
  80. // 不同的图表类型默认值
  81. // K线图样式
  82. mainSeriesProperties.candleStyle.upColor: "#6ba583"
  83. mainSeriesProperties.candleStyle.downColor: "#d75442"
  84. mainSeriesProperties.candleStyle.drawWick: true
  85. mainSeriesProperties.candleStyle.drawBorder: true
  86. mainSeriesProperties.candleStyle.borderColor: "#378658"
  87. mainSeriesProperties.candleStyle.borderUpColor: "#225437"
  88. mainSeriesProperties.candleStyle.borderDownColor: "#5b1a13"
  89. mainSeriesProperties.candleStyle.wickUpColor: 'rgba( 115, 115, 117, 1)'
  90. mainSeriesProperties.candleStyle.wickDownColor: 'rgba( 115, 115, 117, 1)'
  91. mainSeriesProperties.candleStyle.barColorsOnPrevClose: false
  92. // 空心K线图样式
  93. mainSeriesProperties.hollowCandleStyle.upColor: "#6ba583"
  94. mainSeriesProperties.hollowCandleStyle.downColor: "#d75442"
  95. mainSeriesProperties.hollowCandleStyle.drawWick: true
  96. mainSeriesProperties.hollowCandleStyle.drawBorder: true
  97. mainSeriesProperties.hollowCandleStyle.borderColor: "#378658"
  98. mainSeriesProperties.hollowCandleStyle.borderUpColor: "#225437"
  99. mainSeriesProperties.hollowCandleStyle.borderDownColor: "#5b1a13"
  100. mainSeriesProperties.hollowCandleStyle.wickColor: "#737375"
  101. // 平均K线图样式
  102. mainSeriesProperties.haStyle.upColor: "#6ba583"
  103. mainSeriesProperties.haStyle.downColor: "#d75442"
  104. mainSeriesProperties.haStyle.drawWick: true
  105. mainSeriesProperties.haStyle.drawBorder: true
  106. mainSeriesProperties.haStyle.borderColor: "#378658"
  107. mainSeriesProperties.haStyle.borderUpColor: "#225437"
  108. mainSeriesProperties.haStyle.borderDownColor: "#5b1a13"
  109. mainSeriesProperties.haStyle.wickColor: "#737375"
  110. mainSeriesProperties.haStyle.barColorsOnPrevClose: false
  111. // 美国线样式
  112. mainSeriesProperties.barStyle.upColor: "#6ba583"
  113. mainSeriesProperties.barStyle.downColor: "#d75442"
  114. mainSeriesProperties.barStyle.barColorsOnPrevClose: false
  115. mainSeriesProperties.barStyle.dontDrawOpen: false
  116. // 线形图样式
  117. mainSeriesProperties.lineStyle.color: "#2962FF"
  118. mainSeriesProperties.lineStyle.linestyle: LINESTYLE_SOLID
  119. mainSeriesProperties.lineStyle.linewidth: 1
  120. mainSeriesProperties.lineStyle.priceSource: "close"
  121. // 面积图样式
  122. mainSeriesProperties.areaStyle.color1: "#606090"
  123. mainSeriesProperties.areaStyle.color2: "#2962FF"
  124. mainSeriesProperties.areaStyle.linecolor: "#2962FF"
  125. mainSeriesProperties.areaStyle.linestyle: LINESTYLE_SOLID
  126. mainSeriesProperties.areaStyle.linewidth: 1
  127. mainSeriesProperties.areaStyle.priceSource: "close"
  128. // 基准线样式
  129. mainSeriesProperties.baselineStyle.baselineColor: "rgba( 117, 134, 150, 1)"
  130. mainSeriesProperties.baselineStyle.topFillColor1: "rgba( 83, 185, 135, 0.1)"
  131. mainSeriesProperties.baselineStyle.topFillColor2: "rgba( 83, 185, 135, 0.1)"
  132. mainSeriesProperties.baselineStyle.bottomFillColor1: "rgba( 235, 77, 92, 0.1)"
  133. mainSeriesProperties.baselineStyle.bottomFillColor2: "rgba( 235, 77, 92, 0.1)"
  134. mainSeriesProperties.baselineStyle.topLineColor: "rgba( 83, 185, 135, 1)"
  135. mainSeriesProperties.baselineStyle.bottomLineColor: "rgba( 235, 77, 92, 1)"
  136. mainSeriesProperties.baselineStyle.topLineWidth: 1
  137. mainSeriesProperties.baselineStyle.bottomLineWidth: 1
  138. mainSeriesProperties.baselineStyle.priceSource: "close"
  139. mainSeriesProperties.baselineStyle.transparency: 50
  140. mainSeriesProperties.baselineStyle.baseLevelPercentage: 50
  141. // Hi-Lo style
  142. mainSeriesProperties.hiloStyle.color: "#2962FF"
  143. mainSeriesProperties.hiloStyle.showBorders: true
  144. mainSeriesProperties.hiloStyle.borderColor: "#2962FF"
  145. mainSeriesProperties.hiloStyle.showLabels: true
  146. mainSeriesProperties.hiloStyle.labelColor: "#2962FF"
  147. mainSeriesProperties.hiloStyle.fontFamily: 'Trebuchet MS'
  148. mainSeriesProperties.hiloStyle.fontSize: 7
LineStyles
  1. LINESTYLE_SOLID = 0;
  2. LINESTYLE_DOTTED = 1;
  3. LINESTYLE_DASHED = 2;
  4. LINESTYLE_LARGE_DASHED = 3;

Mintick

查看此处 了解有关 minTick 值的更多信息。

下面是所有可能值的列表,表示为一个对象以获得更好的可读性:

  1. { priceScale: 1, minMove: 1, frac: false },
  2. { priceScale: 10, minMove: 1, frac: false },
  3. { priceScale: 100, minMove: 1, frac: false },
  4. { priceScale: 1000, minMove: 1, frac: false },
  5. { priceScale: 10000, minMove: 1, frac: false },
  6. { priceScale: 100000, minMove: 1, frac: false },
  7. { priceScale: 1000000, minMove: 1, frac: false },
  8. { priceScale: 10000000, minMove: 1, frac: false },
  9. { priceScale: 100000000, minMove: 1, frac: false },
  10. { priceScale: 2, minMove: 1, frac: true },
  11. { priceScale: 4, minMove: 1, frac: true },
  12. { priceScale: 8, minMove: 1, frac: true },
  13. { priceScale: 16, minMove: 1, frac: true },
  14. { priceScale: 32, minMove: 1, frac: true },
  15. { priceScale: 64, minMove: 1, frac: true },
  16. { priceScale: 128, minMove: 1, frac: true },
  17. { priceScale: 320, minMove: 1, frac: true },

除了上述值之外,默认 minTick 还有一个特殊值 - 'default'.

例子:

  1. // reset minTick to default
  2. tvWidget.applyOverrides({ 'mainSeriesProperties.minTick': 'default' });
  3. // set series' minTick to { priceScale: 10000, minMove: 1, frac: false }
  4. tvWidget.applyOverrides({ 'mainSeriesProperties.minTick': '10000,1,false' });
  5. // set default minTick for overlay studies to { priceScale: 10000, minMove: 1, frac: false }
  6. tvWidget.applyStudiesOverrides({ 'overlay.minTick': '10000,1,false' });