umychart.style.wechat.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. /*
  2. copyright (c) 2018 jones
  3. http://www.apache.org/licenses/LICENSE-2.0
  4. 开源项目 https://github.com/jones2000/HQChart
  5. jones_2000@163.com
  6. 不同风格行情配置文件 (微信小程序版本)
  7. */
  8. var BLACK_STYLE = //黑色风格
  9. {
  10. BGColor:'rgb(0,0,0)',
  11. TooltipBGColor: "rgb(255, 255, 255)", //背景色
  12. TooltipAlpha: 0.92, //透明度
  13. SelectRectBGColor: "rgba(1,130,212,0.06)", //背景色
  14. // SelectRectAlpha: 0.06; //透明度
  15. UpBarColor: "rgb(238,21,21)",
  16. DownBarColor: "rgb(25,158,0)",
  17. UnchagneBarColor: "rgb(199,199,199)",
  18. Minute: {
  19. VolBarColor: null,
  20. PriceColor: "rgb(25,180,231)",
  21. AvPriceColor: "rgb(255,236,0)",
  22. },
  23. DefaultTextColor: "rgb(101,104,112)",
  24. DefaultTextFont: '12px 微软雅黑',
  25. IndexTitleBGColor:'rgb(211,211,211)',
  26. DynamicTitleFont: '12px 微软雅黑', //指标动态标题字体
  27. UpTextColor: "rgb(238,21,21)",
  28. DownTextColor: "rgb(25,158,0)",
  29. UnchagneTextColor: "rgb(101,104,112)",
  30. CloseLineColor: 'rgb(178,34,34)',
  31. Title:
  32. {
  33. TradeIndexColor:'rgb(105,105,105)', //交易指标颜色
  34. ColorIndexColor:'rgb(112,128,144)', //五彩K线颜色
  35. VolColor:"rgb(101,104,112)", //标题成交量
  36. AmountColor:"rgb(101,104,112)", //成交金额
  37. DateTimeColor:"rgb(101,104,112)", //时间,日期
  38. SettingColor:"rgb(101,104,112)", //周期,复权
  39. NameColor:"rgb(101,104,112)" , //股票名称
  40. TurnoverRateColor:'rgb(101,104,112)', //换手率
  41. PositionColor:"rgb(101,104,112)" //持仓
  42. },
  43. FrameBorderPen: "rgba(236,236,236,0.13)", //边框
  44. FrameSplitPen: "rgba(236,236,236,0.13)", //分割线
  45. FrameSplitTextColor: "rgb(101,104,112)", //刻度文字颜色
  46. FrameSplitTextFont: "12px 微软雅黑", //坐标刻度文字字体
  47. FrameTitleBGColor: "rgb(246,251,253)", //标题栏背景色
  48. Frame: { XBottomOffset: 0 }, //X轴文字向下偏移
  49. FrameLatestPrice: {
  50. TextColor: 'rgb(255,255,255)', //最新价格文字颜色
  51. UpBarColor: "rgb(238,21,21)", //上涨
  52. DownBarColor: "rgb(25,158,0)", //下跌
  53. UnchagneBarColor: "rgb(190,190,190)", //平盘
  54. BGAlpha: 0.6
  55. },
  56. CorssCursorBGColor: "rgb(43,54,69)", //十字光标背景
  57. CorssCursorTextColor: "rgb(255,255,255)",
  58. CorssCursorTextFont: "12px 微软雅黑",
  59. CorssCursorHPenColor: "rgb(130,130,130)", //十字光标线段颜色
  60. CorssCursorVPenColor: "rgb(130,130,130)", //十字光标线段颜色
  61. KLine:
  62. {
  63. MaxMin: { Font: '12px 微软雅黑', Color: 'rgb(111,111,111)', RightArrow:"→", LeftArrow:"←", HighYOffset:0, LowYOffset:0 }, //K线最大最小值显示
  64. Info: //信息地雷
  65. {
  66. Color: 'rgb(205,149,12)',
  67. TextColor: '#afc0da',
  68. TextBGColor: '#1a283e',
  69. Investor:
  70. {
  71. ApiUrl: '/API/NewsInteract', //互动易
  72. },
  73. Announcement: //公告
  74. {
  75. ApiUrl: '/API/ReportList',
  76. },
  77. Pforecast: //业绩预告
  78. {
  79. ApiUrl: '/API/StockHistoryDay',
  80. },
  81. Research: //调研
  82. {
  83. ApiUrl: '/API/InvestorRelationsList',
  84. },
  85. BlockTrading: //大宗交易
  86. {
  87. ApiUrl: '/API/StockHistoryDay',
  88. },
  89. TradeDetail: //龙虎榜
  90. {
  91. ApiUrl: '/API/StockHistoryDay',
  92. },
  93. Policy: //策略
  94. {
  95. ApiUrl: '/API/StockHistoryDay',
  96. }
  97. }
  98. },
  99. Index: { //指标线段颜色
  100. LineColor: [
  101. "rgb(255,189,09)",
  102. "rgb(22,198,255)",
  103. "rgb(174,35,161)",
  104. "rgb(236,105,65)",
  105. "rgb(68,114,196)",
  106. "rgb(229,0,79)",
  107. "rgb(0,128,255)",
  108. "rgb(252,96,154)",
  109. "rgb(42,230,215)",
  110. "rgb(24,71,178)",
  111. ],
  112. NotSupport: { Font: "12px 微软雅黑", TextColor: "rgb(52,52,52)" }
  113. },
  114. ColorArray: //自定义指标默认颜色
  115. [
  116. "rgb(255,174,0)",
  117. "rgb(25,199,255)",
  118. "rgb(175,95,162)",
  119. "rgb(236,105,65)",
  120. "rgb(68,114,196)",
  121. "rgb(229,0,79)",
  122. "rgb(0,128,255)",
  123. "rgb(252,96,154)",
  124. "rgb(42,230,215)",
  125. "rgb(24,71,178)",
  126. ],
  127. //画图工具
  128. DrawPicture:
  129. {
  130. LineColor: "rgb(30,144,255)",
  131. PointColor: "rgb(105,105,105)",
  132. },
  133. TooltipPaint: //Tooltip
  134. {
  135. BGColor: 'rgba(20,20,20,0.8)', //背景色
  136. BorderColor: 'rgb(210,210,210)', //边框颜色
  137. TitleColor: 'rgb(210,210,210)', //标题颜色
  138. TitleFont:'12px 微软雅黑' //字体
  139. },
  140. //深度图
  141. DepthChart:
  142. {
  143. BidColor: { Line:"rgb(82,176,123)", Area:"rgba(82,176,123,0.5)"}, //卖
  144. AskColor: { Line:"rgb(207,76,89)", Area:"rgba(207,76,89, 0.5)"}, //买
  145. LineWidth:4
  146. },
  147. DepthCorss:
  148. {
  149. BidColor: { Line:"rgb(82,176,123)" }, //卖
  150. AskColor: { Line:"rgb(207,76,89)" }, //买
  151. LineWidth:2, //线段宽度
  152. LineDash:[3,3],
  153. Tooltip:
  154. {
  155. BGColor:'rgba(54,54,54, 0.8)', TextColor:"rgb(203,215,224)",
  156. Border:{ Top:5, Left:20, Bottom:5, Center: 5},
  157. Font:"12px 微软雅黑",
  158. LineHeight:16 //单行高度
  159. }
  160. }
  161. };
  162. var WHITE_STYLE= //白色风格
  163. {
  164. BGColor:'rgb(255,255,255)',
  165. TooltipBGColor: "rgb(255, 255, 255)", //背景色
  166. TooltipAlpha: 0.92, //透明度
  167. SelectRectBGColor:"rgba(1,130,212,0.06)", //背景色
  168. // this.SelectRectAlpha=0.06; //透明度
  169. UpBarColor: "rgb(238,21,21)",
  170. DownBarColor: "rgb(25,158,0)",
  171. UnchagneBarColor: "rgb(0,0,0)",
  172. Minute:
  173. {
  174. VolBarColor : "rgb(238,127,9)",
  175. PriceColor : "rgb(50,171,205)",
  176. AvPriceColor : "rgb(238,127,9)",
  177. },
  178. DefaultTextColor: "rgb(43,54,69)",
  179. DefaultTextFont: '12px 微软雅黑',
  180. DynamicTitleFont: '12px 微软雅黑', //指标动态标题字体
  181. UpTextColor: "rgb(238,21,21)",
  182. DownTextColor: "rgb(25,158,0)",
  183. UnchagneTextColor: "rgb(0,0,0)",
  184. CloseLineColor: 'rgb(178,34,34)',
  185. FrameBorderPen: "rgb(225,236,242)", //边框
  186. FrameSplitPen: "rgb(225,236,242)", //分割线
  187. FrameSplitTextColor: "rgb(51,51,51)", //刻度文字颜色
  188. FrameSplitTextFont: "12px 微软雅黑", //坐标刻度文字字体
  189. FrameTitleBGColor: "rgb(246,251,253)", //标题栏背景色
  190. CorssCursorBGColor: "rgb(255, 255, 255)", //十字光标背景
  191. CorssCursorTextColor: "rgb(0, 0, 0)",
  192. CorssCursorTextFont: "12px 微软雅黑",
  193. CorssCursorPenColor: "rgb(130,130,130)", //十字光标线段颜色
  194. KLine:
  195. {
  196. MaxMin: { Font: '12px 微软雅黑', Color: 'rgb(111,111,111)', RightArrow:"→", LeftArrow:"←", HighYOffset:0, LowYOffset:0 }, //K线最大最小值显示
  197. Info: //信息地雷
  198. {
  199. Color: 'rgb(205,149,12)',
  200. TextColor: '#197de9',
  201. TextBGColor: '#e1e4ef',
  202. Investor:
  203. {
  204. ApiUrl: '/API/NewsInteract', //互动易
  205. },
  206. Announcement: //公告
  207. {
  208. ApiUrl: '/API/ReportList',
  209. },
  210. Pforecast: //业绩预告
  211. {
  212. ApiUrl: '/API/StockHistoryDay',
  213. },
  214. Research: //调研
  215. {
  216. ApiUrl: '/API/InvestorRelationsList',
  217. },
  218. BlockTrading: //大宗交易
  219. {
  220. ApiUrl: '/API/StockHistoryDay',
  221. },
  222. TradeDetail: //龙虎榜
  223. {
  224. ApiUrl: '/API/StockHistoryDay',
  225. },
  226. Policy: //策略
  227. {
  228. ApiUrl: '/API/StockHistoryDay',
  229. }
  230. }
  231. },
  232. Index:
  233. { //指标线段颜色
  234. LineColor:
  235. [
  236. "rgb(255,189,09)",
  237. "rgb(22,198,255)",
  238. "rgb(174,35,161)",
  239. "rgb(236,105,65)",
  240. "rgb(68,114,196)",
  241. "rgb(229,0,79)",
  242. "rgb(0,128,255)",
  243. "rgb(252,96,154)",
  244. "rgb(42,230,215)",
  245. "rgb(24,71,178)",
  246. ],
  247. NotSupport: { Font: "12px 微软雅黑", TextColor: "rgb(52,52,52)" }
  248. },
  249. ColorArray: //自定义指标默认颜色
  250. [
  251. "rgb(255,174,0)",
  252. "rgb(25,199,255)",
  253. "rgb(175,95,162)",
  254. "rgb(236,105,65)",
  255. "rgb(68,114,196)",
  256. "rgb(229,0,79)",
  257. "rgb(0,128,255)",
  258. "rgb(252,96,154)",
  259. "rgb(42,230,215)",
  260. "rgb(24,71,178)",
  261. ],
  262. //画图工具
  263. DrawPicture:
  264. {
  265. LineColor: "rgb(30,144,255)",
  266. PointColor: "rgb(105,105,105)",
  267. },
  268. }
  269. var STYLE_TYPE_ID=
  270. {
  271. BLACK_ID:1, //黑色风格
  272. WHITE_ID:2 //白色风格
  273. }
  274. function GetStyleConfig(styleid) //获取一个风格的配置变量
  275. {
  276. switch (styleid)
  277. {
  278. case STYLE_TYPE_ID.BLACK_ID:
  279. return BLACK_STYLE;
  280. break;
  281. case STYLE_TYPE_ID.WHITE_ID:
  282. return WHITE_STYLE;
  283. break;
  284. default:
  285. return null;
  286. }
  287. }
  288. module.exports =
  289. {
  290. JSCommonHQStyle:
  291. {
  292. GetStyleConfig:GetStyleConfig,
  293. STYLE_TYPE_ID:STYLE_TYPE_ID
  294. }
  295. };