umychart.style.wechat.js 15 KB

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