You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

467 lines
14 KiB

  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. function GetBlackStyle()
  9. {
  10. var BLACK_STYLE = //黑色风格
  11. {
  12. BGColor:'rgb(0,0,0)',
  13. TooltipBGColor: "rgb(255, 255, 255)", //背景色
  14. TooltipAlpha: 0.92, //透明度
  15. SelectRectBGColor: "rgba(1,130,212,0.06)", //背景色
  16. // SelectRectAlpha: 0.06; //透明度
  17. UpBarColor: "rgb(238,21,21)",
  18. DownBarColor: "rgb(25,158,0)",
  19. UnchagneBarColor: "rgb(199,199,199)",
  20. EmptyBarBGColor:'rgb(0,0,0)', //空心柱子背景色
  21. Minute: {
  22. VolBarColor: null,
  23. PriceColor: "rgb(25,180,231)",
  24. AvPriceColor: "rgb(255,236,0)",
  25. },
  26. DefaultTextColor: "rgb(101,104,112)",
  27. DefaultTextFont: '14px 微软雅黑',
  28. IndexTitleBGColor:'rgb(211,211,211)',
  29. IndexTitleColor:"rgb(101,104,112)",
  30. OverlayIndexTitleBGColor:'rgba(0,0,0,0.7)', //叠加指标背景色
  31. DynamicTitleFont: '12px 微软雅黑', //指标动态标题字体
  32. UpTextColor: "rgb(238,21,21)",
  33. DownTextColor: "rgb(25,158,0)",
  34. UnchagneTextColor: "rgb(101,104,112)",
  35. CloseLineColor: 'rgb(178,34,34)',
  36. IndexTitle:
  37. {
  38. UpDownArrow: //数值涨跌箭头
  39. {
  40. //UpColor:"rgb(238,21,21)", //上涨
  41. //DownColor:"rgb(25,158,0)", //下跌
  42. UnchangeColor:"rgb(190, 190 ,190)" //不变
  43. },
  44. //NameArrow:{ Color:"rgb(190, 190 ,190)", Space:2, Symbol:'▼' },
  45. },
  46. Title:
  47. {
  48. TradeIndexColor:'rgb(105,105,105)', //交易指标颜色
  49. ColorIndexColor:'rgb(112,128,144)', //五彩K线颜色
  50. VolColor:"rgb(101,104,112)", //标题成交量
  51. AmountColor:"rgb(101,104,112)", //成交金额
  52. DateTimeColor:"rgb(101,104,112)", //时间,日期
  53. SettingColor:"rgb(101,104,112)", //周期,复权
  54. NameColor:"rgb(101,104,112)" , //股票名称
  55. TurnoverRateColor:'rgb(101,104,112)', //换手率
  56. PositionColor:"rgb(101,104,112)" //持仓
  57. },
  58. FrameBorderPen: "rgba(236,236,236,0.13)", //边框
  59. FrameSplitPen: "rgba(236,236,236,0.13)", //分割线
  60. FrameSplitTextColor: "rgb(101,104,112)", //刻度文字颜色
  61. FrameSplitTextFont: "12px 微软雅黑", //坐标刻度文字字体
  62. FrameTitleBGColor: "rgb(246,251,253)", //标题栏背景色
  63. Frame: { XBottomOffset: 0 }, //X轴文字向下偏移
  64. FrameLatestPrice: {
  65. TextColor: 'rgb(255,255,255)', //最新价格文字颜色
  66. UpBarColor: "rgb(238,21,21)", //上涨
  67. DownBarColor: "rgb(25,158,0)", //下跌
  68. UnchagneBarColor: "rgb(190,190,190)", //平盘
  69. BGAlpha: 0.6
  70. },
  71. CorssCursorBGColor: "rgb(43,54,69)", //十字光标背景
  72. CorssCursorTextColor: "rgb(255,255,255)",
  73. CorssCursorTextFont: "12px 微软雅黑",
  74. CorssCursorHPenColor: "rgb(130,130,130)", //十字光标线段颜色
  75. CorssCursorVPenColor: "rgb(130,130,130)", //十字光标线段颜色
  76. KLine:
  77. {
  78. MaxMin: { Font: '12px 微软雅黑', Color: 'rgb(111,111,111)', RightArrow:"→", LeftArrow:"←", HighYOffset:0, LowYOffset:0 }, //K线最大最小值显示
  79. Info: //信息地雷
  80. {
  81. Color: 'rgb(205,149,12)',
  82. TextColor: '#afc0da',
  83. TextBGColor: '#1a283e',
  84. Investor:
  85. {
  86. ApiUrl: '/API/NewsInteract', //互动易
  87. },
  88. Announcement: //公告
  89. {
  90. ApiUrl: '/API/ReportList',
  91. },
  92. Pforecast: //业绩预告
  93. {
  94. ApiUrl: '/API/StockHistoryDay',
  95. },
  96. Research: //调研
  97. {
  98. ApiUrl: '/API/InvestorRelationsList',
  99. },
  100. BlockTrading: //大宗交易
  101. {
  102. ApiUrl: '/API/StockHistoryDay',
  103. },
  104. TradeDetail: //龙虎榜
  105. {
  106. ApiUrl: '/API/StockHistoryDay',
  107. },
  108. Policy: //策略
  109. {
  110. ApiUrl: '/API/StockHistoryDay',
  111. }
  112. }
  113. },
  114. PriceGapStyple:
  115. {
  116. Line:{ Color:"rgb(128,128,128)" },
  117. Text:{ Color:"rgb(219,220,220)", Font:`12px 微软雅黑` }
  118. },
  119. Index: { //指标线段颜色
  120. LineColor: [
  121. "rgb(255,189,09)",
  122. "rgb(22,198,255)",
  123. "rgb(174,35,161)",
  124. "rgb(236,105,65)",
  125. "rgb(68,114,196)",
  126. "rgb(229,0,79)",
  127. "rgb(0,128,255)",
  128. "rgb(252,96,154)",
  129. "rgb(42,230,215)",
  130. "rgb(24,71,178)",
  131. ],
  132. NotSupport: { Font: "14px 微软雅黑", TextColor: "rgb(52,52,52)" }
  133. },
  134. ColorArray: //自定义指标默认颜色
  135. [
  136. "rgb(255,174,0)",
  137. "rgb(25,199,255)",
  138. "rgb(175,95,162)",
  139. "rgb(236,105,65)",
  140. "rgb(68,114,196)",
  141. "rgb(229,0,79)",
  142. "rgb(0,128,255)",
  143. "rgb(252,96,154)",
  144. "rgb(42,230,215)",
  145. "rgb(24,71,178)",
  146. ],
  147. //画图工具
  148. DrawPicture:
  149. {
  150. LineColor:
  151. [
  152. "rgb(41,98,255)"
  153. ],
  154. PointColor:
  155. [
  156. "rgb(41,98,255)", //选中颜色
  157. "rgb(89,135,255)", //moveon颜色
  158. "rgb(0,0,0)" //空心点背景色
  159. ],
  160. },
  161. TooltipPaint: //Tooltip
  162. {
  163. BGColor: 'rgba(20,20,20,0.8)', //背景色
  164. BorderColor: 'rgb(210,210,210)', //边框颜色
  165. TitleColor: 'rgb(210,210,210)', //标题颜色
  166. TitleFont:'13px 微软雅黑' //字体
  167. },
  168. //深度图
  169. DepthChart:
  170. {
  171. BidColor: { Line:"rgb(82,176,123)", Area:"rgba(82,176,123,0.5)"}, //卖
  172. AskColor: { Line:"rgb(207,76,89)", Area:"rgba(207,76,89, 0.5)"}, //买
  173. LineWidth:4
  174. },
  175. DepthCorss:
  176. {
  177. BidColor: { Line:"rgb(82,176,123)" }, //卖
  178. AskColor: { Line:"rgb(207,76,89)" }, //买
  179. LineWidth:2, //线段宽度
  180. LineDash:[3,3],
  181. Tooltip:
  182. {
  183. BGColor:'rgba(54,54,54, 0.8)', TextColor:"rgb(203,215,224)",
  184. Border:{ Top:5, Left:20, Bottom:5, Center: 5},
  185. Font:"14px 微软雅黑",
  186. LineHeight:16 //单行高度
  187. }
  188. },
  189. //报价列表
  190. Report:
  191. {
  192. BorderColor:'rgb(38,38,41)', //边框线
  193. SelectedColor:"rgb(49,48,56)", //选中行
  194. Header:
  195. {
  196. Color:"rgb(245,245,245)",
  197. SortColor:"rgb(255,0,0)",
  198. Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
  199. Font:{ Size:15, Name:"微软雅黑" }
  200. },
  201. Item:
  202. {
  203. Mergin:{ Top:2, Bottom:0,Left:5, Right:5 },
  204. Font:{ Size:15, Name:"微软雅黑"},
  205. BarMergin:{ Top:2, Left:3, Right:3, Bottom:2 },
  206. NameFont:{ Size:14, Name:"微软雅黑" },
  207. SymbolFont:{ Size:12, Name:"微软雅黑" }
  208. },
  209. //固定行
  210. FixedItem:
  211. {
  212. Font:{ Size:15, Name:"微软雅黑"},
  213. },
  214. LimitBorder:
  215. {
  216. Color:"rgb(64,64,64)",
  217. Mergin:{ Top:1, Bottom:1,Left:0, Right:0 },
  218. },
  219. FieldColor:
  220. {
  221. Index:"rgb(245,245,245)", //序号
  222. Symbol:"rgb(255,255,255)",
  223. Name:"rgb(255,255,255)",
  224. Amount:"rgb(2,226,244)", //成交金额
  225. Vol:"rgb(192,192,0)", //成交量
  226. BarTitle:'rgb(245,245,245)', //柱子文字
  227. Text:"rgb(245,245,245)", //默认文本
  228. },
  229. UpTextColor:"rgb(238,21,21)", //上涨文字颜色
  230. DownTextColor:"rgb(25,158,0)", //下跌文字颜色
  231. UnchagneTextColor:"rgb(228,228,228)", //平盘文字颜色
  232. PageInfo:
  233. {
  234. Font:{ Size:15, Name:"微软雅黑"},
  235. TextColor:"rgb(255,255,255)",
  236. BGColor:"rgba(49,48,56,0.8)",
  237. Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
  238. }
  239. }
  240. };
  241. return BLACK_STYLE;
  242. }
  243. function GetWhiteStyle()
  244. {
  245. var WHITE_STYLE= //白色风格
  246. {
  247. BGColor:'rgb(255,255,255)',
  248. TooltipBGColor: "rgb(255, 255, 255)", //背景色
  249. TooltipAlpha: 0.92, //透明度
  250. SelectRectBGColor:"rgba(1,130,212,0.06)", //背景色
  251. // this.SelectRectAlpha=0.06; //透明度
  252. UpBarColor: "rgb(238,21,21)",
  253. DownBarColor: "rgb(25,158,0)",
  254. UnchagneBarColor: "rgb(0,0,0)",
  255. Minute:
  256. {
  257. VolBarColor : "rgb(238,127,9)",
  258. PriceColor : "rgb(50,171,205)",
  259. AvPriceColor : "rgb(238,127,9)",
  260. NightDay:
  261. {
  262. NightBGColor:"rgb(22,22,22)",
  263. Font:`12px 微软雅黑`,
  264. Day: { Color:"rgb(153,153,153)", BGColor:"rgb(51,51,51)", BorderColor:"rgb(51,51,51)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
  265. Night: { Color:"rgb(153,153,153)", BGColor:"rgb(51,51,51)", BorderColor:"rgb(51,51,51)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
  266. }
  267. },
  268. DefaultTextColor: "rgb(43,54,69)",
  269. DefaultTextFont: '14px 微软雅黑',
  270. DynamicTitleFont: '12px 微软雅黑', //指标动态标题字体
  271. UpTextColor: "rgb(238,21,21)",
  272. DownTextColor: "rgb(25,158,0)",
  273. UnchagneTextColor: "rgb(0,0,0)",
  274. CloseLineColor: 'rgb(178,34,34)',
  275. IndexTitle:
  276. {
  277. UpDownArrow: //数值涨跌箭头
  278. {
  279. UpColor:"rgb(238,21,21)", //上涨
  280. DownColor:"rgb(25,158,0)", //下跌
  281. UnchangeColor:"rgb(0, 0 ,0)" //不变
  282. },
  283. NameArrow:{ Color:"rgb(190, 190 ,190)", Space:2, Symbol:'▼' },
  284. },
  285. FrameBorderPen: "rgb(225,236,242)", //边框
  286. FrameSplitPen: "rgb(225,236,242)", //分割线
  287. FrameSplitTextColor: "rgb(51,51,51)", //刻度文字颜色
  288. FrameSplitTextFont: "12px 微软雅黑", //坐标刻度文字字体
  289. FrameTitleBGColor: "rgb(246,251,253)", //标题栏背景色
  290. CorssCursorBGColor: "rgb(43,54,69)", //十字光标背景
  291. CorssCursorTextColor: "rgb(255,255,255)",
  292. CorssCursorTextFont: "12px 微软雅黑",
  293. CorssCursorPenColor: "rgb(130,130,130)", //十字光标线段颜色
  294. KLine:
  295. {
  296. MaxMin: { Font: '12px 微软雅黑', Color: 'rgb(111,111,111)', RightArrow:"→", LeftArrow:"←", HighYOffset:0, LowYOffset:0 }, //K线最大最小值显示
  297. Info: //信息地雷
  298. {
  299. Color: 'rgb(205,149,12)',
  300. TextColor: '#197de9',
  301. TextBGColor: '#e1e4ef',
  302. Investor:
  303. {
  304. ApiUrl: '/API/NewsInteract', //互动易
  305. },
  306. Announcement: //公告
  307. {
  308. ApiUrl: '/API/ReportList',
  309. },
  310. Pforecast: //业绩预告
  311. {
  312. ApiUrl: '/API/StockHistoryDay',
  313. },
  314. Research: //调研
  315. {
  316. ApiUrl: '/API/InvestorRelationsList',
  317. },
  318. BlockTrading: //大宗交易
  319. {
  320. ApiUrl: '/API/StockHistoryDay',
  321. },
  322. TradeDetail: //龙虎榜
  323. {
  324. ApiUrl: '/API/StockHistoryDay',
  325. },
  326. Policy: //策略
  327. {
  328. ApiUrl: '/API/StockHistoryDay',
  329. }
  330. }
  331. },
  332. Index:
  333. { //指标线段颜色
  334. LineColor:
  335. [
  336. "rgb(255,189,09)",
  337. "rgb(22,198,255)",
  338. "rgb(174,35,161)",
  339. "rgb(236,105,65)",
  340. "rgb(68,114,196)",
  341. "rgb(229,0,79)",
  342. "rgb(0,128,255)",
  343. "rgb(252,96,154)",
  344. "rgb(42,230,215)",
  345. "rgb(24,71,178)",
  346. ],
  347. NotSupport: { Font: "14px 微软雅黑", TextColor: "rgb(52,52,52)" }
  348. },
  349. ColorArray: //自定义指标默认颜色
  350. [
  351. "rgb(255,174,0)",
  352. "rgb(25,199,255)",
  353. "rgb(175,95,162)",
  354. "rgb(236,105,65)",
  355. "rgb(68,114,196)",
  356. "rgb(229,0,79)",
  357. "rgb(0,128,255)",
  358. "rgb(252,96,154)",
  359. "rgb(42,230,215)",
  360. "rgb(24,71,178)",
  361. ],
  362. //画图工具
  363. DrawPicture:
  364. {
  365. LineColor: "rgb(30,144,255)",
  366. PointColor: "rgb(105,105,105)",
  367. },
  368. }
  369. return WHITE_STYLE;
  370. }
  371. var STYLE_TYPE_ID=
  372. {
  373. BLACK_ID:1, //黑色风格
  374. WHITE_ID:2 //白色风格
  375. }
  376. function GetStyleConfig(styleid) //获取一个风格的配置变量
  377. {
  378. switch (styleid)
  379. {
  380. case STYLE_TYPE_ID.BLACK_ID:
  381. return GetBlackStyle();
  382. case STYLE_TYPE_ID.WHITE_ID:
  383. return GetWhiteStyle();
  384. default:
  385. return null;
  386. }
  387. }
  388. var JSCommonHQStyle=
  389. {
  390. GetStyleConfig:GetStyleConfig,
  391. STYLE_TYPE_ID:STYLE_TYPE_ID
  392. };
  393. export
  394. {
  395. JSCommonHQStyle
  396. }
  397. /*
  398. module.exports =
  399. {
  400. JSCommonHQStyle:
  401. {
  402. GetStyleConfig:GetStyleConfig,
  403. STYLE_TYPE_ID:STYLE_TYPE_ID
  404. }
  405. };
  406. */