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.

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