umychart.resource.wechat.js 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266
  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. import { IFrameSplitOperator } from "./umychart.framesplit.wechat";
  9. function JSChartResource()
  10. {
  11. this.TooltipBGColor = "rgb(255, 255, 255)"; //背景色
  12. this.TooltipAlpha = 0.92; //透明度
  13. this.SelectRectBGColor = "rgba(1,130,212,0.06)"; //背景色
  14. // this.SelectRectAlpha=0.06; //透明度
  15. this.BGColor = 'rgb(255,255,255)'; //背景色
  16. this.UpBarColor = "rgb(238,21,21)";
  17. this.DownBarColor = "rgb(25,158,0)";
  18. this.UnchagneBarColor = "rgb(0,0,0)";
  19. this.EmptyBarBGColor="rgb(255,255,255)"; //空心柱子背景色
  20. this.MinKLineBarWidth=4; //最小的柱子宽度 比这个还小就画直线
  21. this.MinColorKBarWidth=4;
  22. this.Minute = {};
  23. this.Minute.VolBarColor = null;
  24. this.Minute.PriceColor = "rgb(50,171,205)";
  25. this.Minute.PriceLineWidth=1; //价格线宽度
  26. this.Minute.AreaPriceColor = 'rgba(50,171,205,0.1)';
  27. this.Minute.AvPriceColor = "rgb(238,127,9)";
  28. this.Minute.NightDay=
  29. {
  30. NightBGColor:"rgba(0,0,0,0.2)",
  31. Font:`12px 微软雅黑`,
  32. Day: { Color:"rgb(0,0,0)", BGColor:"rgb(179,179,179)", BorderColor:"rgb(179,179,179)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
  33. Night: { Color:"rgb(0,0,0)", BGColor:"rgb(179,179,179)", BorderColor:"rgb(179,179,179)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
  34. }
  35. this.DefaultTextColor = "rgb(43,54,69)";
  36. this.DefaultTextFont = '14px 微软雅黑';
  37. this.IndexTitleBGColor='rgb(217,219,220)'; //指标名字背景色
  38. this.IndexTitleBorderColor='rgb(180,180,180)';
  39. this.IndexTitleColor="rgb(43,54,69)";
  40. this.DynamicTitleFont = '12px 微软雅黑'; //指标动态标题字体
  41. this.OverlayIndexTitleBGColor='rgba(255,255,255,0.7)';
  42. this.IndexTitleButton=
  43. {
  44. Mergin:{ Left:5, Top:2, Bottom:1, Right:5 },
  45. Font:"11px 微软雅黑" ,
  46. RightSpace:5,
  47. }
  48. this.IndexTitle=
  49. {
  50. UpDownArrow: //数值涨跌箭头
  51. {
  52. UpColor:"rgb(238,21,21)", //上涨
  53. DownColor:"rgb(25,158,0)", //下跌
  54. UnchangeColor:"rgb(0,0,0)" //不变
  55. },
  56. ArrowType:0,
  57. EnableIndexArrow:true, //指标数值是否带上涨下跌箭头
  58. NameArrow:{ Color:"rgb(43,54,69)", Space:2, Symbol:'▼' },
  59. IsSinlgeLine:false, //主图指标是否单行显示 false=多行显示
  60. }
  61. this.UpTextColor = "rgb(238,21,21)";
  62. this.DownTextColor = "rgb(25,158,0)";
  63. this.UnchagneTextColor = "rgb(0,0,0)";
  64. this.CloseLineColor = 'rgb(0,191,255)';
  65. this.CloseLineAreaColor = ['rgba(0,191,255,0.8)', 'rgba(0,191,255,0.2)'];
  66. this.Title = {
  67. TradeIndexColor:'rgb(105,105,105)', //交易指标颜色
  68. ColorIndexColor:'rgb(112,128,144)', //五彩K线颜色
  69. VolColor:"rgb(43,54,69)", //标题成交量
  70. AmountColor:"rgb(43,54,69)", //成交金额
  71. DateTimeColor:"rgb(43,54,69)", //时间,日期
  72. SettingColor:"rgb(43,54,69)", //周期,复权
  73. NameColor:"rgb(43,54,69)" , //股票名称
  74. TurnoverRateColor:'rgb(43,54,69)', //换手率
  75. PositionColor:"rgb(43,54,69)" //持仓
  76. };
  77. this.FrameBorderPen = "rgb(225,236,242)";
  78. this.FrameSplitPen = "rgb(225,236,242)"; //分割线
  79. this.FrameSplitTextColor = "rgb(51,51,51)"; //刻度文字颜色
  80. this.FrameSplitTextFont = "12px 微软雅黑"; //坐标刻度文字字体
  81. this.FrameYLineDash=[2, 2]; //Y轴线段虚线点间距,填null 就是实线
  82. this.FrameXLineDash=null; //X轴线段虚线点间距,填null 就是实线
  83. //this.FrameSplitTextFont = "14px PingFang-SC-Bold";//坐标刻度文字字体
  84. this.FrameTitleBGColor = "rgb(246,251,253)"; //标题栏背景色
  85. this.Frame = {
  86. XBottomOffset: 0 , //X轴文字向下偏移
  87. YTopOffset:2, //Y轴顶部文字向下偏移
  88. YTextPadding:[2,2],
  89. StringFormat:0,
  90. EnableRemoveZero:true, //移除小数点后面的0
  91. TitleBorderLine:{ Color:null, Dash:null },
  92. };
  93. this.FrameLogo=
  94. {
  95. TextColor:'rgb(178,34,34)',
  96. Font:"bold 16px 微软雅黑",
  97. Text:"*仅学习使用*" //请求不要修改声明, 任何修改声明产生的任何法律责任由修改者自行独立承担,与HQChart插件作者无关。
  98. };
  99. this.FrameLatestPrice =
  100. {
  101. TextColor: 'rgb(255,255,255)', //最新价格文字颜色
  102. UpBarColor: "rgb(238,21,21)", //上涨
  103. DownBarColor: "rgb(25,158,0)", //下跌
  104. UnchagneBarColor: "rgb(0,0,0)", //平盘
  105. BGAlpha: 0.6,
  106. OverlayTextColor:"rgb(255,255,255)", //叠加股票的文字颜色
  107. };
  108. this.FrameMargin = 4; //左右一共的边距
  109. this.FrameLeftMargin = 2;
  110. this.FrameRightMargin=2;
  111. //叠加指标框架
  112. this.OverlayFrame=
  113. {
  114. BolderPen:'rgb(190,190,190)', //指标边框线
  115. TitleColor:'rgb(105,105,105)', //指标名字颜色
  116. TitleFont:'11px arial', //指标名字字体
  117. };
  118. this.CorssCursorBGColor = "rgb(43,54,69)"; //十字光标背景
  119. this.CorssCursorTextColor = "rgb(255,255,255)";
  120. this.CorssCursorTextFont = "12px 微软雅黑";
  121. this.CorssCursorHPenColor = "rgb(130,130,130)"; //十字光标线段颜色(水平)
  122. this.CorssCursorVPenColor = "rgb(130,130,130)"; //十字光标线段颜色(垂直)
  123. this.CorssCursorLineDash=[3,2]; //十字光标虚线
  124. this.CorssCursor=
  125. {
  126. CorssPoint:
  127. {
  128. Center:{ Radius:5, Color:"rgb(50,171,205)"},
  129. Border:{ Color:'rgb(255,255,255)', Width:1}
  130. },
  131. BottomText:{ Margin: { Left:4, Right:4, Top:2, Bottom:2 }, TextOffset:{X:4, Y:0 } },
  132. LeftText:{ Margin: { Left:4, Right:4, Top:2, Bottom:2 }, TextOffset:{X:4, Y:0 } },
  133. RightText:{ Margin: { Left:4, Right:4, Top:2, Bottom:2 }, TextOffset:{X:4, Y:0 } },
  134. }
  135. //指标锁
  136. this.IndexLock=
  137. {
  138. BGColor:"rgb(220, 220, 220)",
  139. TextColor:"rgb(210, 34, 34)",
  140. Font:'14px 微软雅黑',
  141. Title:'🔒开通权限'
  142. }
  143. this.LatestPointFlash=
  144. {
  145. PointColor:"rgb(50,171,205)",
  146. PointRadius:3,
  147. BGColor:"rgba(50,171,205,0.7)",
  148. BGRadius:6,
  149. }
  150. this.Domain = "http://127.0.0.1:8080"; //API域名
  151. this.CacheDomain = "http://127.0.0.1:8087"; //缓存域名
  152. this.KLine =
  153. {
  154. MaxMin: { Font: '12px 微软雅黑', Color: 'rgb(111,111,111)', RightArrow:"→", LeftArrow:"←", HighYOffset:0, LowYOffset:0 }, //K线最大最小值显示
  155. Info: //信息地雷
  156. {
  157. Color: 'rgb(205,149,12)',
  158. Color2: 'rgb(255,133,3)', //三角图形颜色
  159. TextColor: '#197de9',
  160. TextBGColor: 'rgba(220,220,220,0.5)',
  161. Investor:
  162. {
  163. ApiUrl: '/API/NewsInteract', //互动易
  164. },
  165. Announcement: //公告
  166. {
  167. ApiUrl: '/API/ReportList',
  168. },
  169. Pforecast: //业绩预告
  170. {
  171. ApiUrl: '/API/StockHistoryDay',
  172. },
  173. Research: //调研
  174. {
  175. ApiUrl: '/API/InvestorRelationsList',
  176. },
  177. BlockTrading: //大宗交易
  178. {
  179. ApiUrl: '/API/StockHistoryDay',
  180. },
  181. TradeDetail: //龙虎榜
  182. {
  183. ApiUrl: '/API/StockHistoryDay',
  184. },
  185. Policy: //策略
  186. {
  187. ApiUrl: '/API/StockHistoryDay',
  188. }
  189. }
  190. };
  191. this.PriceGapStyple=
  192. {
  193. Line:{ Color:"rgb(186,186,186)" },
  194. Text:{ Color:"rgb(105,105,105)", Font:'12px 微软雅黑' }
  195. };
  196. this.Index = {};
  197. //指标线段颜色
  198. this.Index.LineColor =
  199. [
  200. "rgb(255,189,09)",
  201. "rgb(22,198,255)",
  202. "rgb(174,35,161)",
  203. "rgb(236,105,65)",
  204. "rgb(68,114,196)",
  205. "rgb(229,0,79)",
  206. "rgb(0,128,255)",
  207. "rgb(252,96,154)",
  208. "rgb(42,230,215)",
  209. "rgb(24,71,178)",
  210. ];
  211. this.ColorArray = //自定义指标默认颜色
  212. [
  213. "rgb(255,174,0)",
  214. "rgb(25,199,255)",
  215. "rgb(175,95,162)",
  216. "rgb(236,105,65)",
  217. "rgb(68,114,196)",
  218. "rgb(229,0,79)",
  219. "rgb(0,128,255)",
  220. "rgb(252,96,154)",
  221. "rgb(42,230,215)",
  222. "rgb(24,71,178)",
  223. ];
  224. this.OverlaySymbol={ Random:0 }; //Random 颜色的随机数
  225. this.OverlaySymbol.Color= //叠加股票颜色
  226. [
  227. "rgb(38,198,218)",
  228. "rgb(103,58,183)",
  229. "rgb(0,191,165)",
  230. "rgb(130,177,255)",
  231. ];
  232. //历史数据api
  233. this.Index.StockHistoryDayApiUrl = "https://opensource.zealink.com/API/StockHistoryDay";
  234. //市场多空
  235. this.Index.MarketLongShortApiUrl = "https://opensource.zealink.com/API/FactorTiming";
  236. //市场关注度
  237. this.Index.MarketAttentionApiUrl = "https://opensource.zealink.com/API/MarketAttention";
  238. //行业,指数热度
  239. this.Index.MarketHeatApiUrl = "https://opensource.zealink.com/API/MarketHeat"
  240. //自定义指数热度
  241. this.Index.CustomIndexHeatApiUrl = "https://opensource.zealink.com/API/QuadrantCalculate";
  242. //指标不支持信息
  243. this.Index.NotSupport = { Font: "14px 微软雅黑", TextColor: "rgb(52,52,52)" };
  244. //画图工具
  245. this.DrawPicture =
  246. {
  247. LineColor:
  248. [
  249. "rgb(41,98,255)"
  250. ],
  251. PointColor:
  252. [
  253. "rgb(41,98,255)", //选中颜色
  254. "rgb(89,135,255)", //moveon颜色
  255. "rgb(255,255,255)" //空心点背景色
  256. ],
  257. }
  258. this.KLineTrain =
  259. {
  260. Font: 'bold 14px 宋体',
  261. LastDataIcon: { Color: 'rgb(0,0,205)', Text: '⬇' },
  262. BuyIcon: { Color: 'rgb(255,185, 15)', Text: '买' },
  263. SellIcon: { Color: 'rgb(70,130,180)', Text: '卖' }
  264. };
  265. //K线tooltip
  266. this.TooltipPaint =
  267. {
  268. BGColor: 'rgba(250,250,250,0.8)', //背景色
  269. BorderColor: 'rgb(120,120,120)', //边框颜色
  270. TitleColor: 'rgb(120,120,120)', //标题颜色
  271. TitleFont: '13px 微软雅黑' //字体
  272. },
  273. //弹幕
  274. this.Barrage =
  275. {
  276. Font: '16px 微软雅黑', //字体
  277. Height: 20,
  278. Color: 'RGB(109,109,109)'
  279. }
  280. //走势图 信息地雷
  281. this.MinuteInfo = {
  282. TextColor: 'rgb(84,143,255)',
  283. Font: '14px 微软雅黑',
  284. PointColor: 'rgb(38,113,254)',
  285. LineColor: 'rgb(120,167,255)',
  286. TextBGColor: 'rgba(255,255,255,0.8)',
  287. PointRadius:4, //圆点半径
  288. };
  289. //单图标指标ChartSingleText -> DRAWICON
  290. this.DRAWICON=
  291. {
  292. Text:
  293. {
  294. MaxSize:50, //字体最大
  295. MinSize:20, //字体最小
  296. Zoom:
  297. {
  298. Type:2, //0=放大(K线宽度*Value) 1=放大(K线+间距)*Value 2=(K线+间距)+2*Value;
  299. Value:1
  300. },
  301. FontName:'Arial' //字体
  302. }
  303. }
  304. this.DRAWTEXT=
  305. {
  306. MaxSize:18, //字体最大
  307. MinSize:18, //字体最小
  308. Zoom:
  309. {
  310. Type:1, //0=放大(K线宽度*Value) 1=放大(K线+间距)*Value 2=(K线+间距)+2*Value;
  311. Value:1
  312. },
  313. FontName:'微软雅黑' //字体
  314. }
  315. this.DRAWNUMBER=
  316. {
  317. MaxSize:18, //字体最大
  318. MinSize:18, //字体最小
  319. Zoom:
  320. {
  321. Type:1, //0=放大(K线宽度*Value) 1=放大(K线+间距)*Value 2=(K线+间距)+2*Value;
  322. Value:1
  323. },
  324. FontName:'微软雅黑' //字体
  325. }
  326. this.DRAWABOVE=
  327. {
  328. YOffset:0 //y坐标向上偏移
  329. }
  330. this.DRAWTEXT_FIX={ Font:'14px 微软雅黑' }
  331. this.DRAWNUMBER_FIX={ Font:'14px 微软雅黑' }
  332. this.CIRCLEDOT=
  333. {
  334. Radius:1.3
  335. }
  336. this.POINTDOT=
  337. {
  338. Radius:2
  339. }
  340. this.DOTLINE=
  341. {
  342. LineDash:[3,5]
  343. }
  344. this.ChartPointDot=
  345. {
  346. UpColor:"rgb(255,61,61)",
  347. DownColor:"rgb(0,199,65)"
  348. }
  349. this.StockChip=
  350. {
  351. InfoColor:'rgb(0,0,0)', //文字颜色
  352. Font:'12px 微软雅黑',
  353. DayInfoColor:'rgb(255,255,255)', //周期颜色内文字颜色
  354. PhoneCloseButton:
  355. {
  356. Color:"rgb(255,255,255)",
  357. Size:15,
  358. Border:{ BGColor:"rgb(169,169,169)" }
  359. }
  360. }
  361. //深度图
  362. this.DepthChart=
  363. {
  364. BidColor: { Line:"rgb(82,176,123)", Area:"rgba(82,176,123,0.8)"}, //卖
  365. AskColor: { Line:"rgb(207,76,89)", Area:"rgba(207,76,89, 0.8)"}, //买
  366. LineWidth:4
  367. }
  368. this.DepthCorss=
  369. {
  370. BidColor: { Line:"rgb(82,176,123)" }, //卖
  371. AskColor: { Line:"rgb(207,76,89)" }, //买
  372. LineWidth:2, //线段宽度
  373. LineDash:[3,3],
  374. Tooltip:
  375. {
  376. BGColor:'rgba(236,240,245, 0.8)', TextColor:"rgb(130,140,151)",
  377. Border:{ Top:5, Left:20, Right:20, Bottom:5, ItemSpace: 5},
  378. Font:"14px 微软雅黑",
  379. }
  380. }
  381. //报价列表
  382. this.Report=
  383. {
  384. BorderColor:'rgb(192,192,192)', //边框线
  385. SelectedColor:"rgb(180,240,240)", //选中行
  386. Header:
  387. {
  388. Color:"rgb(60,60,60)", //表头文字颜色
  389. SortColor:"rgb(255,0,0)", //排序箭头颜色
  390. Mergin:{ Left:5, Right:5, Top:4, Bottom:2}, //表头四周间距
  391. Font:{ Size:15, Name:"微软雅黑" } //表头字体
  392. },
  393. Item:
  394. {
  395. Mergin:{ Top:2, Bottom:0,Left:5, Right:5 }, //单元格四周间距
  396. Font:{ Size:15, Name:"微软雅黑"},
  397. BarMergin:{ Top:2, Left:3, Right:3, Bottom:2 },//单元格字体
  398. NameFont:{ Size:14, Name:"微软雅黑" },
  399. SymbolFont:{ Size:12, Name:"微软雅黑" }
  400. },
  401. //固定行
  402. FixedItem:
  403. {
  404. Font:{ Size:15, Name:"微软雅黑"},
  405. },
  406. LimitBorder:
  407. {
  408. Color:"rgb(180,180,180)",
  409. Mergin:{ Top:1, Bottom:1,Left:0, Right:0 },
  410. },
  411. FieldColor:
  412. {
  413. Index:"rgb(60,60,60)", //序号
  414. Symbol:"rgb(60,60,60)",
  415. Name:"rgb(60,60,60)",
  416. Vol:"rgb(90,90,90)", //成交量
  417. Amount:"rgb(90,90,90)", //成交金额
  418. Text:"rgb(60,60,60)", //默认文本
  419. },
  420. UpTextColor:"rgb(238,21,21)", //上涨文字颜色
  421. DownTextColor:"rgb(25,158,0)", //下跌文字颜色
  422. UnchagneTextColor:"rgb(90,90,90)", //平盘文字颜色
  423. CloseLineColor:"rgb(30,144,255)",
  424. PageInfo:
  425. {
  426. Font:{ Size:15, Name:"微软雅黑"},
  427. TextColor:"rgb(0,0,0)",
  428. BGColor:"rgba(180,180,180,0.5)",
  429. Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
  430. },
  431. CloseLine:
  432. {
  433. CloseColor:"rgb(30,144,255)",
  434. YCloseColor:"rgba(105,105,105,0.5)", //昨收线
  435. AreaColor:'rgba(0,191,255,0.2)',
  436. },
  437. }
  438. // //自定义风格
  439. this.SetStyle = function (style)
  440. {
  441. if (style.TooltipBGColor) this.TooltipBGColor = style.TooltipBGColor;
  442. if (style.TooltipAlpha) this.TooltipAlpha = style.TooltipAlpha;
  443. if (style.BGColor) this.BGColor = style.BGColor;
  444. if (style.SelectRectBGColor) this.SelectRectBGColor = style.SelectRectBGColor;
  445. if (style.UpBarColor) this.UpBarColor = style.UpBarColor;
  446. if (style.DownBarColor) this.DownBarColor = style.DownBarColor;
  447. if (style.UnchagneBarColor) this.UnchagneBarColor = style.UnchagneBarColor;
  448. if (style.EmptyBarBGColor) this.EmptyBarBGColor=style.EmptyBarBGColor;
  449. if (style.Minute)
  450. {
  451. if (style.Minute.VolBarColor) this.Minute.VolBarColor = style.Minute.VolBarColor;
  452. if (style.Minute.PriceColor) this.Minute.PriceColor = style.Minute.PriceColor;
  453. if (style.Minute.AvPriceColor) this.Minute.AvPriceColor = style.Minute.AvPriceColor;
  454. if (style.Minute.AreaPriceColor) this.Minute.AreaPriceColor = style.Minute.AreaPriceColor;
  455. if (IFrameSplitOperator.IsNumber(style.Minute.PriceLineWidth)) this.Minute.PriceLineWidth = style.Minute.PriceLineWidth;
  456. if (style.Minute.NightDay)
  457. {
  458. var item=style.Minute.NightDay;
  459. if (item.NightBGColor) this.Minute.NightDay.NightBGColor=item.NightBGColor;
  460. if (item.Font) this.Minute.NightDay.Font=item.Font;
  461. if (item.Day)
  462. {
  463. var subItem=item.Day;
  464. if (subItem.Color) this.Minute.NightDay.Day.Color=subItem.Color;
  465. if (subItem.BGColor) this.Minute.NightDay.Day.BGColor=subItem.BGColor;
  466. if (subItem.BorderColor) this.Minute.NightDay.Day.BorderColor=subItem.BorderColor;
  467. JSChartResource.CopyMargin(this.Minute.NightDay.Day.Margin,subItem.Margin);
  468. }
  469. if (item.Night)
  470. {
  471. var subItem=item.Night;
  472. if (subItem.Color) this.Minute.NightDay.Night.Color=subItem.Color;
  473. if (subItem.BGColor) this.Minute.NightDay.Night.BGColor=subItem.BGColor;
  474. if (subItem.BorderColor) this.Minute.NightDay.Night.BorderColor=subItem.BorderColor;
  475. JSChartResource.CopyMargin(this.Minute.NightDay.Night.Margin,subItem.Margin);
  476. }
  477. }
  478. }
  479. if (style.DefaultTextColor) this.DefaultTextColor = style.DefaultTextColor;
  480. if (style.DefaultTextFont) this.DefaultTextFont = style.DefaultTextFont;
  481. if (style.DynamicTitleFont) this.DynamicTitleFont = style.DynamicTitleFont;
  482. if (style.IndexTitleBGColor) this.IndexTitleBGColor=style.IndexTitleBGColor;
  483. if (style.OverlayIndexTitleBGColor) this.OverlayIndexTitleBGColor=style.OverlayIndexTitleBGColor;
  484. if (style.IndexTitleBorderColor) this.IndexTitleBorderColor=style.IndexTitleBorderColor;
  485. if (style.IndexTitleColor) this.IndexTitleColor=style.IndexTitleColor;
  486. if (style.UpTextColor) this.UpTextColor = style.UpTextColor;
  487. if (style.DownTextColor) this.DownTextColor = style.DownTextColor;
  488. if (style.UnchagneTextColor) this.UnchagneTextColor = style.UnchagneTextColor;
  489. if (style.CloseLineColor) this.CloseLineColor = style.CloseLineColor;
  490. if (style.CloseLineAreaColor) this.CloseLineAreaColor = style.CloseLineAreaColor;
  491. if (style.FrameBorderPen) this.FrameBorderPen = style.FrameBorderPen;
  492. if (style.FrameSplitPen) this.FrameSplitPen = style.FrameSplitPen;
  493. if (style.FrameSplitTextColor) this.FrameSplitTextColor = style.FrameSplitTextColor;
  494. if (style.FrameSplitTextFont) this.FrameSplitTextFont = style.FrameSplitTextFont;
  495. if (style.FrameTitleBGColor) this.FrameTitleBGColor = style.FrameTitleBGColor;
  496. if (style.IndexTitle)
  497. {
  498. var item=style.IndexTitle;
  499. if (item.UpDownArrow)
  500. {
  501. var subItem=item.UpDownArrow;
  502. if (subItem.UpColor) this.IndexTitle.UpDownArrow.UpColor = subItem.UpColor;
  503. if (subItem.DownColor) this.IndexTitle.UpDownArrow.DownColor = subItem.DownColor;
  504. if (subItem.UnchangeColor) this.IndexTitle.UpDownArrow.UnchangeColor = subItem.UnchangeColor;
  505. }
  506. if (IFrameSplitOperator.IsNumber(item.ArrowType)) this.IndexTitle.ArrowType=item.ArrowType;
  507. if (IFrameSplitOperator.IsBool(item.EnableIndexArrow)) this.IndexTitle.EnableIndexArrow=item.EnableIndexArrow;
  508. if (IFrameSplitOperator.IsBool(item.IsSinlgeLine)) this.IndexTitle.IsSinlgeLine=item.IsSinlgeLine;
  509. if (item.NameArrow)
  510. {
  511. var subItem=item.NameArrow;
  512. if (subItem.Color) this.IndexTitle.NameArrow.Color = subItem.Color;
  513. if (subItem.Symbol) this.IndexTitle.NameArrow.Symbol = subItem.Symbol;
  514. if (IFrameSplitOperator.IsNumber(subItem.Space)) this.IndexTitle.NameArrow.Space = subItem.Space;
  515. }
  516. }
  517. if (style.Frame)
  518. {
  519. var item=style.Frame;
  520. if (style.Frame.XBottomOffset) this.Frame.XBottomOffset = style.Frame.XBottomOffset;
  521. if (style.Frame.YTopOffset) this.Frame.YTopOffset = style.Frame.YTopOffset;
  522. if (item.TitleBorderLine)
  523. {
  524. var subItem=item.TitleBorderLine;
  525. var destItem=this.Frame.TitleBorderLine;
  526. if (subItem.Color) destItem.Color=subItem.Color;
  527. if (IFrameSplitOperator.IsNonEmptyArray(subItem.Dash)) destItem.Dash=subItem.Dash.slice();
  528. }
  529. }
  530. if (style.FrameLatestPrice)
  531. {
  532. if (style.FrameLatestPrice.TextColor) this.FrameLatestPrice.TextColor = style.FrameLatestPrice.TextColor;
  533. if (style.FrameLatestPrice.UpBarColor) this.FrameLatestPrice.UpBarColor = style.FrameLatestPrice.UpBarColor;
  534. if (style.FrameLatestPrice.DownBarColor) this.FrameLatestPrice.DownBarColor = style.FrameLatestPrice.DownBarColor;
  535. if (style.FrameLatestPrice.UnchagneBarColor) this.FrameLatestPrice.UnchagneBarColor = style.FrameLatestPrice.UnchagneBarColor;
  536. if (style.FrameLatestPrice.BGAlpha) this.FrameLatestPrice.BGAlpha = style.FrameLatestPrice.BGAlpha;
  537. if (style.FrameLatestPrice.OverlayTextColor) this.FrameLatestPrice.OverlayTextColor = style.FrameLatestPrice.OverlayTextColor;
  538. }
  539. if (style.CorssCursorBGColor) this.CorssCursorBGColor = style.CorssCursorBGColor;
  540. if (style.CorssCursorTextColor) this.CorssCursorTextColor = style.CorssCursorTextColor;
  541. if (style.CorssCursorTextFont) this.CorssCursorTextFont = style.CorssCursorTextFont;
  542. if (style.CorssCursorHPenColor) this.CorssCursorHPenColor = style.CorssCursorHPenColor;
  543. if (style.CorssCursorVPenColor) this.CorssCursorVPenColor = style.CorssCursorVPenColor;
  544. if (style.CorssCursorLineDash) this.CorssCursorLineDash = style.CorssCursorLineDash.slice();
  545. if (style.CorssCursor && style.CorssCursor.CorssPoint)
  546. {
  547. var item=style.CorssCursor.CorssPoint;
  548. if (item.Center)
  549. {
  550. var subItem=item.Center;
  551. var subDest=this.CorssCursor.CorssPoint.Center;
  552. if (IFrameSplitOperator.IsNumber(subItem.Radius)) subDest.Radius=subItem.Radius;
  553. if (subItem.Color) subDest.Color=subItem.Color;
  554. }
  555. if (item.Border)
  556. {
  557. var subItem=item.Border;
  558. var subDest=this.CorssCursor.CorssPoint.Border;
  559. if (IFrameSplitOperator.IsNumber(subItem.Width)) subDest.Width=subItem.Width;
  560. if (subItem.Color) subDest.Color=subItem.Color;
  561. }
  562. }
  563. if (style.KLine) this.KLine = style.KLine;
  564. if (style.Index)
  565. {
  566. if (style.Index.LineColor) this.Index.LineColor = style.Index.LineColor;
  567. if (style.Index.NotSupport) this.Index.NotSupport = style.Index.NotSupport;
  568. }
  569. if (style.PriceGapStyple)
  570. {
  571. var item=style.PriceGapStyple;
  572. if (item.Line && item.Line.Color) this.PriceGapStyple.Line.Color=item.Line.Color;
  573. if (item.Text)
  574. {
  575. if (item.Text.Color) this.PriceGapStyple.Text.Color=item.Text.Color;
  576. if (item.Text.Font) this.PriceGapStyple.Text.Font=item.Text.Font;
  577. }
  578. }
  579. if (style.ColorArray) this.ColorArray = style.ColorArray;
  580. if (style.DrawPicture)
  581. {
  582. this.DrawPicture.LineColor = style.DrawPicture.LineColor;
  583. this.DrawPicture.PointColor = style.DrawPicture.PointColor;
  584. }
  585. if (style.TooltipPaint)
  586. {
  587. if (style.TooltipPaint.BGColor) this.TooltipPaint.BGColor = style.TooltipPaint.BGColor;
  588. if (style.TooltipPaint.BorderColor) this.TooltipPaint.BorderColor = style.TooltipPaint.BorderColor;
  589. if (style.TooltipPaint.TitleColor) this.TooltipPaint.TitleColor = style.TooltipPaint.TitleColor;
  590. if (style.TooltipPaint.TitleFont) this.TooltipPaint.TitleFont = style.TooltipPaint.TitleFont;
  591. }
  592. if (style.MinuteInfo)
  593. {
  594. var item=style.MinuteInfo;
  595. if (style.MinuteInfo.TextColor) this.MinuteInfo.TextColor=style.MinuteInfo.TextColor;
  596. if (style.MinuteInfo.Font) this.MinuteInfo.Font=style.MinuteInfo.Font;
  597. if (style.MinuteInfo.PointColor) this.MinuteInfo.PointColor=style.MinuteInfo.PointColor;
  598. if (style.MinuteInfo.LineColor) this.MinuteInfo.LineColor=style.MinuteInfo.LineColor;
  599. if (style.MinuteInfo.TextBGColor) this.MinuteInfo.TextBGColor=style.MinuteInfo.TextBGColor;
  600. if (IFrameSplitOperator.IsNumber(item.PointRadius)) this.MinuteInfo.PointRadius=item.PointRadius;
  601. }
  602. if (style.Title)
  603. {
  604. if (style.Title.TradeIndexColor) this.Title.TradeIndexColor=style.Title.TradeIndexColor;
  605. if (style.Title.ColorIndexColor) this.Title.ColorIndexColor=style.Title.ColorIndexColor;
  606. if (style.Title.VolColor) this.Title.VolColor=style.Title.VolColor;
  607. if (style.Title.AmountColor) this.Title.AmountColor=style.Title.AmountColor;
  608. if (style.Title.DateTimeColor) this.Title.DateTimeColor=style.Title.DateTimeColor;
  609. if (style.Title.NameColor) this.Title.NameColor=style.Title.NameColor;
  610. if (style.Title.SettingColor) this.Title.SettingColor=style.Title.SettingColor;
  611. if (style.Title.TurnoverRateColor) this.Title.TurnoverRateColor=style.Title.TurnoverRateColor;
  612. if (style.Title.PositionColor) this.Title.PositionColor=style.Title.PositionColor;
  613. }
  614. if (style.DRAWICON)
  615. {
  616. if (style.DRAWICON.Text)
  617. {
  618. var item=style.DRAWICON.Text;
  619. if (this.IsPlusNumber(item.MaxSize)) this.DRAWICON.Text.MaxSize=item.MaxSize;
  620. if (this.IsPlusNumber(item.MinSize)) this.DRAWICON.Text.MinSize=item.MinSize;
  621. if (item.Zoom) this.DRAWICON.Text.Zoom=item.Zoom;
  622. if (item.FontName) this.DRAWICON.Text.FontName=item.FontName;
  623. }
  624. }
  625. if (style.DRAWTEXT)
  626. {
  627. var item=style.DRAWTEXT;
  628. if (this.IsPlusNumber(item.MaxSize)) this.DRAWICON.MaxSize=item.MaxSize;
  629. if (this.IsPlusNumber(item.MinSize)) this.DRAWICON.MinSize=item.MinSize;
  630. if (item.Zoom) this.DRAWICON.Zoom=item.Zoom;
  631. if (item.FontName) this.DRAWICON.FontName=item.FontName;
  632. }
  633. if (style.DRAWNUMBER)
  634. {
  635. var item=style.DRAWNUMBER;
  636. if (this.IsPlusNumber(item.MaxSize)) this.DRAWNUMBER.MaxSize=item.MaxSize;
  637. if (this.IsPlusNumber(item.MinSize)) this.DRAWNUMBER.MinSize=item.MinSize;
  638. if (item.Zoom) this.DRAWNUMBER.Zoom=item.Zoom;
  639. if (item.FontName) this.DRAWNUMBER.FontName=item.FontName;
  640. }
  641. if (style.DRAWABOVE)
  642. {
  643. var item=style.DRAWABOVE;
  644. if (this.IsNumber(item.YOffset)) this.DRAWABOVE.YOffset=item.YOffset;
  645. }
  646. if (style.DRAWTEXT_FIX)
  647. {
  648. var item=style.DRAWTEXT_FIX;
  649. if (item.Font) this.DRAWTEXT_FIX.Font=item.Font;
  650. }
  651. if (style.DRAWNUMBER_FIX)
  652. {
  653. var item=style.DRAWNUMBER_FIX;
  654. if (item.Font) this.DRAWNUMBER_FIX.Font=item.Font;
  655. }
  656. if (style.StockChip)
  657. {
  658. var item=style.StockChip;
  659. if (item.Font) this.StockChip.Font=item.Font;
  660. if (item.InfoColor) this.StockChip.InfoColor=item.InfoColor;
  661. if (item.DayInfoColor) this.StockChip.DayInfoColor=item.DayInfoColor;
  662. if (item.PhoneCloseButton)
  663. {
  664. var subItem=item.PhoneCloseButton;
  665. if (subItem.Color) this.StockChip.PhoneCloseButton.Color=subItem.Color;
  666. if (IFrameSplitOperator.IsNumber(subItem.Size)) this.StockChip.PhoneCloseButton.Size=subItem.Size;
  667. if (subItem.Border)
  668. {
  669. if (subItem.Border.BGColor) this.StockChip.PhoneCloseButton.Border.BGColor=subItem.Border.BGColor;
  670. }
  671. }
  672. }
  673. if (style.DepthChart)
  674. {
  675. var item=style.DepthChart;
  676. if (item.BidColor)
  677. {
  678. if (item.BidColor.Line) this.DepthChart.BidColor.Line=item.BidColor.Line;
  679. if (item.BidColor.Area) this.DepthChart.BidColor.Area=item.BidColor.Area;
  680. }
  681. if (item.AskColor)
  682. {
  683. if (item.AskColor.Line) this.DepthChart.AskColor.Line=item.AskColor.Line;
  684. if (item.AskColor.Area) this.DepthChart.AskColor.Area=item.AskColor.Area;
  685. }
  686. if (item.LineWidth) this.DepthChart.LineWidth=item.LineWidth;
  687. }
  688. if (style.DepthCorss)
  689. {
  690. var item=style.DepthCorss;
  691. if (item.BidColor)
  692. {
  693. if (item.BidColor.Line) this.DepthCorss.BidColor.Line=item.BidColor.Line;
  694. }
  695. if (item.AskColor)
  696. {
  697. if (item.AskColor.Line) this.DepthCorss.AskColor.Line=item.AskColor.Line;
  698. }
  699. if (item.LineWidth) this.DepthCorss.LineWidth=item.LineWidth;
  700. if (item.LineDash) this.DepthCorss.LineDash=item.LineDash;
  701. if (item.Tooltip)
  702. {
  703. var tooltip=item.Tooltip;
  704. if (tooltip.BGColor) this.DepthCorss.Tooltip.BGColor=tooltip.BGColor;
  705. if (tooltip.TextColor) this.DepthCorss.Tooltip.TextColor=tooltip.TextColor;
  706. if (tooltip.Font) this.DepthCorss.Tooltip.Font=tooltip.Font;
  707. if (tooltip.LineHeight) this.DepthCorss.Tooltip.LineHeight=tooltip.LineHeight;
  708. var border=tooltip.Border;
  709. if (this.IsNumber(border.Top)) this.DepthCorss.Tooltip.Border.Top=border.Top;
  710. if (this.IsNumber(border.Left)) this.DepthCorss.Tooltip.Border.Left=border.Left;
  711. if (this.IsNumber(border.Right)) this.DepthCorss.Tooltip.Border.Right=border.Right;
  712. if (this.IsNumber(border.Bottom)) this.DepthCorss.Tooltip.Border.Bottom=border.Bottom;
  713. if (this.IsNumber(border.ItemSpace)) this.DepthCorss.Tooltip.Border.ItemSpace=border.ItemSpace;
  714. }
  715. }
  716. if (style.CIRCLEDOT)
  717. {
  718. var item=style.CIRCLEDOT;
  719. if (this.IsNumber(item.Radius)) this.CIRCLEDOT.Radius=item.Radius;
  720. }
  721. if (style.POINTDOT)
  722. {
  723. var item=style.POINTDOT;
  724. if (this.IsNumber(item.Radius)) this.POINTDOT.Radius=item.Radius;
  725. }
  726. if (style.DOTLINE)
  727. {
  728. var item=style.DOTLINE;
  729. if (IFrameSplitOperator.IsNonEmptyArray(item.LineDash)) this.DOTLINE.LineDash=item.LineDash.slice();
  730. }
  731. if (style.Report)
  732. {
  733. var item=style.Report;
  734. if (item.BorderColor) this.Report.BorderColor=item.BorderColor;
  735. if (item.UpTextColor) this.Report.UpTextColor=item.UpTextColor;
  736. if (item.DownTextColor) this.Report.DownTextColor=item.DownTextColor;
  737. if (item.UnchagneTextColor) this.Report.UnchagneTextColor=item.UnchagneTextColor;
  738. if (item.BorderColor) this.Report.SelectedColor=item.SelectedColor;
  739. if (item.CloseLineColor) this.Report.CloseLineColor=item.CloseLineColor;
  740. if (item.Header)
  741. {
  742. var header=item.Header;
  743. if (header.Color) this.Report.Header.Color=header.Color;
  744. if (header.SortColor) this.Report.Header.SortColor=header.SortColor;
  745. if (header.Mergin)
  746. {
  747. var mergin=header.Mergin;
  748. if (this.IsNumber(mergin.Left)) this.Report.Header.Mergin.Left=mergin.Left;
  749. if (this.IsNumber(mergin.Right)) this.Report.Header.Mergin.Left=mergin.Right;
  750. if (this.IsNumber(mergin.Top)) this.Report.Header.Mergin.Top=mergin.Top;
  751. if (this.IsNumber(mergin.Bottom)) this.Report.Header.Mergin.Bottom=mergin.Bottom;
  752. }
  753. if (header.Font)
  754. {
  755. var font=header.Font;
  756. if (font.Name) this.Report.Header.Font.Name=font.Name;
  757. if (this.IsNumber(font.Size)) this.Report.Header.Font.Size=font.Size;
  758. }
  759. }
  760. if (item.Item)
  761. {
  762. var row=item.Item;
  763. if (row.Mergin)
  764. {
  765. var mergin=row.Mergin;
  766. if (this.IsNumber(mergin.Left)) this.Report.Item.Mergin.Left=mergin.Left;
  767. if (this.IsNumber(mergin.Right)) this.Report.Item.Mergin.Right=mergin.Right;
  768. if (this.IsNumber(mergin.Top)) this.Report.Item.Mergin.Top=mergin.Top;
  769. if (this.IsNumber(mergin.Bottom)) this.Report.Item.Mergin.Bottom=mergin.Bottom;
  770. }
  771. if (row.Font)
  772. {
  773. var font=row.Font;
  774. if (font.Name) this.Report.Item.Font.Name=font.Name;
  775. if (this.IsNumber(font.Size)) this.Report.Item.Font.Size=font.Size;
  776. }
  777. if (row.BarMergin)
  778. {
  779. var mergin=row.BarMergin;
  780. if (this.IsNumber(mergin.Left)) this.Report.Item.BarMergin.Left=mergin.Left;
  781. if (this.IsNumber(mergin.Top)) this.Report.Item.BarMergin.Top=mergin.Top;
  782. if (this.IsNumber(mergin.Right)) this.Report.Item.BarMergin.Right=mergin.Right;
  783. if (this.IsNumber(mergin.Bottom)) this.Report.Item.BarMergin.Bottom=mergin.Bottom;
  784. }
  785. if (row.NameFont)
  786. {
  787. var font=row.NameFont;
  788. if (font.Name) this.Report.Item.NameFont.Name=font.Name;
  789. if (this.IsNumber(font.Size)) this.Report.Item.NameFont.Size=font.Size;
  790. }
  791. if (row.SymbolFont)
  792. {
  793. var font=row.SymbolFont;
  794. if (font.Name) this.Report.Item.SymbolFont.Name=font.Name;
  795. if (this.IsNumber(font.Size)) this.Report.Item.SymbolFont.Size=font.Size;
  796. }
  797. }
  798. if (item.FixedItem)
  799. {
  800. var row=item.FixedItem;
  801. if (row.Font)
  802. {
  803. var font=row.Font;
  804. if (font.Name) this.Report.FixedItem.Font.Name=font.Name;
  805. if (this.IsNumber(font.Size)) this.Report.FixedItem.Font.Size=font.Size;
  806. }
  807. }
  808. if (item.LimitBorder)
  809. {
  810. var limit=item.LimitBorder;
  811. if (limit.Color) this.Report.LimitBorder.Color=limit.Color;
  812. if (limit.Mergin)
  813. {
  814. var mergin=limit.Mergin;
  815. if (this.IsNumber(mergin.Left)) this.Report.LimitBorder.Mergin.Left=mergin.Left;
  816. if (this.IsNumber(mergin.Top)) this.Report.LimitBorder.Mergin.Top=mergin.Top;
  817. if (this.IsNumber(mergin.Right)) this.Report.LimitBorder.Mergin.Right=mergin.Right;
  818. if (this.IsNumber(mergin.Bottom)) this.Report.LimitBorder.Mergin.Bottom=mergin.Bottom;
  819. }
  820. }
  821. if (item.FieldColor)
  822. {
  823. var filed=item.FieldColor;
  824. if (filed.Name) this.Report.FieldColor.Name=filed.Name;
  825. if (filed.Symbol) this.Report.FieldColor.Symbol=filed.Symbol;
  826. if (filed.Vol) this.Report.FieldColor.Vol=filed.Vol;
  827. if (filed.Amount) this.Report.FieldColor.Amount=filed.Amount;
  828. if (filed.Index) this.Report.FieldColor.Index=filed.Index;
  829. if (filed.BarTitle) this.Report.FieldColor.BarTitle=filed.BarTitle;
  830. if (filed.Text) this.Report.FieldColor.Text=filed.Text;
  831. if (this.IsNonEmptyArray(filed.Bar))
  832. {
  833. for(var i=0;i<filed.Bar.length;++i)
  834. this.Report.FieldColor.Bar[i]=filed.Bar[i];
  835. }
  836. }
  837. if (item.PageInfo)
  838. {
  839. var pageinfo=item.PageInfo;
  840. if (pageinfo.Font)
  841. {
  842. var font=pageinfo.Font;
  843. if (font.Name) this.Report.PageInfo.Font.Name=font.Name;
  844. if (this.IsNumber(font.Size)) this.Report.PageInfo.Font.Size=font.Size;
  845. }
  846. if (pageinfo.TextColor) this.Report.PageInfo.TextColor=pageinfo.TextColor;
  847. if (pageinfo.BGColor) this.Report.PageInfo.BGColor=pageinfo.BGColor;
  848. if (pageinfo.Mergin)
  849. {
  850. var mergin=pageinfo.Mergin;
  851. if (this.IsNumber(mergin.Left)) this.Report.PageInfo.Mergin.Left=mergin.Left;
  852. if (this.IsNumber(mergin.Top)) this.Report.PageInfo.Mergin.Top=mergin.Top;
  853. if (this.IsNumber(mergin.Right)) this.Report.PageInfo.Mergin.Right=mergin.Right;
  854. if (this.IsNumber(mergin.Bottom)) this.Report.PageInfo.Mergin.Bottom=mergin.Bottom;
  855. }
  856. }
  857. }
  858. if (style.KLineTrain) this.SetKLineTrain(style.KLineTrain);
  859. if (style.IndexLock) this.SetIndexLock(style.IndexLock);
  860. if (style.LatestPointFlash) this.SetLatestPointFlash(style.LatestPointFlash);
  861. if (style.ChartPointDot) this.SetChartPointDot(style.ChartPointDot);
  862. }
  863. this.SetChartPointDot=function(style)
  864. {
  865. var dest=this.ChartPointDot;
  866. if (style.UpColor) dest.UpColor=style.UpColor;
  867. if (style.DownColor) dest.DownColor=style.DownColor;
  868. }
  869. this.SetLatestPointFlash=function(style)
  870. {
  871. var dest=this.LatestPointFlash;
  872. if (style.PointColor) dest.PointColor=style.PointColor;
  873. if (IFrameSplitOperator.IsNumber(style.PointRadius)) dest.PointRadius=style.PointRadius;
  874. if (style.BGColor) dest.BGColor=style.BGColor;
  875. if (IFrameSplitOperator.IsNumber(style.BGRadius)) dest.BGRadius=style.BGRadius;
  876. }
  877. this.SetKLineTrain=function(style)
  878. {
  879. var dest=this.KLineTrain;
  880. if (style.Font) dest.Font=style.Font;
  881. if (style.LastDataIcon)
  882. {
  883. var subItem=style.LastDataIcon;
  884. if (subItem.Color) dest.LastDataIcon.Color=subItem.Color;
  885. if (subItem.Text) dest.LastDataIcon.Text=subItem.Text;
  886. }
  887. if (style.BuyIcon)
  888. {
  889. var subItem=style.BuyIcon;
  890. if (subItem.Color) dest.BuyIcon.Color=subItem.Color;
  891. if (subItem.Text) dest.BuyIcon.Text=subItem.Text;
  892. }
  893. if (style.SellIcon)
  894. {
  895. var subItem=style.SellIcon;
  896. if (subItem.Color) dest.SellIcon.Color=subItem.Color;
  897. if (subItem.Text) dest.SellIcon.Text=subItem.Text;
  898. }
  899. }
  900. this.SetIndexLock=function(style)
  901. {
  902. var item=style;
  903. var dest=this.IndexLock;
  904. if (item.BGColor) dest.BGColor=item.BGColor;
  905. if (item.TextColor) dest.TextColor=item.TextColor;
  906. if (item.Font) dest.Font=item.Font;
  907. if (item.Title) dest.Title=item.Title;
  908. }
  909. this.IsNumber=function(value)
  910. {
  911. if (value==null) return false;
  912. if (isNaN(value)) return false;
  913. return true;
  914. }
  915. //判断是否是正数
  916. this.IsPlusNumber=function(value)
  917. {
  918. if (value==null) return false;
  919. if (isNaN(value)) return false;
  920. return value>0;
  921. }
  922. //是否是非空的数组
  923. this.IsNonEmptyArray=function(ary)
  924. {
  925. if (!ary) return;
  926. if (!Array.isArray(ary)) return;
  927. return ary.length>0;
  928. }
  929. }
  930. JSChartResource.CopyMargin=function(dest,src)
  931. {
  932. if (!src || !dest) return;
  933. if (IFrameSplitOperator.IsNumber(src.Left)) dest.Left=src.Left;
  934. if (IFrameSplitOperator.IsNumber(src.Top)) dest.Top=src.Top;
  935. if (IFrameSplitOperator.IsNumber(src.Right)) dest.Right=src.Right;
  936. if (IFrameSplitOperator.IsNumber(src.Bottom)) dest.Bottom=src.Bottom;
  937. }
  938. JSChartResource.CopyMarginConfig=function(dest,src)
  939. {
  940. if (!src || !dest) return;
  941. if (IFrameSplitOperator.IsNumber(src.Left)) dest.Left=src.Left;
  942. if (IFrameSplitOperator.IsNumber(src.Top)) dest.Top=src.Top;
  943. if (IFrameSplitOperator.IsNumber(src.Right)) dest.Right=src.Right;
  944. if (IFrameSplitOperator.IsNumber(src.Bottom)) dest.Bottom=src.Bottom;
  945. }
  946. var g_JSChartResource = new JSChartResource();
  947. var JSCHART_LANGUAGE_ID =
  948. {
  949. LANGUAGE_CHINESE_ID: 0, //简体中文 CN
  950. LANGUAGE_ENGLISH_ID: 1, //英文 EN
  951. LANGUAGE_TRADITIONAL_CHINESE_ID:2, //繁体中文 TC
  952. };
  953. function JSChartLocalization()
  954. {
  955. this.TextResource = new Map([
  956. //内部tooltip
  957. ['Tooltip-Open', {CN:'开:', EN:'O:', TC:'開'}],
  958. ['Tooltip-High', {CN:'高:', EN:'H:', TC:'高'}],
  959. ['Tooltip-Low', {CN:'低:', EN:'L:', TC:'低'}],
  960. ['Tooltip-Close', {CN:'收:', EN:'C:', TC:'收'}],
  961. ['Tooltip-Increase', {CN:'幅:', EN:'I:', TC:'幅'}],
  962. ['Tooltip-Vol', {CN:'量:', EN:'V:', TC:'量'}],
  963. ['Tooltip-Amount', {CN:'额:', EN:'A:', TC:'額'}],
  964. ['Tooltip-AvPrice', {CN:'均:', EN:'AP:', TC:'均'}],
  965. ['Tooltip-Price', {CN:'价:', EN:'P:', TC:'價'}],
  966. ['Tooltip-Exchange', {CN:'换:', EN:'E:', TC:'換'}],
  967. ['Tooltip-Position',{CN:'持:', EN:'P:', TC:'持'}],
  968. //K线动态标题
  969. ['KTitle-Open', {CN:'开:', EN:'O:', TC:'開'}],
  970. ['KTitle-High', {CN:'高:', EN:'H:', TC:'高'}],
  971. ['KTitle-Low', {CN:'低:', EN:'L:', TC:'低'}],
  972. ['KTitle-Close', {CN:'收:', EN:'C:', TC:'收'}],
  973. ['KTitle-Increase', {CN:'幅:', EN:'I:', TC:'幅'}],
  974. ['KTitle-Vol', {CN:'量:', EN:'V:', TC:'量'}],
  975. ['KTitle-Amount', {CN:'额:', EN:'A:', TC:'額'}],
  976. ['KTitle-Exchange', {CN:'换:', EN:'E:', TC:'換'}],
  977. ['KTitle-Position', {CN:'持:', EN:'P:', TC:'持'}],
  978. ['KTitle-Price', {CN:'价:', EN:'Price:', TC:'價'}],
  979. //走势图动态标题
  980. ['MTitle-Close', {CN:'价:', EN:'C:', TC:'價'}],
  981. ['MTitle-AvPrice', {CN:'均:', EN:'AC:', TC:'均'}],
  982. ['MTitle-Increase', {CN:'幅:', EN:'I:', TC:'幅'}],
  983. ['MTitle-Vol', {CN:'量:', EN:'V:', TC:'量'}],
  984. ['MTitle-Amount', {CN:'额:', EN:'A:', TC:'額'}],
  985. ['MTitle-Position', {CN:'持:', EN:'P:', TC:'持'}],
  986. //周期
  987. ['日线', {CN:'日线', EN:'1D', TC:'日綫'}],
  988. ['周线', {CN:'周线', EN:'1W', TC:'周綫'}],
  989. ['双周', {CN:'双周', EN:"2W", TC:'雙周'}],
  990. ['月线', {CN:'月线', EN:'1M', TC:'月綫'}],
  991. ["半年", {CN:'半年', EN:'HY', TC:'半年'}],
  992. ['年线', {CN:'年线', EN:'1Y', TC:'年綫'}],
  993. ['1分', {CN:'1分', EN:'1Min', TC:'1分'}],
  994. ['5分', {CN:'5分', EN:'5Min', TC:'5分'}],
  995. ['15分', {CN:'15分', EN:'15Min', TC:'15分'}],
  996. ['30分', {CN:'30分', EN:'30Min', TC:'30分'}],
  997. ['60分', {CN:'60分', EN:'60Min', TC:'60分'}],
  998. ['季线', {CN:'季线', EN:'1Q', TC:'季綫'}],
  999. ['分笔', {CN:'分笔', EN:'Tick', TC:'分筆'}],
  1000. ['2小时', {CN:'2小时', EN:'2H', TC:'2小時'}],
  1001. ['4小时', {CN:'4小时', EN:'4H', TC:'4小時'}],
  1002. //复权
  1003. ['不复权', {CN:'不复权', EN:'No Right', TC:'不復權'}],
  1004. ['前复权', {CN:'前复权', EN:'Pro Right', TC:'前復權'}],
  1005. ['后复权', {CN:'后复权', EN:'Post Right', TC:'后復權'}],
  1006. //week
  1007. ['日', {CN:'日', EN:'Sun.', TC:'日'}],
  1008. ['一', {CN:'一', EN:'Mon.', TC:'壹'}],
  1009. ['二', {CN:'二', EN:'Tues.', TC:'貳'}],
  1010. ['三', {CN:'三', EN:'Wed.', TC:'叁'}],
  1011. ['四', {CN:'四', EN:'Thur.', TC:'肆'}],
  1012. ['五', {CN:'五', EN:'Fri.', TC:'伍'}],
  1013. ['六', {CN:'六', EN:'Sat.', TC:'陸'}],
  1014. ['1月', {CN:'1月', EN:'Jan', TC:'1月'}],
  1015. ['2月', {CN:'2月', EN:'Feb', TC:'2月'}],
  1016. ['3月', {CN:'3月', EN:'Mar', TC:'3月'}],
  1017. ['4月', {CN:'4月', EN:'Apr', TC:'4月'}],
  1018. ['5月', {CN:'5月', EN:'May', TC:'5月'}],
  1019. ['6月', {CN:'6月', EN:'Jun', TC:'6月'}],
  1020. ['7月', {CN:'7月', EN:'Jul', TC:'7月'}],
  1021. ['8月', {CN:'8月', EN:'Aug', TC:'8月'}],
  1022. ['9月', {CN:'9月', EN:'Sept', TC:'9月'}],
  1023. ['10月', {CN:'10月', EN:'Oct', TC:'10月'}],
  1024. ['11月', {CN:'11月', EN:'Nov', TC:'11月'}],
  1025. ['12月', {CN:'12月', EN:'Dec', TC:'12月'}],
  1026. ['自定义分钟', {CN:'分', EN:'Min', TC:'分'}],
  1027. ['自定义日线', {CN:'日', EN:'D', TC:'日'}],
  1028. ['自定义秒', {CN:'秒', EN:'S', TC:'秒'}],
  1029. //深度图
  1030. ["Depth-Price", {CN:"委托价", EN:"Price", TC:'委托價'}],
  1031. ["Depth-Sum", {CN:"累计", EN:"Sum", TC:'累計'}],
  1032. //日盘|夜盘
  1033. ["日盘",{CN:'日盘', EN:'Day', TC:'日盤'}],
  1034. ["夜盘",{CN:'夜盘', EN:'Night', TC:'夜盤'} ]
  1035. ]);
  1036. this.GetText = function (key, language)
  1037. {
  1038. var item = this.TextResource.get(key);
  1039. if (!item) return '';
  1040. switch (language)
  1041. {
  1042. case JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID:
  1043. return item.CN;
  1044. case JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID:
  1045. return item.EN;
  1046. case JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID:
  1047. return item.TC;
  1048. default:
  1049. return item.CN;
  1050. }
  1051. }
  1052. this.SetTextResource = function (key, value)
  1053. {
  1054. this.TextResource.set(key, value)
  1055. }
  1056. this.GetLanguageID=function(languageName)
  1057. {
  1058. var languageID=null;
  1059. switch(languageName)
  1060. {
  1061. case 'EN':
  1062. languageID=JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID;
  1063. break;
  1064. case 'CN':
  1065. languageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
  1066. break;
  1067. case "TC":
  1068. languageID=JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID;
  1069. break;
  1070. default:
  1071. break;
  1072. }
  1073. return languageID;
  1074. }
  1075. };
  1076. var g_JSChartLocalization = new JSChartLocalization();
  1077. //导出统一使用JSCommon命名空间名
  1078. export
  1079. {
  1080. JSChartResource,
  1081. g_JSChartResource,
  1082. g_JSChartLocalization,
  1083. JSCHART_LANGUAGE_ID,
  1084. };
  1085. /*
  1086. module.exports =
  1087. {
  1088. JSCommonResource:
  1089. {
  1090. JSChartResource: JSChartResource,
  1091. Global_JSChartResource: g_JSChartResource,
  1092. Global_JSChartLocalization: g_JSChartLocalization,
  1093. JSCHART_LANGUAGE_ID: JSCHART_LANGUAGE_ID,
  1094. },
  1095. //单个类导出
  1096. JSCommonResource_JSChartResource: JSChartResource,
  1097. JSCommonResource_Global_JSChartResource: g_JSChartResource,
  1098. JSCommonResource_Global_JSChartLocalization: g_JSChartLocalization,
  1099. JSCommonResource_JSCHART_LANGUAGE_ID: JSCHART_LANGUAGE_ID
  1100. };
  1101. */