市长热线演示版

highcharts-3d.src.js 33KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249
  1. // ==ClosureCompiler==
  2. // @compilation_level SIMPLE_OPTIMIZATIONS
  3. /**
  4. * @license Highcharts JS v4.0.1 (2014-04-24)
  5. *
  6. * (c) 2009-2013 Torstein Hønsi
  7. *
  8. * License: www.highcharts.com/license
  9. */
  10. // JSLint options:
  11. /*global Highcharts, HighchartsAdapter, document, window, navigator, setInterval, clearInterval, clearTimeout, setTimeout, location, jQuery, $, console */
  12. (function (Highcharts) {
  13. /**
  14. Shorthands for often used function
  15. */
  16. /**
  17. * Mathematical Functionility
  18. */
  19. var PI = Math.PI,
  20. deg2rad = (PI / 180), // degrees to radians
  21. sin = Math.sin,
  22. cos = Math.cos,
  23. round = Math.round;
  24. function perspective(points, angle2, angle1, origin) {
  25. angle1 *= deg2rad;
  26. angle2 *= deg2rad;
  27. var result = [],
  28. xe,
  29. ye,
  30. ze;
  31. angle1 *= -1;
  32. xe = origin.x;
  33. ye = origin.y;
  34. ze = (origin.z === 0 ? 0.0001 : origin.z) * (origin.vd || 25);
  35. // some kind of minimum?
  36. var s1 = sin(angle1),
  37. c1 = cos(angle1),
  38. s2 = sin(angle2),
  39. c2 = cos(angle2);
  40. var x, y, z, p;
  41. Highcharts.each(points, function (point) {
  42. x = point.x - xe;
  43. y = point.y - ye;
  44. z = point.z || 0;
  45. p = {
  46. x: c1 * x - s1 * z,
  47. y: -s1 * s2 * x - c1 * s2 * z + c2 * y,
  48. z: s1 * c2 * x + c1 * c2 * z + s2 * y
  49. };
  50. p.x = p.x * ((ze - p.z) / ze) + xe;
  51. p.y = p.y * ((ze - p.z) / ze) + ye;
  52. result.push({x: round(p.x), y: round(p.y), z: round(p.z)});
  53. });
  54. return result;
  55. }
  56. /***
  57. EXTENSION TO THE SVG-RENDERER TO ENABLE 3D SHAPES
  58. ***/
  59. ////// HELPER METHODS //////
  60. var dFactor = (4 * (Math.sqrt(2) - 1) / 3) / (PI / 2);
  61. function curveTo(cx, cy, rx, ry, start, end, dx, dy) {
  62. var result = [];
  63. if ((end > start) && (end - start > PI / 2 + 0.0001)) {
  64. result = result.concat(curveTo(cx, cy, rx, ry, start, start + (PI / 2), dx, dy));
  65. result = result.concat(curveTo(cx, cy, rx, ry, start + (PI / 2), end, dx, dy));
  66. return result;
  67. } else if ((end < start) && (start - end > PI / 2 + 0.0001)) {
  68. result = result.concat(curveTo(cx, cy, rx, ry, start, start - (PI / 2), dx, dy));
  69. result = result.concat(curveTo(cx, cy, rx, ry, start - (PI / 2), end, dx, dy));
  70. return result;
  71. } else {
  72. var arcAngle = end - start;
  73. return [
  74. 'C',
  75. cx + (rx * cos(start)) - ((rx * dFactor * arcAngle) * sin(start)) + dx,
  76. cy + (ry * sin(start)) + ((ry * dFactor * arcAngle) * cos(start)) + dy,
  77. cx + (rx * cos(end)) + ((rx * dFactor * arcAngle) * sin(end)) + dx,
  78. cy + (ry * sin(end)) - ((ry * dFactor * arcAngle) * cos(end)) + dy,
  79. cx + (rx * cos(end)) + dx,
  80. cy + (ry * sin(end)) + dy
  81. ];
  82. }
  83. }
  84. Highcharts.SVGRenderer.prototype.toLinePath = function (points, closed) {
  85. var result = [];
  86. // Put "L x y" for each point
  87. Highcharts.each(points, function (point) {
  88. result.push('L', point.x, point.y);
  89. });
  90. // Set the first element to M
  91. result[0] = 'M';
  92. // If it is a closed line, add Z
  93. if (closed) {
  94. result.push('Z');
  95. }
  96. return result;
  97. };
  98. ////// CUBOIDS //////
  99. Highcharts.SVGRenderer.prototype.cuboid = function (shapeArgs) {
  100. var result = this.g(),
  101. paths = this.cuboidPath(shapeArgs);
  102. result.front = this.path(paths[0]).attr({zIndex: paths[3], 'stroke-linejoin': 'round'}).add(result);
  103. result.top = this.path(paths[1]).attr({zIndex: paths[4], 'stroke-linejoin': 'round'}).add(result);
  104. result.side = this.path(paths[2]).attr({zIndex: paths[5], 'stroke-linejoin': 'round'}).add(result);
  105. result.fillSetter = function (color) {
  106. var c0 = color,
  107. c1 = Highcharts.Color(color).brighten(0.1).get(),
  108. c2 = Highcharts.Color(color).brighten(-0.1).get();
  109. this.front.attr({fill: c0});
  110. this.top.attr({fill: c1});
  111. this.side.attr({fill: c2});
  112. this.color = color;
  113. return this;
  114. };
  115. result.opacitySetter = function (opacity) {
  116. this.front.attr({opacity: opacity});
  117. this.top.attr({opacity: opacity});
  118. this.side.attr({opacity: opacity});
  119. return this;
  120. };
  121. result.attr = function (args) {
  122. if (args.shapeArgs || args.x) {
  123. var shapeArgs = args.shapeArgs || args;
  124. var paths = this.renderer.cuboidPath(shapeArgs);
  125. this.front.attr({d: paths[0], zIndex: paths[3]});
  126. this.top.attr({d: paths[1], zIndex: paths[4]});
  127. this.side.attr({d: paths[2], zIndex: paths[5]});
  128. } else {
  129. Highcharts.SVGElement.prototype.attr.call(this, args);
  130. }
  131. return this;
  132. };
  133. result.animate = function (args, duration, complete) {
  134. if (args.x && args.y) {
  135. var paths = this.renderer.cuboidPath(args);
  136. this.front.attr({zIndex: paths[3]}).animate({d: paths[0]}, duration, complete);
  137. this.top.attr({zIndex: paths[4]}).animate({d: paths[1]}, duration, complete);
  138. this.side.attr({zIndex: paths[5]}).animate({d: paths[2]}, duration, complete);
  139. } else if (args.opacity) {
  140. this.front.animate(args, duration, complete);
  141. this.top.animate(args, duration, complete);
  142. this.side.animate(args, duration, complete);
  143. } else {
  144. Highcharts.SVGElement.prototype.animate.call(this, args, duration, complete);
  145. }
  146. return this;
  147. };
  148. result.destroy = function () {
  149. this.front.destroy();
  150. this.top.destroy();
  151. this.side.destroy();
  152. return null;
  153. };
  154. // Apply the Z index to the cuboid group
  155. result.attr({ zIndex: -paths[3] });
  156. return result;
  157. };
  158. Highcharts.SVGRenderer.prototype.cuboidPath = function (shapeArgs) {
  159. var x = shapeArgs.x,
  160. y = shapeArgs.y,
  161. z = shapeArgs.z,
  162. h = shapeArgs.height,
  163. w = shapeArgs.width,
  164. d = shapeArgs.depth,
  165. alpha = shapeArgs.alpha,
  166. beta = shapeArgs.beta,
  167. origin = shapeArgs.origin;
  168. var pArr = [
  169. {x: x, y: y, z: z},
  170. {x: x + w, y: y, z: z},
  171. {x: x + w, y: y + h, z: z},
  172. {x: x, y: y + h, z: z},
  173. {x: x, y: y + h, z: z + d},
  174. {x: x + w, y: y + h, z: z + d},
  175. {x: x + w, y: y, z: z + d},
  176. {x: x, y: y, z: z + d}
  177. ];
  178. pArr = perspective(pArr, alpha, beta, origin);
  179. var path1, // FRONT
  180. path2, // TOP OR BOTTOM
  181. path3; // LEFT OR RIGHT
  182. // front
  183. path1 = [
  184. 'M', pArr[0].x, pArr[0].y,
  185. 'L', pArr[1].x, pArr[1].y,
  186. 'L', pArr[2].x, pArr[2].y,
  187. 'L', pArr[3].x, pArr[3].y,
  188. 'Z'
  189. ];
  190. var z1 = (pArr[0].z + pArr[1].z + pArr[2].z + pArr[3].z) / 4;
  191. // top or bottom
  192. var top = [
  193. 'M', pArr[0].x, pArr[0].y,
  194. 'L', pArr[7].x, pArr[7].y,
  195. 'L', pArr[6].x, pArr[6].y,
  196. 'L', pArr[1].x, pArr[1].y,
  197. 'Z'
  198. ];
  199. var bottom = [
  200. 'M', pArr[3].x, pArr[3].y,
  201. 'L', pArr[2].x, pArr[2].y,
  202. 'L', pArr[5].x, pArr[5].y,
  203. 'L', pArr[4].x, pArr[4].y,
  204. 'Z'
  205. ];
  206. if (pArr[7].y < pArr[1].y) {
  207. path2 = top;
  208. } else if (pArr[4].y > pArr[2].y) {
  209. path2 = bottom;
  210. } else {
  211. path2 = [];
  212. }
  213. var z2 = (beta > 0 ? (pArr[0].z + pArr[7].z + pArr[6].z + pArr[1].z) / 4 : (pArr[3].z + pArr[2].z + pArr[5].z + pArr[4].z) / 4);
  214. // side
  215. var right = [
  216. 'M', pArr[1].x, pArr[1].y,
  217. 'L', pArr[2].x, pArr[2].y,
  218. 'L', pArr[5].x, pArr[5].y,
  219. 'L', pArr[6].x, pArr[6].y,
  220. 'Z'
  221. ];
  222. var left = [
  223. 'M', pArr[0].x, pArr[0].y,
  224. 'L', pArr[7].x, pArr[7].y,
  225. 'L', pArr[4].x, pArr[4].y,
  226. 'L', pArr[3].x, pArr[3].y,
  227. 'Z'
  228. ];
  229. if (pArr[6].x > pArr[1].x) {
  230. path3 = right;
  231. } else if (pArr[7].x < pArr[0].x) {
  232. path3 = left;
  233. } else {
  234. path3 = [];
  235. }
  236. var z3 = (alpha > 0 ? (pArr[1].z + pArr[2].z + pArr[5].z + pArr[6].z) / 4 : (pArr[0].z + pArr[7].z + pArr[4].z + pArr[3].z) / 4);
  237. return [path1, path2, path3, z1, z2, z3];
  238. };
  239. ////// SECTORS //////
  240. Highcharts.SVGRenderer.prototype.arc3d = function (shapeArgs) {
  241. shapeArgs.alpha *= deg2rad;
  242. shapeArgs.beta *= deg2rad;
  243. var result = this.g(),
  244. paths = this.arc3dPath(shapeArgs),
  245. renderer = result.renderer;
  246. var zIndex = paths.zAll * 100;
  247. result.shapeArgs = shapeArgs; // Store for later use
  248. result.side1 = renderer.path(paths.side2).attr({zIndex: paths.zSide2}).add(result);
  249. result.side2 = renderer.path(paths.side1).attr({zIndex: paths.zSide1}).add(result);
  250. result.inn = renderer.path(paths.inn).attr({zIndex: paths.zInn}).add(result);
  251. result.out = renderer.path(paths.out).attr({zIndex: paths.zOut}).add(result);
  252. result.top = renderer.path(paths.top).attr({zIndex: paths.zTop}).add(result);
  253. result.fillSetter = function (color) {
  254. this.color = color;
  255. var c0 = color,
  256. c2 = Highcharts.Color(color).brighten(-0.1).get();
  257. this.side1.attr({fill: c2});
  258. this.side2.attr({fill: c2});
  259. this.inn.attr({fill: c2});
  260. this.out.attr({fill: c2});
  261. this.top.attr({fill: c0});
  262. return this;
  263. };
  264. result.animate = function (args, duration, complete) {
  265. Highcharts.SVGElement.prototype.animate.call(this, args, duration, complete);
  266. if (args.x && args.y) {
  267. // Recreate
  268. var result = this,
  269. renderer = this.renderer,
  270. shapeArgs = Highcharts.splat(args)[0];
  271. shapeArgs.alpha *= deg2rad;
  272. shapeArgs.beta *= deg2rad;
  273. var paths = renderer.arc3dPath(shapeArgs);
  274. result.shapeArgs = shapeArgs; // Store for later use
  275. result.inn.attr({d: paths.inn, zIndex: paths.zInn});
  276. result.out.attr({d: paths.out, zIndex: paths.zOut});
  277. result.side1.attr({d: paths.side1, zIndex: paths.zSide2});
  278. result.side2.attr({d: paths.side2, zIndex: paths.zSide1});
  279. result.top.attr({d: paths.top, zIndex: paths.zTop});
  280. result.attr({fill: result.color});
  281. result.attr({zIndex: paths.zAll * 100});
  282. }
  283. return this;
  284. };
  285. result.zIndex = zIndex;
  286. result.attr({zIndex: zIndex});
  287. return result;
  288. };
  289. Highcharts.SVGRenderer.prototype.arc3dPath = function (shapeArgs) {
  290. var cx = shapeArgs.x,
  291. cy = shapeArgs.y,
  292. start = shapeArgs.start,
  293. end = shapeArgs.end - 0.00001,
  294. r = shapeArgs.r,
  295. ir = shapeArgs.innerR,
  296. d = shapeArgs.depth,
  297. alpha = shapeArgs.alpha,
  298. beta = shapeArgs.beta;
  299. // Some Variables
  300. var cs = cos(start),
  301. ss = sin(start),
  302. ce = cos(end),
  303. se = sin(end),
  304. rx = r * cos(beta),
  305. ry = r * cos(alpha),
  306. irx = ir * cos(beta),
  307. iry = ir * cos(alpha),
  308. dx = d * sin(beta),
  309. dy = d * sin(alpha);
  310. // TOP
  311. var top = ['M', cx + (rx * cs), cy + (ry * ss)];
  312. top = top.concat(curveTo(cx, cy, rx, ry, start, end, 0, 0));
  313. top = top.concat([
  314. 'L', cx + (irx * ce), cy + (iry * se)
  315. ]);
  316. top = top.concat(curveTo(cx, cy, irx, iry, end, start, 0, 0));
  317. top = top.concat(['Z']);
  318. var midAngle = ((shapeArgs.start + shapeArgs.end) / 2);
  319. var zIndex = ((sin(beta) * cos(midAngle)) + (sin(-alpha) * sin(-midAngle)));
  320. // OUTSIDE
  321. var b = (beta > 0 ? PI / 2 : 0),
  322. a = (alpha > 0 ? 0 : PI / 2);
  323. var start2 = start > -b ? start : (end > -b ? -b : start),
  324. end2 = end < PI - a ? end : (start < PI - a ? PI - a : end);
  325. var out = ['M', cx + (rx * cos(start2)), cy + (ry * sin(start2))];
  326. out = out.concat(curveTo(cx, cy, rx, ry, start2, end2, 0, 0));
  327. out = out.concat([
  328. 'L', cx + (rx * cos(end2)) + dx, cy + (ry * sin(end2)) + dy
  329. ]);
  330. out = out.concat(curveTo(cx, cy, rx, ry, end2, start2, dx, dy));
  331. out = out.concat(['Z']);
  332. // INSIDE
  333. var inn = ['M', cx + (irx * cs), cy + (iry * ss)];
  334. inn = inn.concat(curveTo(cx, cy, irx, iry, start, end, 0, 0));
  335. inn = inn.concat([
  336. 'L', cx + (irx * cos(end)) + dx, cy + (iry * sin(end)) + dy
  337. ]);
  338. inn = inn.concat(curveTo(cx, cy, irx, iry, end, start, dx, dy));
  339. inn = inn.concat(['Z']);
  340. // SIDES
  341. var side1 = [
  342. 'M', cx + (rx * cs), cy + (ry * ss),
  343. 'L', cx + (rx * cs) + dx, cy + (ry * ss) + dy,
  344. 'L', cx + (irx * cs) + dx, cy + (iry * ss) + dy,
  345. 'L', cx + (irx * cs), cy + (iry * ss),
  346. 'Z'
  347. ];
  348. var side2 = [
  349. 'M', cx + (rx * ce), cy + (ry * se),
  350. 'L', cx + (rx * ce) + dx, cy + (ry * se) + dy,
  351. 'L', cx + (irx * ce) + dx, cy + (iry * se) + dy,
  352. 'L', cx + (irx * ce), cy + (iry * se),
  353. 'Z'
  354. ];
  355. var mr = ir + ((r - ir) / 2);
  356. var zTop = Math.abs(zIndex * 2 * mr),
  357. zOut = zIndex * r,
  358. zInn = zIndex * ir,
  359. zSide1 = ((sin(beta) * cos(start)) + (sin(-alpha) * sin(-start))) * mr,
  360. zSide2 = ((sin(beta) * cos(end)) + (sin(-alpha) * sin(-end))) * mr;
  361. return {
  362. top: top,
  363. zTop: zTop * 100,
  364. out: out,
  365. zOut: zOut * 100,
  366. inn: inn,
  367. zInn: zInn * 100,
  368. side1: side1,
  369. zSide1: zSide1 * 100,
  370. side2: side2,
  371. zSide2: zSide2 * 100,
  372. zAll: zIndex
  373. };
  374. };
  375. /***
  376. EXTENSION FOR 3D CHARTS
  377. ***/
  378. // Shorthand to check the is3d flag
  379. Highcharts.Chart.prototype.is3d = function () {
  380. return this.options.chart.options3d && this.options.chart.options3d.enabled;
  381. };
  382. Highcharts.wrap(Highcharts.Chart.prototype, 'isInsidePlot', function (proceed) {
  383. if (this.is3d()) {
  384. return true;
  385. } else {
  386. return proceed.apply(this, [].slice.call(arguments, 1));
  387. }
  388. });
  389. Highcharts.wrap(Highcharts.Chart.prototype, 'init', function (proceed) {
  390. var args = arguments;
  391. args[1] = Highcharts.merge({
  392. chart: {
  393. options3d: {
  394. enabled: false,
  395. alpha: 0,
  396. beta: 0,
  397. depth: 100,
  398. viewDistance: 25,
  399. frame: {
  400. bottom: { size: 1, color: 'rgba(255,255,255,0)' },
  401. side: { size: 1, color: 'rgba(255,255,255,0)' },
  402. back: { size: 1, color: 'rgba(255,255,255,0)' }
  403. }
  404. }
  405. }
  406. }, args[1]);
  407. proceed.apply(this, [].slice.call(args, 1));
  408. });
  409. Highcharts.wrap(Highcharts.Chart.prototype, 'setChartSize', function (proceed) {
  410. proceed.apply(this, [].slice.call(arguments, 1));
  411. if (this.is3d()) {
  412. var inverted = this.inverted,
  413. clipBox = this.clipBox,
  414. margin = this.margin,
  415. x = inverted ? 'y' : 'x',
  416. y = inverted ? 'x' : 'y',
  417. w = inverted ? 'height' : 'width',
  418. h = inverted ? 'width' : 'height';
  419. clipBox[x] = -(margin[3] || 0);
  420. clipBox[y] = -(margin[0] || 0);
  421. clipBox[w] = this.chartWidth + (margin[3] || 0) + (margin[1] || 0);
  422. clipBox[h] = this.chartHeight + (margin[0] || 0) + (margin[2] || 0);
  423. }
  424. });
  425. Highcharts.wrap(Highcharts.Chart.prototype, 'redraw', function (proceed) {
  426. if (this.is3d()) {
  427. // Set to force a redraw of all elements
  428. this.isDirtyBox = true;
  429. }
  430. proceed.apply(this, [].slice.call(arguments, 1));
  431. });
  432. Highcharts.Chart.prototype.retrieveStacks = function () {
  433. var stacks = {},
  434. type = this.options.chart.type,
  435. typeOptions = this.options.plotOptions[type],
  436. stacking = typeOptions.stacking,
  437. grouping = typeOptions.grouping,
  438. i = 1;
  439. if (grouping || !stacking) { return this.series; }
  440. Highcharts.each(this.series, function (S) {
  441. if (!stacks[S.options.stack || 0]) {
  442. stacks[S.options.stack || 0] = { series: [S], position: i};
  443. i++;
  444. } else {
  445. stacks[S.options.stack || 0].series.push(S);
  446. }
  447. });
  448. stacks.totalStacks = i + 1;
  449. return stacks;
  450. };
  451. /***
  452. EXTENSION TO THE AXIS
  453. ***/
  454. Highcharts.wrap(Highcharts.Axis.prototype, 'init', function (proceed) {
  455. var args = arguments;
  456. if (args[1].is3d()) {
  457. args[2].tickWidth = Highcharts.pick(args[2].tickWidth, 0);
  458. args[2].gridLineWidth = Highcharts.pick(args[2].gridLineWidth, 1);
  459. }
  460. proceed.apply(this, [].slice.call(arguments, 1));
  461. });
  462. Highcharts.wrap(Highcharts.Axis.prototype, 'render', function (proceed) {
  463. proceed.apply(this, [].slice.call(arguments, 1));
  464. // Do not do this if the chart is not 3D
  465. if (!this.chart.is3d()) {
  466. return;
  467. }
  468. var chart = this.chart,
  469. renderer = chart.renderer,
  470. options3d = chart.options.chart.options3d,
  471. alpha = options3d.alpha,
  472. beta = options3d.beta * (chart.yAxis[0].opposite ? -1 : 1),
  473. frame = options3d.frame,
  474. fbottom = frame.bottom,
  475. fback = frame.back,
  476. fside = frame.side,
  477. depth = options3d.depth,
  478. height = this.height,
  479. width = this.width,
  480. left = this.left,
  481. top = this.top;
  482. var origin = {
  483. x: chart.plotLeft + (chart.plotWidth / 2),
  484. y: chart.plotTop + (chart.plotHeight / 2),
  485. z: depth,
  486. vd: options3d.viewDistance
  487. };
  488. if (this.horiz) {
  489. /// BOTTOM
  490. if (this.axisLine) {
  491. this.axisLine.hide();
  492. }
  493. var bottomShape = {
  494. x: left,
  495. y: top + (chart.yAxis[0].reversed ? -fbottom.size : height),
  496. z: 0,
  497. width: width,
  498. height: fbottom.size,
  499. depth: depth,
  500. alpha: alpha,
  501. beta: beta,
  502. origin: origin
  503. };
  504. if (!this.bottomFrame) {
  505. this.bottomFrame = renderer.cuboid(bottomShape).attr({fill: fbottom.color, zIndex: (chart.yAxis[0].reversed && alpha > 0 ? 4 : -1)}).css({stroke: fbottom.color}).add();
  506. } else {
  507. this.bottomFrame.animate(bottomShape);
  508. }
  509. } else {
  510. // BACK
  511. var backShape = {
  512. x: left,
  513. y: top,
  514. z: depth + 1,
  515. width: width,
  516. height: height + fbottom.size,
  517. depth: fback.size,
  518. alpha: alpha,
  519. beta: beta,
  520. origin: origin
  521. };
  522. if (!this.backFrame) {
  523. this.backFrame = renderer.cuboid(backShape).attr({fill: fback.color, zIndex: -3}).css({stroke: fback.color}).add();
  524. } else {
  525. this.backFrame.animate(backShape);
  526. }
  527. // SIDE
  528. if (this.axisLine) {
  529. this.axisLine.hide();
  530. }
  531. var sideShape = {
  532. x: (chart.yAxis[0].opposite ? width : 0) + left - fside.size,
  533. y: top,
  534. z: 0,
  535. width: fside.size,
  536. height: height + fbottom.size,
  537. depth: depth + fback.size,
  538. alpha: alpha,
  539. beta: beta,
  540. origin: origin
  541. };
  542. if (!this.sideFrame) {
  543. this.sideFrame = renderer.cuboid(sideShape).attr({fill: fside.color, zIndex: -2}).css({stroke: fside.color}).add();
  544. } else {
  545. this.sideFrame.animate(sideShape);
  546. }
  547. }
  548. });
  549. Highcharts.wrap(Highcharts.Axis.prototype, 'getPlotLinePath', function (proceed) {
  550. var path = proceed.apply(this, [].slice.call(arguments, 1));
  551. // Do not do this if the chart is not 3D
  552. if (!this.chart.is3d()) {
  553. return path;
  554. }
  555. if (path === null) { return path; }
  556. var chart = this.chart,
  557. options3d = chart.options.chart.options3d;
  558. var d = options3d.depth;
  559. options3d.origin = {
  560. x: chart.plotLeft + (chart.plotWidth / 2),
  561. y: chart.plotTop + (chart.plotHeight / 2),
  562. z: d,
  563. vd: options3d.viewDistance
  564. };
  565. var pArr = [
  566. { x: path[1], y: path[2], z : (this.horiz || this.opposite ? d : 0)},
  567. { x: path[1], y: path[2], z : d },
  568. { x: path[4], y: path[5], z : d },
  569. { x: path[4], y: path[5], z : (this.horiz || this.opposite ? 0 : d)}
  570. ];
  571. var alpha = chart.options.inverted ? options3d.beta : options3d.alpha,
  572. beta = chart.options.inverted ? options3d.alpha : options3d.beta;
  573. beta *= (chart.yAxis[0].opposite ? -1 : 1);
  574. pArr = perspective(pArr, alpha, beta, options3d.origin);
  575. path = this.chart.renderer.toLinePath(pArr, false);
  576. return path;
  577. });
  578. /***
  579. EXTENSION TO THE TICKS
  580. ***/
  581. Highcharts.wrap(Highcharts.Tick.prototype, 'getMarkPath', function (proceed) {
  582. var path = proceed.apply(this, [].slice.call(arguments, 1));
  583. // Do not do this if the chart is not 3D
  584. if (!this.axis.chart.is3d()) {
  585. return path;
  586. }
  587. var chart = this.axis.chart,
  588. options3d = chart.options.chart.options3d;
  589. var origin = {
  590. x: chart.plotLeft + (chart.plotWidth / 2),
  591. y: chart.plotTop + (chart.plotHeight / 2),
  592. z: options3d.depth,
  593. vd: options3d.viewDistance
  594. };
  595. var pArr = [
  596. {x: path[1], y: path[2], z: 0},
  597. {x: path[4], y: path[5], z: 0}
  598. ];
  599. var alpha = chart.inverted ? options3d.beta : options3d.alpha,
  600. beta = chart.inverted ? options3d.alpha : options3d.beta;
  601. beta *= (chart.yAxis[0].opposite ? -1 : 1);
  602. pArr = perspective(pArr, alpha, beta, origin);
  603. path = [
  604. 'M', pArr[0].x, pArr[0].y,
  605. 'L', pArr[1].x, pArr[1].y
  606. ];
  607. return path;
  608. });
  609. Highcharts.wrap(Highcharts.Tick.prototype, 'getLabelPosition', function (proceed) {
  610. var pos = proceed.apply(this, [].slice.call(arguments, 1));
  611. // Do not do this if the chart is not 3D
  612. if (!this.axis.chart.is3d()) {
  613. return pos;
  614. }
  615. var chart = this.axis.chart,
  616. options3d = chart.options.chart.options3d;
  617. var origin = {
  618. x: chart.plotLeft + (chart.plotWidth / 2),
  619. y: chart.plotTop + (chart.plotHeight / 2),
  620. z: options3d.depth,
  621. vd: options3d.viewDistance
  622. };
  623. var alpha = chart.inverted ? options3d.beta : options3d.alpha,
  624. beta = chart.inverted ? options3d.alpha : options3d.beta;
  625. beta *= (chart.yAxis[0].opposite ? -1 : 1);
  626. pos = perspective([{x: pos.x, y: pos.y, z: 0}], alpha, beta, origin)[0];
  627. return pos;
  628. });
  629. Highcharts.wrap(Highcharts.Axis.prototype, 'drawCrosshair', function (proceed) {
  630. var args = arguments;
  631. if (this.chart.is3d()) {
  632. if (args[2]) {
  633. args[2] = {
  634. plotX: args[2].plotXold || args[2].plotX,
  635. plotY: args[2].plotYold || args[2].plotY
  636. };
  637. }
  638. }
  639. proceed.apply(this, [].slice.call(args, 1));
  640. });/***
  641. EXTENSION FOR 3D COLUMNS
  642. ***/
  643. Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'translate', function (proceed) {
  644. proceed.apply(this, [].slice.call(arguments, 1));
  645. // Do not do this if the chart is not 3D
  646. if (!this.chart.is3d()) {
  647. return;
  648. }
  649. var type = this.chart.options.chart.type,
  650. series = this,
  651. chart = series.chart,
  652. options = chart.options,
  653. typeOptions = options.plotOptions[type],
  654. options3d = options.chart.options3d,
  655. depth = typeOptions.depth || 25,
  656. origin = {
  657. x: chart.plotWidth / 2,
  658. y: chart.plotHeight / 2,
  659. z: options3d.depth,
  660. vd: options3d.viewDistance
  661. },
  662. alpha = options3d.alpha,
  663. beta = options3d.beta * (chart.yAxis[0].opposite ? -1 : 1);
  664. var stack = typeOptions.stacking ? (this.options.stack || 0) : series._i;
  665. var z = stack * (depth + (typeOptions.groupZPadding || 1));
  666. if (typeOptions.grouping !== false) { z = 0; }
  667. z += (typeOptions.groupZPadding || 1);
  668. Highcharts.each(series.data, function (point) {
  669. var shapeArgs = point.shapeArgs,
  670. tooltipPos = point.tooltipPos;
  671. point.shapeType = 'cuboid';
  672. shapeArgs.alpha = alpha;
  673. shapeArgs.beta = beta;
  674. shapeArgs.z = z;
  675. shapeArgs.origin = origin;
  676. shapeArgs.depth = depth;
  677. // Translate the tooltip position in 3d space
  678. tooltipPos = perspective([{ x: tooltipPos[0], y: tooltipPos[1], z: z }], alpha, beta, origin)[0];
  679. point.tooltipPos = [tooltipPos.x, tooltipPos.y];
  680. });
  681. });
  682. Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'animate', function (proceed) {
  683. if (!this.chart.is3d()) {
  684. proceed.apply(this, [].slice.call(arguments, 1));
  685. } else {
  686. var args = arguments,
  687. init = args[1],
  688. yAxis = this.yAxis,
  689. series = this,
  690. reversed = this.yAxis.reversed;
  691. if (Highcharts.svg) { // VML is too slow anyway
  692. if (init) {
  693. Highcharts.each(series.data, function (point) {
  694. point.height = point.shapeArgs.height;
  695. point.shapeArgs.height = 1;
  696. if (!reversed) {
  697. if (point.stackY) {
  698. point.shapeArgs.y = point.plotY + yAxis.translate(point.stackY);
  699. } else {
  700. point.shapeArgs.y = point.plotY + (point.negative ? -point.height : point.height);
  701. }
  702. }
  703. });
  704. } else { // run the animation
  705. Highcharts.each(series.data, function (point) {
  706. point.shapeArgs.height = point.height;
  707. if (!reversed) {
  708. point.shapeArgs.y = point.plotY - (point.negative ? point.height : 0);
  709. }
  710. // null value do not have a graphic
  711. if (point.graphic) {
  712. point.graphic.animate(point.shapeArgs, series.options.animation);
  713. }
  714. });
  715. // delete this function to allow it only once
  716. series.animate = null;
  717. }
  718. }
  719. }
  720. });
  721. Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'init', function (proceed) {
  722. proceed.apply(this, [].slice.call(arguments, 1));
  723. if (this.chart.is3d()) {
  724. var grouping = this.chart.options.plotOptions.column.grouping,
  725. stacking = this.chart.options.plotOptions.column.stacking,
  726. z = this.options.zIndex;
  727. if (!z) {
  728. if (!(grouping !== undefined && !grouping) && stacking) {
  729. var stacks = this.chart.retrieveStacks(),
  730. stack = this.options.stack || 0,
  731. i; // position within the stack
  732. for (i = 0; i < stacks[stack].series.length; i++) {
  733. if (stacks[stack].series[i] === this) {
  734. break;
  735. }
  736. }
  737. z = (stacks.totalStacks * 10) - (10 * (stacks.totalStacks - stacks[stack].position)) - i;
  738. this.options.zIndex = z;
  739. }
  740. }
  741. }
  742. });
  743. function draw3DPoints(proceed) {
  744. // Do not do this if the chart is not 3D
  745. if (this.chart.is3d()) {
  746. var grouping = this.chart.options.plotOptions.column.grouping;
  747. if (grouping !== undefined && !grouping && this.group.zIndex !== undefined) {
  748. this.group.attr({zIndex : (this.group.zIndex * 10)});
  749. }
  750. if (this.userOptions.borderColor === undefined) {
  751. this.options.borderColor = this.color;
  752. }
  753. // Set the border color to the fill color to provide a smooth edge
  754. Highcharts.each(this.data, function (point) {
  755. var c = point.options.borderColor || point.color || point.series.userOptions.borderColor;
  756. point.options.borderColor = c;
  757. point.borderColor = c;
  758. point.pointAttr[''].stroke = c;
  759. // same bordercolor on hover and select
  760. point.pointAttr.hover.stroke = c;
  761. point.pointAttr.select.stroke = c;
  762. });
  763. }
  764. proceed.apply(this, [].slice.call(arguments, 1));
  765. }
  766. if (Highcharts.seriesTypes.columnrange) {
  767. Highcharts.wrap(Highcharts.seriesTypes.columnrange.prototype, 'drawPoints', draw3DPoints);
  768. }
  769. Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'drawPoints', draw3DPoints);
  770. /***
  771. EXTENSION FOR 3D CYLINDRICAL COLUMNS
  772. Not supported
  773. ***/
  774. var defaultOptions = Highcharts.getOptions();
  775. defaultOptions.plotOptions.cylinder = Highcharts.merge(defaultOptions.plotOptions.column);
  776. var CylinderSeries = Highcharts.extendClass(Highcharts.seriesTypes.column, {
  777. type: 'cylinder'
  778. });
  779. Highcharts.seriesTypes.cylinder = CylinderSeries;
  780. Highcharts.wrap(Highcharts.seriesTypes.cylinder.prototype, 'translate', function (proceed) {
  781. proceed.apply(this, [].slice.call(arguments, 1));
  782. // Do not do this if the chart is not 3D
  783. if (!this.chart.is3d()) {
  784. return;
  785. }
  786. var series = this,
  787. chart = series.chart,
  788. options = chart.options,
  789. cylOptions = options.plotOptions.cylinder,
  790. options3d = options.chart.options3d,
  791. depth = cylOptions.depth || 0,
  792. origin = {
  793. x: chart.inverted ? chart.plotHeight / 2 : chart.plotWidth / 2,
  794. y: chart.inverted ? chart.plotWidth / 2 : chart.plotHeight / 2,
  795. z: options3d.depth,
  796. vd: options3d.viewDistance
  797. },
  798. alpha = options3d.alpha;
  799. var z = cylOptions.stacking ? (this.options.stack || 0) * depth : series._i * depth;
  800. z += depth / 2;
  801. if (cylOptions.grouping !== false) { z = 0; }
  802. Highcharts.each(series.data, function (point) {
  803. var shapeArgs = point.shapeArgs;
  804. point.shapeType = 'arc3d';
  805. shapeArgs.x += depth / 2;
  806. shapeArgs.z = z;
  807. shapeArgs.start = 0;
  808. shapeArgs.end = 2 * PI;
  809. shapeArgs.r = depth * 0.95;
  810. shapeArgs.innerR = 0;
  811. shapeArgs.depth = shapeArgs.height * (1 / sin((90 - alpha) * deg2rad)) - z;
  812. shapeArgs.alpha = 90 - alpha;
  813. shapeArgs.beta = 0;
  814. shapeArgs.origin = origin;
  815. });
  816. });
  817. /***
  818. EXTENSION FOR 3D PIES
  819. ***/
  820. Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'translate', function (proceed) {
  821. proceed.apply(this, [].slice.call(arguments, 1));
  822. // Do not do this if the chart is not 3D
  823. if (!this.chart.is3d()) {
  824. return;
  825. }
  826. var series = this,
  827. chart = series.chart,
  828. options = chart.options,
  829. pieOptions = options.plotOptions.pie,
  830. depth = pieOptions.depth || 0,
  831. options3d = options.chart.options3d,
  832. origin = {
  833. x: chart.plotWidth / 2,
  834. y: chart.plotHeight / 2,
  835. z: options3d.depth
  836. },
  837. alpha = options3d.alpha,
  838. beta = options3d.beta;
  839. var z = pieOptions.stacking ? (this.options.stack || 0) * depth : series._i * depth;
  840. z += depth / 2;
  841. if (pieOptions.grouping !== false) { z = 0; }
  842. Highcharts.each(series.data, function (point) {
  843. point.shapeType = 'arc3d';
  844. var shapeArgs = point.shapeArgs;
  845. shapeArgs.z = z;
  846. shapeArgs.depth = depth * 0.75;
  847. shapeArgs.origin = origin;
  848. shapeArgs.alpha = alpha;
  849. shapeArgs.beta = beta;
  850. var angle = (shapeArgs.end + shapeArgs.start) / 2;
  851. point.slicedTranslation = {
  852. translateX : round(cos(angle) * series.options.slicedOffset * cos(alpha * deg2rad)),
  853. translateY : round(sin(angle) * series.options.slicedOffset * cos(alpha * deg2rad))
  854. };
  855. });
  856. });
  857. Highcharts.wrap(Highcharts.seriesTypes.pie.prototype.pointClass.prototype, 'haloPath', function (proceed) {
  858. return this.series.chart.is3d() ? [] : proceed.call(this);
  859. });
  860. Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'drawPoints', function (proceed) {
  861. // Do not do this if the chart is not 3D
  862. if (this.chart.is3d()) {
  863. // Set the border color to the fill color to provide a smooth edge
  864. Highcharts.each(this.data, function (point) {
  865. var c = point.options.borderColor || point.color || point.series.userOptions.borderColor || point.series.color;
  866. point.options.borderColor = c;
  867. point.borderColor = c;
  868. point.pointAttr[''].stroke = c;
  869. // same bordercolor on hover and select
  870. point.pointAttr.hover.stroke = c;
  871. point.pointAttr.select.stroke = c;
  872. });
  873. }
  874. proceed.apply(this, [].slice.call(arguments, 1));
  875. });
  876. Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'drawDataLabels', function (proceed) {
  877. proceed.apply(this, [].slice.call(arguments, 1));
  878. // Do not do this if the chart is not 3D
  879. if (!this.chart.is3d()) {
  880. return;
  881. }
  882. var series = this;
  883. Highcharts.each(series.data, function (point) {
  884. var shapeArgs = point.shapeArgs;
  885. var r = shapeArgs.r,
  886. d = shapeArgs.depth,
  887. a1 = shapeArgs.alpha * deg2rad,
  888. b1 = shapeArgs.beta * deg2rad,
  889. a2 = (shapeArgs.start + shapeArgs.end) / 2;
  890. if (point.connector) {
  891. point.connector.translate(
  892. (-r * (1 - cos(b1)) * cos(a2)) + (cos(a2) > 0 ? sin(b1) * d : 0),
  893. (-r * (1 - cos(a1)) * sin(a2)) + (sin(a2) > 0 ? sin(a1) * d : 0)
  894. );
  895. }
  896. if (point.dataLabel) {
  897. point.dataLabel.attr({
  898. x: point.dataLabel.connX + (-r * (1 - cos(b1)) * cos(a2)) + (cos(a2) > 0 ? cos(b1) * d : 0) - (point.dataLabel.width / 2),
  899. y: point.dataLabel.connY + (-r * (1 - cos(a1)) * sin(a2)) + (sin(a2) > 0 ? sin(a1) * d : 0) - (point.dataLabel.height / 2)
  900. });
  901. }
  902. });
  903. });
  904. Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'addPoint', function (proceed) {
  905. proceed.apply(this, [].slice.call(arguments, 1));
  906. if (this.chart.is3d()) {
  907. // destroy (and rebuild) everything!!!
  908. this.update();
  909. }
  910. });
  911. Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'animate', function (proceed) {
  912. if (!this.chart.is3d()) {
  913. proceed.apply(this, [].slice.call(arguments, 1));
  914. } else {
  915. var args = arguments,
  916. init = args[1],
  917. animation = this.options.animation,
  918. attribs,
  919. center = this.center,
  920. group = this.group,
  921. markerGroup = this.markerGroup;
  922. if (Highcharts.svg) { // VML is too slow anyway
  923. if (animation === true) {
  924. animation = {};
  925. }
  926. // Initialize the animation
  927. if (init) {
  928. // Scale down the group and place it in the center
  929. this.oldtranslateX = group.translateX;
  930. this.oldtranslateY = group.translateY;
  931. attribs = {
  932. translateX: center[0],
  933. translateY: center[1],
  934. scaleX: 0.001, // #1499
  935. scaleY: 0.001
  936. };
  937. group.attr(attribs);
  938. if (markerGroup) {
  939. markerGroup.attrSetters = group.attrSetters;
  940. markerGroup.attr(attribs);
  941. }
  942. // Run the animation
  943. } else {
  944. attribs = {
  945. translateX: this.oldtranslateX,
  946. translateY: this.oldtranslateY,
  947. scaleX: 1,
  948. scaleY: 1
  949. };
  950. group.animate(attribs, animation);
  951. if (markerGroup) {
  952. markerGroup.animate(attribs, animation);
  953. }
  954. // Delete this function to allow it only once
  955. this.animate = null;
  956. }
  957. }
  958. }
  959. });/***
  960. EXTENSION FOR 3D SCATTER CHART
  961. ***/
  962. Highcharts.wrap(Highcharts.seriesTypes.scatter.prototype, 'translate', function (proceed) {
  963. //function translate3d(proceed) {
  964. proceed.apply(this, [].slice.call(arguments, 1));
  965. if (!this.chart.is3d()) {
  966. return;
  967. }
  968. var series = this,
  969. chart = series.chart,
  970. options3d = series.chart.options.chart.options3d,
  971. alpha = options3d.alpha,
  972. beta = options3d.beta,
  973. origin = {
  974. x: chart.inverted ? chart.plotHeight / 2 : chart.plotWidth / 2,
  975. y: chart.inverted ? chart.plotWidth / 2 : chart.plotHeight / 2,
  976. z: options3d.depth,
  977. vd: options3d.viewDistance
  978. },
  979. depth = options3d.depth,
  980. zAxis = chart.options.zAxis || { min : 0, max: depth };
  981. var rangeModifier = depth / (zAxis.max - zAxis.min);
  982. Highcharts.each(series.data, function (point) {
  983. var pCo = {
  984. x: point.plotX,
  985. y: point.plotY,
  986. z: (point.z - zAxis.min) * rangeModifier
  987. };
  988. pCo = perspective([pCo], alpha, beta, origin)[0];
  989. point.plotXold = point.plotX;
  990. point.plotYold = point.plotY;
  991. point.plotX = pCo.x;
  992. point.plotY = pCo.y;
  993. point.plotZ = pCo.z;
  994. });
  995. });
  996. Highcharts.wrap(Highcharts.seriesTypes.scatter.prototype, 'init', function (proceed) {
  997. var result = proceed.apply(this, [].slice.call(arguments, 1));
  998. if (this.chart.is3d()) {
  999. // Add a third coordinate
  1000. this.pointArrayMap = ['x', 'y', 'z'];
  1001. // Set a new default tooltip formatter
  1002. var default3dScatterTooltip = 'x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>z: <b>{point.z}</b><br/>';
  1003. if (this.userOptions.tooltip) {
  1004. this.tooltipOptions.pointFormat = this.userOptions.tooltip.pointFormat || default3dScatterTooltip;
  1005. } else {
  1006. this.tooltipOptions.pointFormat = default3dScatterTooltip;
  1007. }
  1008. }
  1009. return result;
  1010. });/**
  1011. * Extension to the VML Renderer
  1012. */
  1013. if (Highcharts.VMLRenderer) {
  1014. Highcharts.setOptions({animate: false});
  1015. Highcharts.VMLRenderer.prototype.cuboid = Highcharts.SVGRenderer.prototype.cuboid;
  1016. Highcharts.VMLRenderer.prototype.cuboidPath = Highcharts.SVGRenderer.prototype.cuboidPath;
  1017. Highcharts.VMLRenderer.prototype.toLinePath = Highcharts.SVGRenderer.prototype.toLinePath;
  1018. Highcharts.VMLRenderer.prototype.createElement3D = Highcharts.SVGRenderer.prototype.createElement3D;
  1019. Highcharts.VMLRenderer.prototype.arc3d = function (shapeArgs) {
  1020. var result = Highcharts.SVGRenderer.prototype.arc3d.call(this, shapeArgs);
  1021. result.css({zIndex: result.zIndex});
  1022. return result;
  1023. };
  1024. Highcharts.VMLRenderer.prototype.arc3dPath = Highcharts.SVGRenderer.prototype.arc3dPath;
  1025. // Draw the series in the reverse order
  1026. Highcharts.Chart.prototype.renderSeries = function () {
  1027. var serie,
  1028. i = this.series.length;
  1029. while (i--) {
  1030. serie = this.series[i];
  1031. serie.translate();
  1032. if (serie.setTooltipPoints) {
  1033. serie.setTooltipPoints();
  1034. }
  1035. serie.render();
  1036. }
  1037. };
  1038. Highcharts.wrap(Highcharts.Axis.prototype, 'render', function (proceed) {
  1039. proceed.apply(this, [].slice.call(arguments, 1));
  1040. // VML doesn't support a negative z-index
  1041. if (this.sideFrame) {
  1042. this.sideFrame.css({zIndex: 0});
  1043. this.sideFrame.front.attr({fill: this.sideFrame.color});
  1044. }
  1045. if (this.bottomFrame) {
  1046. this.bottomFrame.css({zIndex: 1});
  1047. this.bottomFrame.front.attr({fill: this.bottomFrame.color});
  1048. }
  1049. if (this.backFrame) {
  1050. this.backFrame.css({zIndex: 0});
  1051. this.backFrame.front.attr({fill: this.backFrame.color});
  1052. }
  1053. });
  1054. }
  1055. }(Highcharts));