highcharts-3d.src.js 137 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400
/**
 * @license Highcharts JS v6.2.0 (2018-10-17)
 *
 * 3D features for Highcharts JS
 *
 * @license: www.highcharts.com/license
 */
'use strict';
(function (factory) {
	if (typeof module === 'object' && module.exports) {
		module.exports = factory;
	} else if (typeof define === 'function' && define.amd) {
		define(function () {
			return factory;
		});
	} else {
		factory(Highcharts);
	}
}(function (Highcharts) {
	(function (H) {
		/**
		 * (c) 2010-2018 Torstein Honsi
		 *
		 * License: www.highcharts.com/license
		 */
		/**
		 *    Mathematical Functionility
		 */
		var deg2rad = H.deg2rad,
		    pick = H.pick;

		/* eslint-disable max-len */
		/**
		 * Apply 3-D rotation
		 * Euler Angles (XYZ):
		 *     cosA = cos(Alfa|Roll)
		 *     cosB = cos(Beta|Pitch)
		 *     cosG = cos(Gamma|Yaw)
		 *
		 * Composite rotation:
		 * |          cosB * cosG             |           cosB * sinG            |    -sinB    |
		 * | sinA * sinB * cosG - cosA * sinG | sinA * sinB * sinG + cosA * cosG | sinA * cosB |
		 * | cosA * sinB * cosG + sinA * sinG | cosA * sinB * sinG - sinA * cosG | cosA * cosB |
		 *
		 * Now, Gamma/Yaw is not used (angle=0), so we assume cosG = 1 and sinG = 0, so
		 * we get:
		 * |     cosB    |   0    |   - sinB    |
		 * | sinA * sinB |  cosA  | sinA * cosB |
		 * | cosA * sinB | - sinA | cosA * cosB |
		 *
		 * But in browsers, y is reversed, so we get sinA => -sinA. The general result
		 * is:
		 * |      cosB     |   0    |    - sinB     |     | x |     | px |
		 * | - sinA * sinB |  cosA  | - sinA * cosB |  x  | y |  =  | py |
		 * |  cosA * sinB  |  sinA  |  cosA * cosB  |     | z |     | pz |
		 */
		/* eslint-enable max-len */
		function rotate3D(x, y, z, angles) {
		    return {
		        x: angles.cosB * x - angles.sinB * z,
		        y: -angles.sinA * angles.sinB * x + angles.cosA * y -
		            angles.cosB * angles.sinA * z,
		        z: angles.cosA * angles.sinB * x + angles.sinA * y +
		            angles.cosA * angles.cosB * z
		    };
		}

		// Perspective3D function is available in global Highcharts scope because is
		// needed also outside of perspective() function (#8042).
		H.perspective3D = function (coordinate, origin, distance) {
		    var projection = ((distance > 0) && (distance < Number.POSITIVE_INFINITY)) ?
		    distance / (coordinate.z + origin.z + distance) :
		    1;
		    return {
		        x: coordinate.x * projection,
		        y: coordinate.y * projection
		    };
		};

		/**
		 * Transforms a given array of points according to the angles in chart.options.
		 * Parameters:
		 *        - points: the array of points
		 *        - chart: the chart
		 *        - insidePlotArea: wether to verifiy the points are inside the plotArea
		 * Returns:
		 *        - an array of transformed points
		 */
		H.perspective = function (points, chart, insidePlotArea) {
		    var options3d = chart.options.chart.options3d,
		        inverted = insidePlotArea ? chart.inverted : false,
		        origin = {
		            x: chart.plotWidth / 2,
		            y: chart.plotHeight / 2,
		            z: options3d.depth / 2,
		            vd: pick(options3d.depth, 1) * pick(options3d.viewDistance, 0)
		        },
		        scale = chart.scale3d || 1,
		        beta = deg2rad * options3d.beta * (inverted ? -1 : 1),
		        alpha = deg2rad * options3d.alpha * (inverted ? -1 : 1),
		        angles = {
		            cosA: Math.cos(alpha),
		            cosB: Math.cos(-beta),
		            sinA: Math.sin(alpha),
		            sinB: Math.sin(-beta)
		        };

		    if (!insidePlotArea) {
		        origin.x += chart.plotLeft;
		        origin.y += chart.plotTop;
		    }

		    // Transform each point
		    return H.map(points, function (point) {
		        var rotated = rotate3D(
		                (inverted ? point.y : point.x) - origin.x,
		                (inverted ? point.x : point.y) - origin.y,
		                (point.z || 0) - origin.z,
		                angles
		            ),
		            // Apply perspective
		            coordinate = H.perspective3D(rotated, origin, origin.vd);

		        // Apply translation
		        coordinate.x = coordinate.x * scale + origin.x;
		        coordinate.y = coordinate.y * scale + origin.y;
		        coordinate.z = rotated.z * scale + origin.z;

		        return {
		            x: (inverted ? coordinate.y : coordinate.x),
		            y: (inverted ? coordinate.x : coordinate.y),
		            z: coordinate.z
		        };
		    });
		};

		/**
		 * Calculate a distance from camera to points - made for calculating zIndex of
		 * scatter points.
		 * Parameters:
		 *        - coordinates: The coordinates of the specific point
		 *        - chart: the chart
		 * Returns:
		 *        - a distance from camera to point
		 */
		H.pointCameraDistance = function (coordinates, chart) {
		    var options3d = chart.options.chart.options3d,
		        cameraPosition = {
		            x: chart.plotWidth / 2,
		            y: chart.plotHeight / 2,
		            z: pick(options3d.depth, 1) * pick(options3d.viewDistance, 0) +
		                options3d.depth
		        },
		        distance = Math.sqrt(
		            Math.pow(cameraPosition.x - coordinates.plotX, 2) +
		            Math.pow(cameraPosition.y - coordinates.plotY, 2) +
		            Math.pow(cameraPosition.z - coordinates.plotZ, 2)
		        );
		    return distance;
		};

		/**
		 * Calculate area of a 2D polygon using Shoelace algorithm
		 * http://en.wikipedia.org/wiki/Shoelace_formula
		 */
		H.shapeArea = function (vertexes) {
		    var area = 0,
		        i,
		        j;
		    for (i = 0; i < vertexes.length; i++) {
		        j = (i + 1) % vertexes.length;
		        area += vertexes[i].x * vertexes[j].y - vertexes[j].x * vertexes[i].y;
		    }
		    return area / 2;
		};

		/**
		 * Calculate area of a 3D polygon after perspective projection
		 */
		H.shapeArea3d = function (vertexes, chart, insidePlotArea) {
		    return H.shapeArea(H.perspective(vertexes, chart, insidePlotArea));
		};


	}(Highcharts));
	(function (H) {
		/**
		 * (c) 2010-2018 Torstein Honsi
		 *
		 * License: www.highcharts.com/license
		 */
		var cos = Math.cos,
		    PI = Math.PI,
		    sin = Math.sin;


		var animObject = H.animObject,
		    charts = H.charts,
		    color = H.color,
		    defined = H.defined,
		    deg2rad = H.deg2rad,
		    each = H.each,
		    extend = H.extend,
		    inArray = H.inArray,
		    map = H.map,
		    merge = H.merge,
		    perspective = H.perspective,
		    pick = H.pick,
		    SVGElement = H.SVGElement,
		    SVGRenderer = H.SVGRenderer,
		    wrap = H.wrap;
		/*
		    EXTENSION TO THE SVG-RENDERER TO ENABLE 3D SHAPES
		*/
		// HELPER METHODS //

		var dFactor = (4 * (Math.sqrt(2) - 1) / 3) / (PI / 2);

		/** Method to construct a curved path
		  * Can 'wrap' around more then 180 degrees
		  */
		function curveTo(cx, cy, rx, ry, start, end, dx, dy) {
		    var result = [],
		        arcAngle = end - start;
		    if ((end > start) && (end - start > Math.PI / 2 + 0.0001)) {
		        result = result.concat(
		            curveTo(cx, cy, rx, ry, start, start + (Math.PI / 2), dx, dy)
		        );
		        result = result.concat(
		            curveTo(cx, cy, rx, ry, start + (Math.PI / 2), end, dx, dy)
		        );
		        return result;
		    }
		    if ((end < start) && (start - end > Math.PI / 2 + 0.0001)) {
		        result = result.concat(
		            curveTo(cx, cy, rx, ry, start, start - (Math.PI / 2), dx, dy)
		        );
		        result = result.concat(
		            curveTo(cx, cy, rx, ry, start - (Math.PI / 2), end, dx, dy)
		        );
		        return result;
		    }
		    return [
		        'C',
		        cx + (rx * Math.cos(start)) -
		            ((rx * dFactor * arcAngle) * Math.sin(start)) + dx,
		        cy + (ry * Math.sin(start)) +
		            ((ry * dFactor * arcAngle) * Math.cos(start)) + dy,
		        cx + (rx * Math.cos(end)) +
		            ((rx * dFactor * arcAngle) * Math.sin(end)) + dx,
		        cy + (ry * Math.sin(end)) -
		            ((ry * dFactor * arcAngle) * Math.cos(end)) + dy,

		        cx + (rx * Math.cos(end)) + dx,
		        cy + (ry * Math.sin(end)) + dy
		    ];
		}



		SVGRenderer.prototype.toLinePath = function (points, closed) {
		    var result = [];

		    // Put "L x y" for each point
		    each(points, function (point) {
		        result.push('L', point.x, point.y);
		    });

		    if (points.length) {
		        // Set the first element to M
		        result[0] = 'M';

		        // If it is a closed line, add Z
		        if (closed) {
		            result.push('Z');
		        }
		    }

		    return result;
		};

		SVGRenderer.prototype.toLineSegments = function (points) {
		    var result = [];

		    var m = true;
		    each(points, function (point) {
		        result.push(m ? 'M' : 'L', point.x, point.y);
		        m = !m;
		    });

		    return result;
		};

		/**
		 * A 3-D Face is defined by it's 3D vertexes, and is only
		 * visible if it's vertexes are counter-clockwise (Back-face culling).
		 * It is used as a polyhedron Element
		 */
		SVGRenderer.prototype.face3d = function (args) {
		    var renderer = this,
		        ret = this.createElement('path');
		    ret.vertexes = [];
		    ret.insidePlotArea = false;
		    ret.enabled = true;

		    wrap(ret, 'attr', function (proceed, hash) {
		        if (
		            typeof hash === 'object' &&
		            (
		                defined(hash.enabled) ||
		                defined(hash.vertexes) ||
		                defined(hash.insidePlotArea)
		            )
		        ) {
		            this.enabled = pick(hash.enabled, this.enabled);
		            this.vertexes = pick(hash.vertexes, this.vertexes);
		            this.insidePlotArea = pick(
		                hash.insidePlotArea,
		                this.insidePlotArea
		            );
		            delete hash.enabled;
		            delete hash.vertexes;
		            delete hash.insidePlotArea;

		            var chart = charts[renderer.chartIndex],
		                vertexes2d = perspective(
		                    this.vertexes,
		                    chart,
		                    this.insidePlotArea
		                ),
		                path = renderer.toLinePath(vertexes2d, true),
		                area = H.shapeArea(vertexes2d),
		                visibility = (this.enabled && area > 0) ? 'visible' : 'hidden';

		            hash.d = path;
		            hash.visibility = visibility;
		        }
		        return proceed.apply(this, [].slice.call(arguments, 1));
		    });

		    wrap(ret, 'animate', function (proceed, params) {
		        if (
		            typeof params === 'object' &&
		            (
		                defined(params.enabled) ||
		                defined(params.vertexes) ||
		                defined(params.insidePlotArea)
		            )
		        ) {
		            this.enabled = pick(params.enabled, this.enabled);
		            this.vertexes = pick(params.vertexes, this.vertexes);
		            this.insidePlotArea = pick(
		                params.insidePlotArea,
		                this.insidePlotArea
		            );
		            delete params.enabled;
		            delete params.vertexes;
		            delete params.insidePlotArea;

		            var chart = charts[renderer.chartIndex],
		                vertexes2d = perspective(
		                    this.vertexes,
		                    chart,
		                    this.insidePlotArea
		                ),
		                path = renderer.toLinePath(vertexes2d, true),
		                area = H.shapeArea(vertexes2d),
		                visibility = (this.enabled && area > 0) ? 'visible' : 'hidden';

		            params.d = path;
		            this.attr('visibility', visibility);
		        }

		        return proceed.apply(this, [].slice.call(arguments, 1));
		    });

		    return ret.attr(args);
		};

		/**
		 * A Polyhedron is a handy way of defining a group of 3-D faces. It's only
		 * attribute is `faces`, an array of attributes of each one of it's Face3D
		 * instances.
		 */
		SVGRenderer.prototype.polyhedron = function (args) {
		    var renderer = this,
		        result = this.g(),
		        destroy = result.destroy;

    
		    result.attr({
		        'stroke-linejoin': 'round'
		    });
    

		    result.faces = [];


		    // destroy all children
		    result.destroy = function () {
		        for (var i = 0; i < result.faces.length; i++) {
		            result.faces[i].destroy();
		        }
		        return destroy.call(this);
		    };

		    wrap(
		        result,
		        'attr',
		        function (proceed, hash, val, complete, continueAnimation) {
		            if (typeof hash === 'object' && defined(hash.faces)) {
		                while (result.faces.length > hash.faces.length) {
		                    result.faces.pop().destroy();
		                }
		                while (result.faces.length < hash.faces.length) {
		                    result.faces.push(renderer.face3d().add(result));
		                }
		                for (var i = 0; i < hash.faces.length; i++) {
		                    result.faces[i].attr(
		                        hash.faces[i],
		                        null,
		                        complete,
		                        continueAnimation
		                    );
		                }
		                delete hash.faces;
		            }
		            return proceed.apply(this, [].slice.call(arguments, 1));
		        }

		    );

		    wrap(result, 'animate', function (proceed, params, duration, complete) {
		        if (params && params.faces) {
		            while (result.faces.length > params.faces.length) {
		                result.faces.pop().destroy();
		            }
		            while (result.faces.length < params.faces.length) {
		                result.faces.push(renderer.face3d().add(result));
		            }
		            for (var i = 0; i < params.faces.length; i++) {
		                result.faces[i].animate(params.faces[i], duration, complete);
		            }
		            delete params.faces;
		        }
		        return proceed.apply(this, [].slice.call(arguments, 1));
		    });

		    return result.attr(args);
		};

		// CUBOIDS //
		SVGRenderer.prototype.cuboid = function (shapeArgs) {

		    var result = this.g(),
		        destroy = result.destroy,
		        paths = this.cuboidPath(shapeArgs);

    
		    result.attr({
		        'stroke-linejoin': 'round'
		    });
    

		    // Create the 3 sides. // Front, top and side are never overlapping in our
		    // case so it is redundant to set zIndex of every element.
		    result.front = this.path(paths[0]).attr({
		        'class': 'highcharts-3d-front'
		    }).add(result);
		    result.top = this.path(paths[1]).attr({
		        'class': 'highcharts-3d-top'
		    }).add(result);
		    result.side = this.path(paths[2]).attr({
		        'class': 'highcharts-3d-side'
		    }).add(result);

		    // apply the fill everywhere, the top a bit brighter, the side a bit darker
		    result.fillSetter = function (fill) {
		        this.front.attr({
		            fill: fill
		        });
		        this.top.attr({
		            fill: color(fill).brighten(0.1).get()
		        });
		        this.side.attr({
		            fill: color(fill).brighten(-0.1).get()
		        });
		        this.color = fill;

		        // for animation getter (#6776)
		        result.fill = fill;

		        return this;
		    };

		    // apply opacaity everywhere
		    result.opacitySetter = function (opacity) {
		        this.front.attr({ opacity: opacity });
		        this.top.attr({ opacity: opacity });
		        this.side.attr({ opacity: opacity });
		        return this;
		    };

		    result.attr = function (args, val, complete, continueAnimation) {

		        // Resolve setting attributes by string name
		        if (typeof args === 'string' && typeof val !== 'undefined') {
		            var key = args;
		            args = {};
		            args[key] = val;
		        }

		        if (args.shapeArgs || defined(args.x)) {
		            var shapeArgs = args.shapeArgs || args;
		            var paths = this.renderer.cuboidPath(shapeArgs);
		            this.front.attr({ d: paths[0] });
		            this.top.attr({ d: paths[1] });
		            this.side.attr({ d: paths[2] });
		        } else {
		            // getter returns value
		            return SVGElement.prototype.attr.call(
		                this, args, undefined, complete, continueAnimation
		            );
		        }

		        return this;
		    };

		    result.animate = function (args, duration, complete) {
		        if (defined(args.x) && defined(args.y)) {
		            var paths = this.renderer.cuboidPath(args);
		            this.front.animate({ d: paths[0] }, duration, complete);
		            this.top.animate({ d: paths[1] }, duration, complete);
		            this.side.animate({ d: paths[2] }, duration, complete);
		            this.attr({
		                zIndex: -paths[3] // #4774
		            });
		        } else if (args.opacity) {
		            this.front.animate(args, duration, complete);
		            this.top.animate(args, duration, complete);
		            this.side.animate(args, duration, complete);
		        } else {
		            SVGElement.prototype.animate.call(this, args, duration, complete);
		        }
		        return this;
		    };

		    // destroy all children
		    result.destroy = function () {
		        this.front.destroy();
		        this.top.destroy();
		        this.side.destroy();

		        return destroy.call(this);
		    };

		    // Apply the Z index to the cuboid group
		    result.attr({ zIndex: -paths[3] });

		    return result;
		};

		/**
		 *    Generates a cuboid
		 */
		H.SVGRenderer.prototype.cuboidPath = function (shapeArgs) {
		    var x = shapeArgs.x,
		        y = shapeArgs.y,
		        z = shapeArgs.z,
		        h = shapeArgs.height,
		        w = shapeArgs.width,
		        d = shapeArgs.depth,
		        chart = charts[this.chartIndex],
		        front,
		        back,
		        top,
		        bottom,
		        left,
		        right,
		        shape,
		        path1,
		        path2,
		        path3,
		        isFront,
		        isTop,
		        isRight,
		        options3d = chart.options.chart.options3d,
		        alpha = options3d.alpha,
		        // Priority for x axis is the biggest,
		        // because of x direction has biggest influence on zIndex
		        incrementX = 10000,
		        // y axis has the smallest priority in case of our charts
		        // (needs to be set because of stacking)
		        incrementY = 10,
		        incrementZ = 100,
		        zIndex = 0;

		    // The 8 corners of the cube
		    var pArr = [{
		        x: x,
		        y: y,
		        z: z
		    }, {
		        x: x + w,
		        y: y,
		        z: z
		    }, {
		        x: x + w,
		        y: y + h,
		        z: z
		    }, {
		        x: x,
		        y: y + h,
		        z: z
		    }, {
		        x: x,
		        y: y + h,
		        z: z + d
		    }, {
		        x: x + w,
		        y: y + h,
		        z: z + d
		    }, {
		        x: x + w,
		        y: y,
		        z: z + d
		    }, {
		        x: x,
		        y: y,
		        z: z + d
		    }];

		    // apply perspective
		    pArr = perspective(pArr, chart, shapeArgs.insidePlotArea);

		    // helper method to decide which side is visible
		    function mapPath(i) {
		        return pArr[i];
		    }

		    /*
		     * First value - path with specific side
		     * Second  value - added information about side for later calculations.
		     * Possible second values are 0 for path1, 1 for path2 and -1 for no path
		     * chosen.
		     */
		    var pickShape = function (path1, path2) {
		        var ret = [
		                [], -1
		        ];
		        path1 = map(path1, mapPath);
		        path2 = map(path2, mapPath);
		        if (H.shapeArea(path1) < 0) {
		            ret = [path1, 0];
		        } else if (H.shapeArea(path2) < 0) {
		            ret = [path2, 1];
		        }
		        return ret;
		    };

		    // front or back
		    front = [3, 2, 1, 0];
		    back = [7, 6, 5, 4];
		    shape = pickShape(front, back);
		    path1 = shape[0];
		    isFront = shape[1];


		    // top or bottom
		    top = [1, 6, 7, 0];
		    bottom = [4, 5, 2, 3];
		    shape = pickShape(top, bottom);
		    path2 = shape[0];
		    isTop = shape[1];

		    // side
		    right = [1, 2, 5, 6];
		    left = [0, 7, 4, 3];
		    shape = pickShape(right, left);
		    path3 = shape[0];
		    isRight = shape[1];

		    /*
		     * New block used for calculating zIndex. It is basing on X, Y and Z
		     * position of specific columns. All zIndexes (for X, Y and Z values) are
		     * added to the final zIndex, where every value has different priority. The
		     * biggest priority is in X and Z directions, the lowest index is for
		     * stacked columns (Y direction and the same X and Z positions). Big
		     * differences between priorities is made because we need to ensure that
		     * even for big changes in Y and Z parameters all columns will be drawn
		     * correctly.
		     */

		    if (isRight === 1) {
		        zIndex += incrementX * (1000 - x);
		    } else if (!isRight) {
		        zIndex += incrementX * x;
		    }

		    zIndex += incrementY * (
		        !isTop ||
		        // Numbers checked empirically
		        (alpha >= 0 && alpha <= 180 || alpha < 360 && alpha > 357.5) ?
		            chart.plotHeight - y : 10 + y
		    );

		    if (isFront === 1) {
		        zIndex += incrementZ * (z);
		    } else if (!isFront) {
		        zIndex += incrementZ * (1000 - z);
		    }

		    zIndex = -Math.round(zIndex);

		    return [
		        this.toLinePath(path1, true),
		        this.toLinePath(path2, true),
		        this.toLinePath(path3, true),
		        zIndex
		    ]; // #4774
		};

		// SECTORS //
		H.SVGRenderer.prototype.arc3d = function (attribs) {

		    var wrapper = this.g(),
		        renderer = wrapper.renderer,
		        customAttribs = ['x', 'y', 'r', 'innerR', 'start', 'end'];

		    /**
		     * Get custom attributes. Don't mutate the original object and return an
		     * object with only custom attr.
		     */
		    function suckOutCustom(params) {
		        var hasCA = false,
		            ca = {};

		        params = merge(params); // Don't mutate the original object

		        for (var key in params) {
		            if (inArray(key, customAttribs) !== -1) {
		                ca[key] = params[key];
		                delete params[key];
		                hasCA = true;
		            }
		        }
		        return hasCA ? ca : false;
		    }

		    attribs = merge(attribs);

		    attribs.alpha = (attribs.alpha || 0) * deg2rad;
		    attribs.beta = (attribs.beta || 0) * deg2rad;

		    // Create the different sub sections of the shape
		    wrapper.top = renderer.path();
		    wrapper.side1 = renderer.path();
		    wrapper.side2 = renderer.path();
		    wrapper.inn = renderer.path();
		    wrapper.out = renderer.path();

		    /**
		     * Add all faces
		     */
		    wrapper.onAdd = function () {
		        var parent = wrapper.parentGroup,
		            className = wrapper.attr('class');
		        wrapper.top.add(wrapper);

		        // These faces are added outside the wrapper group because the z index
		        // relates to neighbour elements as well
		        each(['out', 'inn', 'side1', 'side2'], function (face) {
		            wrapper[face]
		                .attr({
		                    'class': className + ' highcharts-3d-side'
		                })
		                .add(parent);
		        });
		    };

		    // Cascade to faces
		    each(['addClass', 'removeClass'], function (fn) {
		        wrapper[fn] = function () {
		            var args = arguments;
		            each(['top', 'out', 'inn', 'side1', 'side2'], function (face) {
		                wrapper[face][fn].apply(wrapper[face], args);
		            });
		        };
		    });

		    /**
		     * Compute the transformed paths and set them to the composite shapes
		     */
		    wrapper.setPaths = function (attribs) {

		        var paths = wrapper.renderer.arc3dPath(attribs),
		            zIndex = paths.zTop * 100;

		        wrapper.attribs = attribs;

		        wrapper.top.attr({ d: paths.top, zIndex: paths.zTop });
		        wrapper.inn.attr({ d: paths.inn, zIndex: paths.zInn });
		        wrapper.out.attr({ d: paths.out, zIndex: paths.zOut });
		        wrapper.side1.attr({ d: paths.side1, zIndex: paths.zSide1 });
		        wrapper.side2.attr({ d: paths.side2, zIndex: paths.zSide2 });


		        // show all children
		        wrapper.zIndex = zIndex;
		        wrapper.attr({ zIndex: zIndex });

		        // Set the radial gradient center the first time
		        if (attribs.center) {
		            wrapper.top.setRadialReference(attribs.center);
		            delete attribs.center;
		        }
		    };
		    wrapper.setPaths(attribs);

		    // Apply the fill to the top and a darker shade to the sides
		    wrapper.fillSetter = function (value) {
		        var darker = color(value).brighten(-0.1).get();

		        this.fill = value;

		        this.side1.attr({ fill: darker });
		        this.side2.attr({ fill: darker });
		        this.inn.attr({ fill: darker });
		        this.out.attr({ fill: darker });
		        this.top.attr({ fill: value });
		        return this;
		    };

		    // Apply the same value to all. These properties cascade down to the
		    // children when set to the composite arc3d.
		    each(
		        ['opacity', 'translateX', 'translateY', 'visibility'],
		        function (setter) {
		            wrapper[setter + 'Setter'] = function (value, key) {
		                wrapper[key] = value;
		                each(['out', 'inn', 'side1', 'side2', 'top'], function (el) {
		                    wrapper[el].attr(key, value);
		                });
		            };
		        }
		    );

		    /**
		     * Override attr to remove shape attributes and use those to set child paths
		     */
		    wrap(wrapper, 'attr', function (proceed, params) {
		        var ca;
		        if (typeof params === 'object') {
		            ca = suckOutCustom(params);
		            if (ca) {
		                extend(wrapper.attribs, ca);
		                wrapper.setPaths(wrapper.attribs);
		            }
		        }
		        return proceed.apply(this, [].slice.call(arguments, 1));
		    });

		    /**
		     * Override the animate function by sucking out custom parameters related to
		     * the shapes directly, and update the shapes from the animation step.
		     */
		    wrap(wrapper, 'animate', function (proceed, params, animation, complete) {
		        var ca,
		            from = this.attribs,
		            to,
		            anim,
		            randomProp = 'data-' + Math.random().toString(26).substring(2, 9);

		        // Attribute-line properties connected to 3D. These shouldn't have been
		        // in the attribs collection in the first place.
		        delete params.center;
		        delete params.z;
		        delete params.depth;
		        delete params.alpha;
		        delete params.beta;

		        anim = animObject(pick(animation, this.renderer.globalAnimation));

		        if (anim.duration) {
		            ca = suckOutCustom(params);
		            // Params need to have a property in order for the step to run
		            // (#5765, #7097, #7437)
		            wrapper[randomProp] = 0;
		            params[randomProp] = 1;
		            wrapper[randomProp + 'Setter'] = H.noop;

		            if (ca) {
		                to = ca;
		                anim.step = function (a, fx) {
		                    function interpolate(key) {
		                        return from[key] +
		                            (pick(to[key], from[key]) - from[key]) * fx.pos;
		                    }

		                    if (fx.prop === randomProp) {
		                        fx.elem.setPaths(merge(from, {
		                            x: interpolate('x'),
		                            y: interpolate('y'),
		                            r: interpolate('r'),
		                            innerR: interpolate('innerR'),
		                            start: interpolate('start'),
		                            end: interpolate('end')
		                        }));
		                    }
		                };
		            }
		            animation = anim; // Only when duration (#5572)
		        }
		        return proceed.call(this, params, animation, complete);
		    });

		    // destroy all children
		    wrapper.destroy = function () {
		        this.top.destroy();
		        this.out.destroy();
		        this.inn.destroy();
		        this.side1.destroy();
		        this.side2.destroy();

		        SVGElement.prototype.destroy.call(this);
		    };
		    // hide all children
		    wrapper.hide = function () {
		        this.top.hide();
		        this.out.hide();
		        this.inn.hide();
		        this.side1.hide();
		        this.side2.hide();
		    };
		    wrapper.show = function () {
		        this.top.show();
		        this.out.show();
		        this.inn.show();
		        this.side1.show();
		        this.side2.show();
		    };
		    return wrapper;
		};

		/**
		 * Generate the paths required to draw a 3D arc
		 */
		SVGRenderer.prototype.arc3dPath = function (shapeArgs) {
		    var cx = shapeArgs.x, // x coordinate of the center
		        cy = shapeArgs.y, // y coordinate of the center
		        start = shapeArgs.start, // start angle
		        end = shapeArgs.end - 0.00001, // end angle
		        r = shapeArgs.r, // radius
		        ir = shapeArgs.innerR || 0, // inner radius
		        d = shapeArgs.depth || 0, // depth
		        alpha = shapeArgs.alpha, // alpha rotation of the chart
		        beta = shapeArgs.beta; // beta rotation of the chart

		    // Derived Variables
		    var cs = Math.cos(start),        // cosinus of the start angle
		        ss = Math.sin(start),        // sinus of the start angle
		        ce = Math.cos(end),            // cosinus of the end angle
		        se = Math.sin(end),            // sinus of the end angle
		        rx = r * Math.cos(beta),        // x-radius
		        ry = r * Math.cos(alpha),    // y-radius
		        irx = ir * Math.cos(beta),    // x-radius (inner)
		        iry = ir * Math.cos(alpha),    // y-radius (inner)
		        dx = d * Math.sin(beta),        // distance between top and bottom in x
		        dy = d * Math.sin(alpha);    // distance between top and bottom in y

		    // TOP
		    var top = ['M', cx + (rx * cs), cy + (ry * ss)];
		    top = top.concat(curveTo(cx, cy, rx, ry, start, end, 0, 0));
		    top = top.concat([
		        'L', cx + (irx * ce), cy + (iry * se)
		    ]);
		    top = top.concat(curveTo(cx, cy, irx, iry, end, start, 0, 0));
		    top = top.concat(['Z']);

		    // OUTSIDE
		    var b = (beta > 0 ? Math.PI / 2 : 0),
		        a = (alpha > 0 ? 0 : Math.PI / 2);

		    var start2 = start > -b ? start : (end > -b ? -b : start),
		        end2 = end < PI - a ? end : (start < PI - a ? PI - a : end),
		        midEnd = 2 * PI - a;

		    // When slice goes over bottom middle, need to add both, left and right
		    // outer side. Additionally, when we cross right hand edge, create sharp
		    // edge. Outer shape/wall:
		    //
		    //            -------
		    //          /    ^    \
		    //    4)   /   /   \   \  1)
		    //        /   /     \   \
		    //       /   /       \   \
		    // (c)=> ====         ==== <=(d)
		    //       \   \       /   /
		    //        \   \<=(a)/   /
		    //         \   \   /   / <=(b)
		    //    3)    \    v    /  2)
		    //            -------
		    //
		    // (a) - inner side
		    // (b) - outer side
		    // (c) - left edge (sharp)
		    // (d) - right edge (sharp)
		    // 1..n - rendering order for startAngle = 0, when set to e.g 90, order
		    // changes clockwise (1->2, 2->3, n->1) and counterclockwise for negative
		    // startAngle

		    var out = ['M', cx + (rx * cos(start2)), cy + (ry * sin(start2))];
		    out = out.concat(curveTo(cx, cy, rx, ry, start2, end2, 0, 0));

		    // When shape is wide, it can cross both, (c) and (d) edges, when using
		    // startAngle
		    if (end > midEnd && start < midEnd) {
		        // Go to outer side
		        out = out.concat([
		            'L', cx + (rx * cos(end2)) + dx, cy + (ry * sin(end2)) + dy
		        ]);
		        // Curve to the right edge of the slice (d)
		        out = out.concat(curveTo(cx, cy, rx, ry, end2, midEnd, dx, dy));
		        // Go to the inner side
		        out = out.concat([
		            'L', cx + (rx * cos(midEnd)), cy + (ry * sin(midEnd))
		        ]);
		        // Curve to the true end of the slice
		        out = out.concat(curveTo(cx, cy, rx, ry, midEnd, end, 0, 0));
		        // Go to the outer side
		        out = out.concat([
		            'L', cx + (rx * cos(end)) + dx, cy + (ry * sin(end)) + dy
		        ]);
		        // Go back to middle (d)
		        out = out.concat(curveTo(cx, cy, rx, ry, end, midEnd, dx, dy));
		        out = out.concat([
		            'L', cx + (rx * cos(midEnd)), cy + (ry * sin(midEnd))
		        ]);
		        // Go back to the left edge
		        out = out.concat(curveTo(cx, cy, rx, ry, midEnd, end2, 0, 0));

		    // But shape can cross also only (c) edge:
		    } else if (end > PI - a && start < PI - a) {
		        // Go to outer side
		        out = out.concat([
		            'L',
		            cx + (rx * Math.cos(end2)) + dx,
		            cy + (ry * Math.sin(end2)) + dy
		        ]);
		        // Curve to the true end of the slice
		        out = out.concat(curveTo(cx, cy, rx, ry, end2, end, dx, dy));
		        // Go to the inner side
		        out = out.concat([
		            'L', cx + (rx * Math.cos(end)), cy + (ry * Math.sin(end))
		        ]);
		        // Go back to the artifical end2
		        out = out.concat(curveTo(cx, cy, rx, ry, end, end2, 0, 0));
		    }

		    out = out.concat([
		        'L', cx + (rx * Math.cos(end2)) + dx, cy + (ry * Math.sin(end2)) + dy
		    ]);
		    out = out.concat(curveTo(cx, cy, rx, ry, end2, start2, dx, dy));
		    out = out.concat(['Z']);

		    // INSIDE
		    var inn = ['M', cx + (irx * cs), cy + (iry * ss)];
		    inn = inn.concat(curveTo(cx, cy, irx, iry, start, end, 0, 0));
		    inn = inn.concat([
		        'L', cx + (irx * Math.cos(end)) + dx, cy + (iry * Math.sin(end)) + dy
		    ]);
		    inn = inn.concat(curveTo(cx, cy, irx, iry, end, start, dx, dy));
		    inn = inn.concat(['Z']);

		    // SIDES
		    var side1 = [
		        'M', cx + (rx * cs), cy + (ry * ss),
		        'L', cx + (rx * cs) + dx, cy + (ry * ss) + dy,
		        'L', cx + (irx * cs) + dx, cy + (iry * ss) + dy,
		        'L', cx + (irx * cs), cy + (iry * ss),
		        'Z'
		    ];
		    var side2 = [
		        'M', cx + (rx * ce), cy + (ry * se),
		        'L', cx + (rx * ce) + dx, cy + (ry * se) + dy,
		        'L', cx + (irx * ce) + dx, cy + (iry * se) + dy,
		        'L', cx + (irx * ce), cy + (iry * se),
		        'Z'
		    ];

		    // correction for changed position of vanishing point caused by alpha and
		    // beta rotations
		    var angleCorr = Math.atan2(dy, -dx),
		        angleEnd = Math.abs(end + angleCorr),
		        angleStart = Math.abs(start + angleCorr),
		        angleMid = Math.abs((start + end) / 2 + angleCorr);

		    // set to 0-PI range
		    function toZeroPIRange(angle) {
		        angle = angle % (2 * Math.PI);
		        if (angle > Math.PI) {
		            angle = 2 * Math.PI - angle;
		        }
		        return angle;
		    }
		    angleEnd = toZeroPIRange(angleEnd);
		    angleStart = toZeroPIRange(angleStart);
		    angleMid = toZeroPIRange(angleMid);

		    // *1e5 is to compensate pInt in zIndexSetter
		    var incPrecision = 1e5,
		        a1 = angleMid * incPrecision,
		        a2 = angleStart * incPrecision,
		        a3 = angleEnd * incPrecision;

		    return {
		        top: top,
		        // max angle is PI, so this is always higher
		        zTop: Math.PI * incPrecision + 1,
		        out: out,
		        zOut: Math.max(a1, a2, a3),
		        inn: inn,
		        zInn: Math.max(a1, a2, a3),
		        side1: side1,
		        zSide1: a3 * 0.99, // to keep below zOut and zInn in case of same values
		        side2: side2,
		        zSide2: a2 * 0.99
		    };
		};

	}(Highcharts));
	(function (H) {
		/**
		 * (c) 2010-2018 Torstein Honsi
		 *
		 * Extension for 3D charts
		 *
		 * License: www.highcharts.com/license
		 */
		var addEvent = H.addEvent,
		    Chart = H.Chart,
		    each = H.each,
		    merge = H.merge,
		    perspective = H.perspective,
		    pick = H.pick,
		    wrap = H.wrap;

		// Shorthand to check the is3d flag
		Chart.prototype.is3d = function () {
		    return (
		        this.options.chart.options3d &&
		        this.options.chart.options3d.enabled
		    ); // #4280
		};

		Chart.prototype.propsRequireDirtyBox.push('chart.options3d');
		Chart.prototype.propsRequireUpdateSeries.push('chart.options3d');

		// Legacy support for HC < 6 to make 'scatter' series in a 3D chart route to the
		// real 'scatter3d' series type.
		addEvent(Chart, 'afterInit', function () {
		    var options = this.options;

		    if (this.is3d()) {
		        each(options.series || [], function (s) {
		            var type = s.type ||
		                options.chart.type ||
		                options.chart.defaultSeriesType;
		            if (type === 'scatter') {
		                s.type = 'scatter3d';
		            }
		        });
		    }
		});
		// And do it on dynamic add (#8407)
		addEvent(Chart, 'addSeries', function (e) {
		    if (this.is3d()) {
		        if (e.options.type === 'scatter') {
		            e.options.type = 'scatter3d';
		        }
		    }
		});

		/**
		 * Calculate scale of the 3D view. That is required to
		 * fit chart's 3D projection into the actual plotting area. Reported as #4933.
		 * @notice This function should ideally take the plot values instead of a chart
		 *         object, but since the chart object is needed for perspective it is
		 *         not practical. Possible to make both getScale and perspective more
		 *         logical and also immutable.
		 * @param  {Object} chart Chart object
		 * @param  {Number} chart.plotLeft
		 * @param  {Number} chart.plotWidth
		 * @param  {Number} chart.plotTop
		 * @param  {Number} chart.plotHeight
		 * @param  {Number} depth The depth of the chart
		 * @return {Number} The scale to fit the 3D chart into the plotting area.
		 */
		function getScale(chart, depth) {
		    var plotLeft = chart.plotLeft,
		        plotRight = chart.plotWidth + plotLeft,
		        plotTop = chart.plotTop,
		        plotBottom = chart.plotHeight + plotTop,
		        originX = plotLeft + chart.plotWidth / 2,
		        originY = plotTop + chart.plotHeight / 2,
		        bbox3d = {
		            minX: Number.MAX_VALUE,
		            maxX: -Number.MAX_VALUE,
		            minY: Number.MAX_VALUE,
		            maxY: -Number.MAX_VALUE
		        },
		        corners,
		        scale = 1;

		    // Top left corners:
		    corners = [{
		        x: plotLeft,
		        y: plotTop,
		        z: 0
		    }, {
		        x: plotLeft,
		        y: plotTop,
		        z: depth
		    }];

		    // Top right corners:
		    each([0, 1], function (i) {
		        corners.push({
		            x: plotRight,
		            y: corners[i].y,
		            z: corners[i].z
		        });
		    });

		    // All bottom corners:
		    each([0, 1, 2, 3], function (i) {
		        corners.push({
		            x: corners[i].x,
		            y: plotBottom,
		            z: corners[i].z
		        });
		    });

		    // Calculate 3D corners:
		    corners = perspective(corners, chart, false);

		    // Get bounding box of 3D element:
		    each(corners, function (corner) {
		        bbox3d.minX = Math.min(bbox3d.minX, corner.x);
		        bbox3d.maxX = Math.max(bbox3d.maxX, corner.x);
		        bbox3d.minY = Math.min(bbox3d.minY, corner.y);
		        bbox3d.maxY = Math.max(bbox3d.maxY, corner.y);
		    });

		    // Left edge:
		    if (plotLeft > bbox3d.minX) {
		        scale = Math.min(
		            scale,
		            1 - Math.abs((plotLeft + originX) / (bbox3d.minX + originX)) % 1
		        );
		    }

		    // Right edge:
		    if (plotRight < bbox3d.maxX) {
		        scale = Math.min(
		            scale,
		            (plotRight - originX) / (bbox3d.maxX - originX)
		        );
		    }

		    // Top edge:
		    if (plotTop > bbox3d.minY) {
		        if (bbox3d.minY < 0) {
		            scale = Math.min(
		                scale,
		                (plotTop + originY) / (-bbox3d.minY + plotTop + originY)
		            );
		        } else {
		            scale = Math.min(
		                scale,
		                1 - (plotTop + originY) / (bbox3d.minY + originY) % 1
		            );
		        }
		    }

		    // Bottom edge:
		    if (plotBottom < bbox3d.maxY) {
		        scale = Math.min(
		            scale,
		            Math.abs((plotBottom - originY) / (bbox3d.maxY - originY))
		        );
		    }

		    return scale;
		}



		H.wrap(H.Chart.prototype, 'isInsidePlot', function (proceed) {
		    return this.is3d() || proceed.apply(this, [].slice.call(arguments, 1));
		});

		var defaultOptions = H.getOptions();

		/**
		 * @optionparent
		 */
		var extendedOptions = {

		    chart: {

		        /**
		         * Options to render charts in 3 dimensions. This feature requires
		         * `highcharts-3d.js`, found in the download package or online at
		         * [code.highcharts.com/highcharts-3d.js](http://code.highcharts.com/highcharts-
		         * 3d.js).
		         *
		         * @since 4.0
		         * @product highcharts
		         */
		        options3d: {

		            /**
		             * Wether to render the chart using the 3D functionality.
		             *
		             * @type {Boolean}
		             * @default false
		             * @since 4.0
		             * @product highcharts
		             */
		            enabled: false,

		            /**
		             * One of the two rotation angles for the chart.
		             *
		             * @type {Number}
		             * @default 0
		             * @since 4.0
		             * @product highcharts
		             */
		            alpha: 0,

		            /**
		             * One of the two rotation angles for the chart.
		             *
		             * @type {Number}
		             * @default 0
		             * @since 4.0
		             * @product highcharts
		             */
		            beta: 0,

		            /**
		             * The total depth of the chart.
		             *
		             * @type {Number}
		             * @default 100
		             * @since 4.0
		             * @product highcharts
		             */
		            depth: 100,

		            /**
		             * Whether the 3d box should automatically adjust to the chart plot
		             * area.
		             *
		             * @type {Boolean}
		             * @default true
		             * @since 4.2.4
		             * @product highcharts
		             */
		            fitToPlot: true,

		            /**
		             * Defines the distance the viewer is standing in front of the
		             * chart, this setting is important to calculate the perspective
		             * effect in column and scatter charts. It is not used for 3D pie
		             * charts.
		             *
		             * @type {Number}
		             * @default 100
		             * @since 4.0
		             * @product highcharts
		             */
		            viewDistance: 25,

		            /**
		             * Set it to `"auto"` to automatically move the labels to the best
		             * edge.
		             *
		             * @validvalue [null, "auto"]
		             * @type {String}
		             * @since 5.0.12
		             * @product highcharts
		             */
		            axisLabelPosition: null,

		            /**
		             * Provides the option to draw a frame around the charts by defining
		             * a bottom, front and back panel.
		             *
		             * @since 4.0
		             * @product highcharts
		             */
		            frame: {

		                /**
		                 * Whether the frames are visible.
		                 */
		                visible: 'default',

		                /**
		                 * General pixel thickness for the frame faces.
		                 */
		                size: 1,

		                /**
		                 * The bottom of the frame around a 3D chart.
		                 *
		                 * @since 4.0
		                 * @product highcharts
		                 */

		                /**
		                 * The color of the panel.
		                 *
		                 * @type {Color}
		                 * @default transparent
		                 * @since 4.0
		                 * @product highcharts
		                 * @apioption chart.options3d.frame.bottom.color
		                 */

		                /**
		                 * The thickness of the panel.
		                 *
		                 * @type {Number}
		                 * @default 1
		                 * @since 4.0
		                 * @product highcharts
		                 * @apioption chart.options3d.frame.bottom.size
		                 */

		                /**
		                 * Whether to display the frame. Possible values are `true`,
		                 * `false`, `"auto"` to display only the frames behind the data,
		                 * and `"default"` to display faces behind the data based on the
		                 * axis layout, ignoring the point of view.
		                 *
		                 * @validvalue ["default", "auto", true, false]
		                 * @type {Boolean|String}
		                 * @sample {highcharts} highcharts/3d/scatter-frame/ Auto frames
		                 * @default default
		                 * @since 5.0.12
		                 * @product highcharts
		                 * @apioption chart.options3d.frame.bottom.visible
		                 */

		                /**
		                 * The bottom of the frame around a 3D chart.
		                 */
		                bottom: {},

		                /**
		                 * The top of the frame around a 3D chart.
		                 *
		                 * @extends chart.options3d.frame.bottom
		                 */
		                top: {},

		                /**
		                 * The left side of the frame around a 3D chart.
		                 *
		                 * @extends chart.options3d.frame.bottom
		                 */
		                left: {},

		                /**
		                 * The right of the frame around a 3D chart.
		                 *
		                 * @extends chart.options3d.frame.bottom
		                 */
		                right: {},

		                /**
		                 * The back side of the frame around a 3D chart.
		                 *
		                 * @extends chart.options3d.frame.bottom
		                 */
		                back: {},

		                /**
		                 * The front of the frame around a 3D chart.
		                 *
		                 * @extends chart.options3d.frame.bottom
		                 */
		                front: {}
		            }
		        }
		    }
		};

		merge(true, defaultOptions, extendedOptions);



		wrap(Chart.prototype, 'setClassName', function (proceed) {
		    proceed.apply(this, [].slice.call(arguments, 1));

		    if (this.is3d()) {
		        this.container.className += ' highcharts-3d-chart';
		    }
		});

		addEvent(H.Chart, 'afterSetChartSize', function () {
		    var chart = this,
		        options3d = chart.options.chart.options3d;

		    if (chart.is3d()) {
		        var inverted = chart.inverted,
		            clipBox = chart.clipBox,
		            margin = chart.margin,
		            x = inverted ? 'y' : 'x',
		            y = inverted ? 'x' : 'y',
		            w = inverted ? 'height' : 'width',
		            h = inverted ? 'width' : 'height';

		        clipBox[x] = -(margin[3] || 0);
		        clipBox[y] = -(margin[0] || 0);
		        clipBox[w] = chart.chartWidth + (margin[3] || 0) + (margin[1] || 0);
		        clipBox[h] = chart.chartHeight + (margin[0] || 0) + (margin[2] || 0);

		        // Set scale, used later in perspective method():
		        // getScale uses perspective, so scale3d has to be reset.
		        chart.scale3d = 1;
		        if (options3d.fitToPlot === true) {
		            chart.scale3d = getScale(chart, options3d.depth);
		        }
		        // Recalculate the 3d frame with every call of setChartSize,
		        // instead of doing it after every redraw(). It avoids ticks
		        // and axis title outside of chart.
		        chart.frame3d = this.get3dFrame(); // #7942
		    }
		});

		addEvent(Chart, 'beforeRedraw', function () {
		    if (this.is3d()) {
		        // Set to force a redraw of all elements
		        this.isDirtyBox = true;
		    }
		});

		addEvent(Chart, 'beforeRender', function () {
		    if (this.is3d()) {
		        this.frame3d = this.get3dFrame();
		    }
		});

		// Draw the series in the reverse order (#3803, #3917)
		wrap(Chart.prototype, 'renderSeries', function (proceed) {
		    var series,
		        i = this.series.length;

		    if (this.is3d()) {
		        while (i--) {
		            series = this.series[i];
		            series.translate();
		            series.render();
		        }
		    } else {
		        proceed.call(this);
		    }
		});

		addEvent(Chart, 'afterDrawChartBox', function () {
		    if (this.is3d()) {
		        var chart = this,
		            renderer = chart.renderer,
		            options3d = this.options.chart.options3d,
		            frame = chart.get3dFrame(),
		            xm = this.plotLeft,
		            xp = this.plotLeft + this.plotWidth,
		            ym = this.plotTop,
		            yp = this.plotTop + this.plotHeight,
		            zm = 0,
		            zp = options3d.depth,
		            xmm = xm - (frame.left.visible ? frame.left.size : 0),
		            xpp = xp + (frame.right.visible ? frame.right.size : 0),
		            ymm = ym - (frame.top.visible ? frame.top.size : 0),
		            ypp = yp + (frame.bottom.visible ? frame.bottom.size : 0),
		            zmm = zm - (frame.front.visible ? frame.front.size : 0),
		            zpp = zp + (frame.back.visible ? frame.back.size : 0),
		            verb = chart.hasRendered ? 'animate' : 'attr';

		        this.frame3d = frame;

		        if (!this.frameShapes) {
		            this.frameShapes = {
		                bottom: renderer.polyhedron().add(),
		                top: renderer.polyhedron().add(),
		                left: renderer.polyhedron().add(),
		                right: renderer.polyhedron().add(),
		                back: renderer.polyhedron().add(),
		                front: renderer.polyhedron().add()
		            };
		        }
		        this.frameShapes.bottom[verb]({
		            'class': 'highcharts-3d-frame highcharts-3d-frame-bottom',
		            zIndex: frame.bottom.frontFacing ? -1000 : 1000,
		            faces: [{ // bottom
		                fill: H.color(frame.bottom.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xpp,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xpp,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xmm,
		                    y: ypp,
		                    z: zpp
		                }],
		                enabled: frame.bottom.visible
		            },
		            { // top
		                fill: H.color(frame.bottom.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xm,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zm
		                }],
		                enabled: frame.bottom.visible
		            },
		            { // left
		                fill: H.color(frame.bottom.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xmm,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zm
		                }],
		                enabled: frame.bottom.visible && !frame.left.visible
		            },
		            { // right
		                fill: H.color(frame.bottom.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xpp,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zp
		                }],
		                enabled: frame.bottom.visible && !frame.right.visible
		            },
		            { // front
		                fill: H.color(frame.bottom.color).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xmm,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zm
		                }],
		                enabled: frame.bottom.visible && !frame.front.visible
		            },
		            { // back
		                fill: H.color(frame.bottom.color).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xpp,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zp
		                }],
		                enabled: frame.bottom.visible && !frame.back.visible
		            }]
		        });
		        this.frameShapes.top[verb]({
		            'class': 'highcharts-3d-frame highcharts-3d-frame-top',
		            zIndex: frame.top.frontFacing ? -1000 : 1000,
		            faces: [{ // bottom
		                fill: H.color(frame.top.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zmm
		                }],
		                enabled: frame.top.visible
		            },
		            { // top
		                fill: H.color(frame.top.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xm,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zp
		                }],
		                enabled: frame.top.visible
		            },
		            { // left
		                fill: H.color(frame.top.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zp
		                }],
		                enabled: frame.top.visible && !frame.left.visible
		            },
		            { // right
		                fill: H.color(frame.top.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zm
		                }],
		                enabled: frame.top.visible && !frame.right.visible
		            },
		            { // front
		                fill: H.color(frame.top.color).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zm
		                }],
		                enabled: frame.top.visible && !frame.front.visible
		            },
		            { // back
		                fill: H.color(frame.top.color).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zp
		                }],
		                enabled: frame.top.visible && !frame.back.visible
		            }]
		        });
		        this.frameShapes.left[verb]({
		            'class': 'highcharts-3d-frame highcharts-3d-frame-left',
		            zIndex: frame.left.frontFacing ? -1000 : 1000,
		            faces: [{ // bottom
		                fill: H.color(frame.left.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xmm,
		                    y: ypp,
		                    z: zpp
		                }],
		                enabled: frame.left.visible && !frame.bottom.visible
		            },
		            { // top
		                fill: H.color(frame.left.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zmm
		                }],
		                enabled: frame.left.visible && !frame.top.visible
		            },
		            { // left
		                fill: H.color(frame.left.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xmm,
		                    y: ypp,
		                    z: zmm
		                }],
		                enabled: frame.left.visible
		            },
		            { // right
		                fill: H.color(frame.left.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xm,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zm
		                }],
		                enabled: frame.left.visible
		            },
		            { // front
		                fill: H.color(frame.left.color).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zm
		                }],
		                enabled: frame.left.visible && !frame.front.visible
		            },
		            { // back
		                fill: H.color(frame.left.color).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xmm,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zp
		                }],
		                enabled: frame.left.visible && !frame.back.visible
		            }]
		        });
		        this.frameShapes.right[verb]({
		            'class': 'highcharts-3d-frame highcharts-3d-frame-right',
		            zIndex: frame.right.frontFacing ? -1000 : 1000,
		            faces: [{ // bottom
		                fill: H.color(frame.right.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xpp,
		                    y: ypp,
		                    z: zmm
		                }],
		                enabled: frame.right.visible && !frame.bottom.visible
		            },
		            { // top
		                fill: H.color(frame.right.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zpp
		                }],
		                enabled: frame.right.visible && !frame.top.visible
		            },
		            { // left
		                fill: H.color(frame.right.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xp,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zp
		                }],
		                enabled: frame.right.visible
		            },
		            { // right
		                fill: H.color(frame.right.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xpp,
		                    y: ypp,
		                    z: zpp
		                }],
		                enabled: frame.right.visible
		            },
		            { // front
		                fill: H.color(frame.right.color).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xpp,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zm
		                }],
		                enabled: frame.right.visible && !frame.front.visible
		            },
		            { // back
		                fill: H.color(frame.right.color).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zp
		                }],
		                enabled: frame.right.visible && !frame.back.visible
		            }]
		        });
		        this.frameShapes.back[verb]({
		            'class': 'highcharts-3d-frame highcharts-3d-frame-back',
		            zIndex: frame.back.frontFacing ? -1000 : 1000,
		            faces: [{ // bottom
		                fill: H.color(frame.back.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xmm,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zp
		                }],
		                enabled: frame.back.visible && !frame.bottom.visible
		            },
		            { // top
		                fill: H.color(frame.back.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zp
		                }],
		                enabled: frame.back.visible && !frame.top.visible
		            },
		            { // left
		                fill: H.color(frame.back.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zp
		                }],
		                enabled: frame.back.visible && !frame.left.visible
		            },
		            { // right
		                fill: H.color(frame.back.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xpp,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zp
		                }],
		                enabled: frame.back.visible && !frame.right.visible
		            },
		            { // front
		                fill: H.color(frame.back.color).get(),
		                vertexes: [{
		                    x: xm,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zp
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zp
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zp
		                }],
		                enabled: frame.back.visible
		            },
		            { // back
		                fill: H.color(frame.back.color).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xpp,
		                    y: ypp,
		                    z: zpp
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zpp
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zpp
		                }],
		                enabled: frame.back.visible
		            }]
		        });
		        this.frameShapes.front[verb]({
		            'class': 'highcharts-3d-frame highcharts-3d-frame-front',
		            zIndex: frame.front.frontFacing ? -1000 : 1000,
		            faces: [{ // bottom
		                fill: H.color(frame.front.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xpp,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zm
		                }],
		                enabled: frame.front.visible && !frame.bottom.visible
		            },
		            { // top
		                fill: H.color(frame.front.color).brighten(0.1).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zm
		                }],
		                enabled: frame.front.visible && !frame.top.visible
		            },
		            { // left
		                fill: H.color(frame.front.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xmm,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xmm,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zm
		                }],
		                enabled: frame.front.visible && !frame.left.visible
		            },
		            { // right
		                fill: H.color(frame.front.color).brighten(-0.1).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xp,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zm
		                }],
		                enabled: frame.front.visible && !frame.right.visible
		            },
		            { // front
		                fill: H.color(frame.front.color).get(),
		                vertexes: [{
		                    x: xp,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xm,
		                    y: ym,
		                    z: zm
		                }, {
		                    x: xm,
		                    y: yp,
		                    z: zm
		                }, {
		                    x: xp,
		                    y: yp,
		                    z: zm
		                }],
		                enabled: frame.front.visible
		            },
		            { // back
		                fill: H.color(frame.front.color).get(),
		                vertexes: [{
		                    x: xpp,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xmm,
		                    y: ypp,
		                    z: zmm
		                }, {
		                    x: xmm,
		                    y: ymm,
		                    z: zmm
		                }, {
		                    x: xpp,
		                    y: ymm,
		                    z: zmm
		                }],
		                enabled: frame.front.visible
		            }]
		        });
		    }
		});

		Chart.prototype.retrieveStacks = function (stacking) {
		    var series = this.series,
		        stacks = {},
		        stackNumber,
		        i = 1;

		    each(this.series, function (s) {
		        stackNumber = pick(
		            s.options.stack,
		            (stacking ? 0 : series.length - 1 - s.index)
		        ); // #3841, #4532
		        if (!stacks[stackNumber]) {
		            stacks[stackNumber] = { series: [s], position: i };
		            i++;
		        } else {
		            stacks[stackNumber].series.push(s);
		        }
		    });

		    stacks.totalStacks = i + 1;
		    return stacks;
		};

		Chart.prototype.get3dFrame = function () {
		    var chart = this,
		        options3d = chart.options.chart.options3d,
		        frameOptions = options3d.frame,
		        xm = chart.plotLeft,
		        xp = chart.plotLeft + chart.plotWidth,
		        ym = chart.plotTop,
		        yp = chart.plotTop + chart.plotHeight,
		        zm = 0,
		        zp = options3d.depth,
		        faceOrientation = function (vertexes) {
		            var area = H.shapeArea3d(vertexes, chart);
		            // Give it 0.5 squared-pixel as a margin for rounding errors.
		            if (area > 0.5) {
		                return 1;
		            }
		            if (area < -0.5) {
		                return -1;
		            }
		            return 0;
		        },
		        bottomOrientation = faceOrientation([
		            { x: xm, y: yp, z: zp },
		            { x: xp, y: yp, z: zp },
		            { x: xp, y: yp, z: zm },
		            { x: xm, y: yp, z: zm }
		        ]),
		        topOrientation = faceOrientation([
		            { x: xm, y: ym, z: zm },
		            { x: xp, y: ym, z: zm },
		            { x: xp, y: ym, z: zp },
		            { x: xm, y: ym, z: zp }
		        ]),
		        leftOrientation = faceOrientation([
		            { x: xm, y: ym, z: zm },
		            { x: xm, y: ym, z: zp },
		            { x: xm, y: yp, z: zp },
		            { x: xm, y: yp, z: zm }
		        ]),
		        rightOrientation = faceOrientation([
		            { x: xp, y: ym, z: zp },
		            { x: xp, y: ym, z: zm },
		            { x: xp, y: yp, z: zm },
		            { x: xp, y: yp, z: zp }
		        ]),
		        frontOrientation = faceOrientation([
		            { x: xm, y: yp, z: zm },
		            { x: xp, y: yp, z: zm },
		            { x: xp, y: ym, z: zm },
		            { x: xm, y: ym, z: zm }
		        ]),
		        backOrientation = faceOrientation([
		            { x: xm, y: ym, z: zp },
		            { x: xp, y: ym, z: zp },
		            { x: xp, y: yp, z: zp },
		            { x: xm, y: yp, z: zp }
		        ]),
		        defaultShowBottom = false,
		        defaultShowTop = false,
		        defaultShowLeft = false,
		        defaultShowRight = false,
		        defaultShowFront = false,
		        defaultShowBack = true;

		    // The 'default' criteria to visible faces of the frame is looking up every
		    // axis to decide whenever the left/right//top/bottom sides of the frame
		    // will be shown
		    each([].concat(chart.xAxis, chart.yAxis, chart.zAxis), function (axis) {
		        if (axis) {
		            if (axis.horiz) {
		                if (axis.opposite) {
		                    defaultShowTop = true;
		                } else {
		                    defaultShowBottom = true;
		                }
		            } else {
		                if (axis.opposite) {
		                    defaultShowRight = true;
		                } else {
		                    defaultShowLeft = true;
		                }
		            }
		        }
		    });

		    var getFaceOptions = function (sources, faceOrientation, defaultVisible) {
		        var faceAttrs = ['size', 'color', 'visible'];
		        var options = {};
		        for (var i = 0; i < faceAttrs.length; i++) {
		            var attr = faceAttrs[i];
		            for (var j = 0; j < sources.length; j++) {
		                if (typeof sources[j] === 'object') {
		                    var val = sources[j][attr];
		                    if (val !== undefined && val !== null) {
		                        options[attr] = val;
		                        break;
		                    }
		                }
		            }
		        }
		        var isVisible = defaultVisible;
		        if (options.visible === true || options.visible === false) {
		            isVisible = options.visible;
		        } else if (options.visible === 'auto') {
		            isVisible = faceOrientation > 0;
		        }

		        return {
		            size: pick(options.size, 1),
		            color: pick(options.color, 'none'),
		            frontFacing: faceOrientation > 0,
		            visible: isVisible
		        };
		    };

		    // docs @TODO: Add all frame options (left, right, top, bottom, front, back)
		    // to apioptions JSDoc once the new system is up.
		    var ret = {
		        // FIXME: Previously, left/right, top/bottom and front/back pairs shared
		        // size and color.
		        // For compatibility and consistency sake, when one face have
		        // size/color/visibility set, the opposite face will default to the same
		        // values. Also, left/right used to be called 'side', so that's also
		        // added as a fallback
		        bottom: getFaceOptions(
		            [frameOptions.bottom, frameOptions.top, frameOptions],
		            bottomOrientation,
		            defaultShowBottom
		        ),
		        top: getFaceOptions(
		            [frameOptions.top, frameOptions.bottom, frameOptions],
		            topOrientation,
		            defaultShowTop
		        ),
		        left: getFaceOptions(
		            [
		                frameOptions.left,
		                frameOptions.right,
		                frameOptions.side,
		                frameOptions
		            ],
		            leftOrientation,
		            defaultShowLeft
		        ),
		        right: getFaceOptions(
		            [
		                frameOptions.right,
		                frameOptions.left,
		                frameOptions.side,
		                frameOptions
		            ],
		            rightOrientation,
		            defaultShowRight
		        ),
		        back: getFaceOptions(
		            [frameOptions.back, frameOptions.front, frameOptions],
		            backOrientation,
		            defaultShowBack
		        ),
		        front: getFaceOptions(
		            [frameOptions.front, frameOptions.back, frameOptions],
		            frontOrientation,
		            defaultShowFront
		        )
		    };


		    // Decide the bast place to put axis title/labels based on the visible
		    // faces. Ideally, The labels can only be on the edge between a visible face
		    // and an invisble one. Also, the Y label should be one the left-most edge
		    // (right-most if opposite),
		    if (options3d.axisLabelPosition === 'auto') {
		        var isValidEdge = function (face1, face2) {
		            return (
		                (face1.visible !== face2.visible) ||
		                (
		                    face1.visible &&
		                    face2.visible &&
		                    (face1.frontFacing !== face2.frontFacing)
		                )
		            );
		        };

		        var yEdges = [];
		        if (isValidEdge(ret.left, ret.front)) {
		            yEdges.push({
		                y: (ym + yp) / 2,
		                x: xm,
		                z: zm,
		                xDir: { x: 1, y: 0, z: 0 }
		            });
		        }
		        if (isValidEdge(ret.left, ret.back)) {
		            yEdges.push({
		                y: (ym + yp) / 2,
		                x: xm,
		                z: zp,
		                xDir: { x: 0, y: 0, z: -1 }
		            });
		        }
		        if (isValidEdge(ret.right, ret.front)) {
		            yEdges.push({
		                y: (ym + yp) / 2,
		                x: xp,
		                z: zm,
		                xDir: { x: 0, y: 0, z: 1 }
		            });
		        }
		        if (isValidEdge(ret.right, ret.back)) {
		            yEdges.push({
		                y: (ym + yp) / 2,
		                x: xp,
		                z: zp,
		                xDir: { x: -1, y: 0, z: 0 }
		            });
		        }

		        var xBottomEdges = [];
		        if (isValidEdge(ret.bottom, ret.front)) {
		            xBottomEdges.push({
		                x: (xm + xp) / 2,
		                y: yp,
		                z: zm,
		                xDir: { x: 1, y: 0, z: 0 }
		            });
		        }
		        if (isValidEdge(ret.bottom, ret.back)) {
		            xBottomEdges.push({
		                x: (xm + xp) / 2,
		                y: yp,
		                z: zp,
		                xDir: { x: -1, y: 0, z: 0 }
		            });
		        }

		        var xTopEdges = [];
		        if (isValidEdge(ret.top, ret.front)) {
		            xTopEdges.push({
		                x: (xm + xp) / 2,
		                y: ym,
		                z: zm,
		                xDir: { x: 1, y: 0, z: 0 }
		            });
		        }
		        if (isValidEdge(ret.top, ret.back)) {
		            xTopEdges.push({
		                x: (xm + xp) / 2,
		                y: ym,
		                z: zp,
		                xDir: { x: -1, y: 0, z: 0 }
		            });
		        }

		        var zBottomEdges = [];
		        if (isValidEdge(ret.bottom, ret.left)) {
		            zBottomEdges.push({
		                z: (zm + zp) / 2,
		                y: yp,
		                x: xm,
		                xDir: { x: 0, y: 0, z: -1 }
		            });
		        }
		        if (isValidEdge(ret.bottom, ret.right)) {
		            zBottomEdges.push({
		                z: (zm + zp) / 2,
		                y: yp,
		                x: xp,
		                xDir: { x: 0, y: 0, z: 1 }
		            });
		        }

		        var zTopEdges = [];
		        if (isValidEdge(ret.top, ret.left)) {
		            zTopEdges.push({
		                z: (zm + zp) / 2,
		                y: ym,
		                x: xm,
		                xDir: { x: 0, y: 0, z: -1 }
		            });
		        }
		        if (isValidEdge(ret.top, ret.right)) {
		            zTopEdges.push({
		                z: (zm + zp) / 2,
		                y: ym,
		                x: xp,
		                xDir: { x: 0, y: 0, z: 1 }
		            });
		        }

		        var pickEdge = function (edges, axis, mult) {
		            if (edges.length === 0) {
		                return null;
		            } else if (edges.length === 1) {
		                return edges[0];
		            }
		            var best = 0,
		                projections = perspective(edges, chart, false);
		            for (var i = 1; i < projections.length; i++) {
		                if (
		                    mult * projections[i][axis] >
		                    mult * projections[best][axis]
		                ) {
		                    best = i;
		                } else if (
		                    (
		                        mult * projections[i][axis] ===
		                        mult * projections[best][axis]
		                    ) &&
		                    (projections[i].z < projections[best].z)
		                ) {
		                    best = i;
		                }
		            }
		            return edges[best];
		        };
		        ret.axes = {
		            y: {
		                'left': pickEdge(yEdges, 'x', -1),
		                'right': pickEdge(yEdges, 'x', +1)
		            },
		            x: {
		                'top': pickEdge(xTopEdges, 'y', -1),
		                'bottom': pickEdge(xBottomEdges, 'y', +1)
		            },
		            z: {
		                'top': pickEdge(zTopEdges, 'y', -1),
		                'bottom': pickEdge(zBottomEdges, 'y', +1)
		            }
		        };
		    } else {
		        ret.axes = {
		            y: {
		                'left': { x: xm, z: zm, xDir: { x: 1, y: 0, z: 0 } },
		                'right': { x: xp, z: zm, xDir: { x: 0, y: 0, z: 1 } }
		            },
		            x: {
		                'top': { y: ym, z: zm, xDir: { x: 1, y: 0, z: 0 } },
		                'bottom': { y: yp, z: zm, xDir: { x: 1, y: 0, z: 0 } }
		            },
		            z: {
		                'top': {
		                    x: defaultShowLeft ? xp : xm,
		                    y: ym,
		                    xDir: defaultShowLeft ?
		                        { x: 0, y: 0, z: 1 } :
		                        { x: 0, y: 0, z: -1 }
		                },
		                'bottom': {
		                    x: defaultShowLeft ? xp : xm,
		                    y: yp,
		                    xDir: defaultShowLeft ?
		                        { x: 0, y: 0, z: 1 } :
		                        { x: 0, y: 0, z: -1 }
		                }
		            }
		        };
		    }

		    return ret;
		};

		/**
		 * Animation setter for matrix property.
		 */
		H.Fx.prototype.matrixSetter = function () {
		    var interpolated;
		    if (this.pos < 1 &&
		            (H.isArray(this.start) || H.isArray(this.end))) {
		        var start = this.start || [ 1, 0, 0, 1, 0, 0];
		        var end = this.end || [ 1, 0, 0, 1, 0, 0];
		        interpolated = [];
		        for (var i = 0; i < 6; i++) {
		            interpolated.push(this.pos * end[i] + (1 - this.pos) * start[i]);
		        }
		    } else {
		        interpolated = this.end;
		    }

		    this.elem.attr(
		        this.prop,
		        interpolated,
		        null,
		        true
		    );
		};

		/**
		 * Note: As of v5.0.12, `frame.left` or `frame.right` should be used
		 * instead.
		 *
		 * The side for the frame around a 3D chart.
		 *
		 * @since 4.0
		 * @product highcharts
		 * @apioption chart.options3d.frame.side
		 */

		/**
		 * The color of the panel.
		 *
		 * @type {Color}
		 * @default transparent
		 * @since 4.0
		 * @product highcharts
		 * @apioption chart.options3d.frame.side.color
		 */

		/**
		 * The thickness of the panel.
		 *
		 * @type {Number}
		 * @default 1
		 * @since 4.0
		 * @product highcharts
		 * @apioption chart.options3d.frame.side.size
		 */


	}(Highcharts));
	(function (H) {
		/**
		 * (c) 2010-2018 Torstein Honsi
		 *
		 * Extenstion for 3d axes
		 *
		 * License: www.highcharts.com/license
		 */
		var ZAxis,

		    addEvent = H.addEvent,
		    Axis = H.Axis,
		    Chart = H.Chart,
		    deg2rad = H.deg2rad,
		    each = H.each,
		    extend = H.extend,
		    merge = H.merge,
		    perspective = H.perspective,
		    perspective3D = H.perspective3D,
		    pick = H.pick,
		    shapeArea = H.shapeArea,
		    splat = H.splat,
		    Tick = H.Tick,
		    wrap = H.wrap;

		/**
		 * @optionparent xAxis
		 */
		var extendedOptions = {
		    labels: {
		        /**
		         * Defines how the labels are be repositioned according to the 3D chart
		         * orientation.
		         * - `'offset'`: Maintain a fixed horizontal/vertical distance from the
		         *      tick marks, despite the chart orientation. This is the backwards
		         *      compatible behavior, and causes skewing of X and Z axes.
		         * - `'chart'`: Preserve 3D position relative to the chart.
		         *   This looks nice, but hard to read if the text isn't
		         *   forward-facing.
		         * - `'flap'`: Rotated text along the axis to compensate for the chart
		         *      orientation. This tries to maintain text as legible as possible
		         *      on all orientations.
		         * - `'ortho'`: Rotated text along the axis direction so that the labels
		         *      are orthogonal to the axis. This is very similar to `'flap'`,
		         *      but prevents skewing the labels (X and Y scaling are still
		         *      present).
		         *
		         * @validvalue ['offset', 'chart', 'flap', 'ortho']
		         * @sample highcharts/3d/skewed-labels/ Skewed labels
		         * @since 5.0.15
		         * @product highcharts
		         */
		        position3d: 'offset',

		        /**
		         * If enabled, the axis labels will skewed to follow the perspective.
		         *
		         * This will fix overlapping labels and titles, but texts become less
		         * legible due to the distortion.
		         *
		         * The final appearance depends heavily on `labels.position3d`.
		         *
		         * @since 5.0.15
		         * @sample highcharts/3d/skewed-labels/ Skewed labels
		         * @product highcharts
		         */
		        skew3d: false
		    },
		    title: {
		        /**
		         * Defines how the title is repositioned according to the 3D chart
		         * orientation.
		         * - `'offset'`: Maintain a fixed horizontal/vertical distance from the
		         *   tick marks, despite the chart orientation. This is the backwards
		         *   compatible behavior, and causes skewing of X and Z axes.
		         * - `'chart'`: Preserve 3D position relative to the chart.
		         *   This looks nice, but hard to read if the text isn't
		         *   forward-facing.
		         * - `'flap'`: Rotated text along the axis to compensate for the chart
		         *   orientation. This tries to maintain text as legible as possible on
		         *   all orientations.
		         * - `'ortho'`: Rotated text along the axis direction so that the labels
		         *   are orthogonal to the axis. This is very similar to `'flap'`, but
		         *   prevents skewing the labels (X and Y scaling are still present).
		         * - `null`: Will use the config from `labels.position3d`
		         *
		         * @validvalue ['offset', 'chart', 'flap', 'ortho', null]
		         * @type {String}
		         * @since 5.0.15
		         * @sample highcharts/3d/skewed-labels/ Skewed labels
		         * @product highcharts
		         */
		        position3d: null,

		        /**
		         * If enabled, the axis title will skewed to follow the perspective.
		         *
		          * This will fix overlapping labels and titles, but texts become less
		          * legible due to the distortion.
		         *
		         * The final appearance depends heavily on `title.position3d`.
		         *
		         * A `null` value will use the config from `labels.skew3d`.
		         *
		         * @validvalue [false, true, null]
		         * @type {Boolean}
		         * @sample highcharts/3d/skewed-labels/ Skewed labels
		         * @since 5.0.15
		         * @product highcharts
		         */
		        skew3d: null
		    }
		};

		merge(true, Axis.prototype.defaultOptions, extendedOptions);


		addEvent(Axis, 'afterSetOptions', function () {
		    var options;
		    if (this.chart.is3d && this.chart.is3d() && this.coll !== 'colorAxis') {
		        options = this.options;
		        options.tickWidth = pick(options.tickWidth, 0);
		        options.gridLineWidth = pick(options.gridLineWidth, 1);
		    }
		});

		wrap(Axis.prototype, 'getPlotLinePath', function (proceed) {
		    var path = proceed.apply(this, [].slice.call(arguments, 1));

		    // Do not do this if the chart is not 3D
		    if (!this.chart.is3d() || this.coll === 'colorAxis') {
		        return path;
		    }

		    if (path === null) {
		        return path;
		    }

		    var chart = this.chart,
		        options3d = chart.options.chart.options3d,
		        d = this.isZAxis ? chart.plotWidth : options3d.depth,
		        frame = chart.frame3d;

		    var pArr = [
		        this.swapZ({ x: path[1], y: path[2], z: 0 }),
		        this.swapZ({ x: path[1], y: path[2], z: d }),
		        this.swapZ({ x: path[4], y: path[5], z: 0 }),
		        this.swapZ({ x: path[4], y: path[5], z: d })
		    ];

		    var pathSegments = [];
		    if (!this.horiz) {  // Y-Axis
		        if (frame.front.visible) {
		            pathSegments.push(pArr[0], pArr[2]);
		        }
		        if (frame.back.visible) {
		            pathSegments.push(pArr[1], pArr[3]);
		        }
		        if (frame.left.visible) {
		            pathSegments.push(pArr[0], pArr[1]);
		        }
		        if (frame.right.visible) {
		            pathSegments.push(pArr[2], pArr[3]);
		        }
		    } else if (this.isZAxis) {  // Z-Axis
		        if (frame.left.visible) {
		            pathSegments.push(pArr[0], pArr[2]);
		        }
		        if (frame.right.visible) {
		            pathSegments.push(pArr[1], pArr[3]);
		        }
		        if (frame.top.visible) {
		            pathSegments.push(pArr[0], pArr[1]);
		        }
		        if (frame.bottom.visible) {
		            pathSegments.push(pArr[2], pArr[3]);
		        }
		    } else {  // X-Axis
		        if (frame.front.visible) {
		            pathSegments.push(pArr[0], pArr[2]);
		        }
		        if (frame.back.visible) {
		            pathSegments.push(pArr[1], pArr[3]);
		        }
		        if (frame.top.visible) {
		            pathSegments.push(pArr[0], pArr[1]);
		        }
		        if (frame.bottom.visible) {
		            pathSegments.push(pArr[2], pArr[3]);
		        }
		    }

		    pathSegments = perspective(pathSegments, this.chart, false);

		    return this.chart.renderer.toLineSegments(pathSegments);
		});

		// Do not draw axislines in 3D
		wrap(Axis.prototype, 'getLinePath', function (proceed) {
		    // Do not do this if the chart is not 3D
		    if (!this.chart.is3d() || this.coll === 'colorAxis') {
		        return proceed.apply(this, [].slice.call(arguments, 1));
		    }

		    return [];
		});

		wrap(Axis.prototype, 'getPlotBandPath', function (proceed) {
		    // Do not do this if the chart is not 3D
		    if (!this.chart.is3d() || this.coll === 'colorAxis') {
		        return proceed.apply(this, [].slice.call(arguments, 1));
		    }

		    var args = arguments,
		        from = args[1],
		        to = args[2],
		        path = [],
		        fromPath = this.getPlotLinePath(from),
		        toPath = this.getPlotLinePath(to);

		    if (fromPath && toPath) {
		        for (var i = 0; i < fromPath.length; i += 6) {
		            path.push(
		                'M', fromPath[i + 1], fromPath[i + 2],
		                'L', fromPath[i + 4], fromPath[i + 5],
		                'L', toPath[i + 4], toPath[i + 5],
		                'L', toPath[i + 1], toPath[i + 2],
		                'Z');
		        }
		    }

		    return path;
		});


		function fix3dPosition(axis, pos, isTitle) {
		    // Do not do this if the chart is not 3D
		    if (!axis.chart.is3d() || axis.coll === 'colorAxis') {
		        return pos;
		    }

		    var chart = axis.chart,
		        alpha = deg2rad * chart.options.chart.options3d.alpha,
		        beta = deg2rad * chart.options.chart.options3d.beta,
		        positionMode = pick(
		            isTitle && axis.options.title.position3d,
		            axis.options.labels.position3d
		        ),
		        skew = pick(
		            isTitle && axis.options.title.skew3d,
		            axis.options.labels.skew3d
		        ),
		        frame = chart.frame3d,
		        plotLeft = chart.plotLeft,
		        plotRight = chart.plotWidth + plotLeft,
		        plotTop = chart.plotTop,
		        plotBottom = chart.plotHeight + plotTop,
		        // Indicates we are labelling an X or Z axis on the "back" of the chart
		        reverseFlap = false,
		        offsetX = 0,
		        offsetY = 0,
		        vecX,
		        vecY = { x: 0, y: 1, z: 0 };

		    pos = axis.swapZ({ x: pos.x, y: pos.y, z: 0 });


		    if (axis.isZAxis) {  // Z Axis
		        if (axis.opposite) {
		            if (frame.axes.z.top === null) {
		                return {};
		            }
		            offsetY = pos.y - plotTop;
		            pos.x = frame.axes.z.top.x;
		            pos.y = frame.axes.z.top.y;
		            vecX = frame.axes.z.top.xDir;
		            reverseFlap = !frame.top.frontFacing;
		        } else {
		            if (frame.axes.z.bottom === null) {
		                return {};
		            }
		            offsetY = pos.y - plotBottom;
		            pos.x = frame.axes.z.bottom.x;
		            pos.y = frame.axes.z.bottom.y;
		            vecX = frame.axes.z.bottom.xDir;
		            reverseFlap = !frame.bottom.frontFacing;
		        }
		    } else if (axis.horiz) {  // X Axis
		        if (axis.opposite) {
		            if (frame.axes.x.top === null) {
		                return {};
		            }
		            offsetY = pos.y - plotTop;
		            pos.y = frame.axes.x.top.y;
		            pos.z = frame.axes.x.top.z;
		            vecX = frame.axes.x.top.xDir;
		            reverseFlap = !frame.top.frontFacing;
		        } else {
		            if (frame.axes.x.bottom === null) {
		                return {};
		            }
		            offsetY = pos.y - plotBottom;
		            pos.y = frame.axes.x.bottom.y;
		            pos.z = frame.axes.x.bottom.z;
		            vecX = frame.axes.x.bottom.xDir;
		            reverseFlap = !frame.bottom.frontFacing;
		        }
		    } else {  // Y Axis
		        if (axis.opposite) {
		            if (frame.axes.y.right === null) {
		                return {};
		            }
		            offsetX = pos.x - plotRight;
		            pos.x = frame.axes.y.right.x;
		            pos.z = frame.axes.y.right.z;
		            vecX = frame.axes.y.right.xDir;
		            // Rotate 90º on opposite edge
		            vecX = { x: vecX.z, y: vecX.y, z: -vecX.x };
		        } else {
		            if (frame.axes.y.left === null) {
		                return {};
		            }
		            offsetX = pos.x - plotLeft;
		            pos.x = frame.axes.y.left.x;
		            pos.z = frame.axes.y.left.z;
		            vecX = frame.axes.y.left.xDir;
		        }
		    }

		    if (positionMode === 'chart') {
		        // Labels preserve their direction relative to the chart
		        // nothing to do

		    } else if (positionMode === 'flap') {
		        // Labels are be rotated around the axis direction to face the screen
		        if (!axis.horiz) {  // Y Axis
		            vecX = { x: Math.cos(beta), y: 0, z: Math.sin(beta) };
		        } else {  // X and Z Axis
		            var sin = Math.sin(alpha);
		            var cos = Math.cos(alpha);
		            if (axis.opposite) {
		                sin = -sin;
		            }
		            if (reverseFlap) {
		                sin = -sin;
		            }
		            vecY = { x: vecX.z * sin, y: cos, z: -vecX.x * sin };
		        }
		    } else if (positionMode === 'ortho') {
		        // Labels will be rotated to be ortogonal to the axis
		        if (!axis.horiz) {  // Y Axis
		            vecX = { x: Math.cos(beta), y: 0, z: Math.sin(beta) };
		        } else {  // X and Z Axis
		            var sina = Math.sin(alpha);
		            var cosa = Math.cos(alpha);
		            var sinb = Math.sin(beta);
		            var cosb = Math.cos(beta);
		            var vecZ = { x: sinb * cosa, y: -sina, z: -cosa * cosb };
		            vecY = {
		                x: vecX.y * vecZ.z - vecX.z * vecZ.y,
		                y: vecX.z * vecZ.x - vecX.x * vecZ.z,
		                z: vecX.x * vecZ.y - vecX.y * vecZ.x
		            };
		            var scale = 1 / Math.sqrt(
		                vecY.x * vecY.x + vecY.y * vecY.y + vecY.z * vecY.z
		            );
		            if (reverseFlap) {
		                scale = -scale;
		            }
		            vecY = { x: scale * vecY.x, y: scale * vecY.y, z: scale * vecY.z };
		        }
		    } else {  // positionMode  == 'offset'
		        // Labels will be skewd to maintain vertical / horizontal offsets from
		        // axis
		        if (!axis.horiz) {  // Y Axis
		            vecX = { x: Math.cos(beta), y: 0, z: Math.sin(beta) };
		        } else {  // X and Z Axis
		            vecY = {
		                x: Math.sin(beta) * Math.sin(alpha),
		                y: Math.cos(alpha),
		                z: -Math.cos(beta) * Math.sin(alpha)
		            };
		        }
		    }
		    pos.x += offsetX * vecX.x + offsetY * vecY.x;
		    pos.y += offsetX * vecX.y + offsetY * vecY.y;
		    pos.z += offsetX * vecX.z + offsetY * vecY.z;

		    var projected = perspective([pos], axis.chart)[0];

		    if (skew) {
		        // Check if the label text would be mirrored
		        var isMirrored = shapeArea(perspective([
		            pos,
		            { x: pos.x + vecX.x, y: pos.y + vecX.y, z: pos.z + vecX.z },
		            { x: pos.x + vecY.x, y: pos.y + vecY.y, z: pos.z + vecY.z }
		        ], axis.chart)) < 0;
		        if (isMirrored) {
		            vecX = { x: -vecX.x, y: -vecX.y, z: -vecX.z };
		        }

		        var pointsProjected = perspective([
		            { x: pos.x, y: pos.y, z: pos.z },
		            { x: pos.x + vecX.x, y: pos.y + vecX.y, z: pos.z + vecX.z },
		            { x: pos.x + vecY.x, y: pos.y + vecY.y, z: pos.z + vecY.z }
		        ], axis.chart);

		        projected.matrix = [
		            pointsProjected[1].x - pointsProjected[0].x,
		            pointsProjected[1].y - pointsProjected[0].y,
		            pointsProjected[2].x - pointsProjected[0].x,
		            pointsProjected[2].y - pointsProjected[0].y,
		            projected.x,
		            projected.y
		        ];
		        projected.matrix[4] -= projected.x * projected.matrix[0] +
		            projected.y * projected.matrix[2];
		        projected.matrix[5] -= projected.x * projected.matrix[1] +
		            projected.y * projected.matrix[3];
		    }

		    return projected;
		}

		/*
		Tick extensions
		 */
		wrap(Tick.prototype, 'getMarkPath', function (proceed) {
		    var path = proceed.apply(this, [].slice.call(arguments, 1));

		    var pArr = [
		        fix3dPosition(this.axis, { x: path[1], y: path[2], z: 0 }),
		        fix3dPosition(this.axis, { x: path[4], y: path[5], z: 0 })
		    ];

		    return this.axis.chart.renderer.toLineSegments(pArr);
		});

		addEvent(Tick, 'afterGetLabelPosition', function (e) {
		    extend(e.pos, fix3dPosition(this.axis, e.pos));
		});

		wrap(Axis.prototype, 'getTitlePosition', function (proceed) {
		    var pos = proceed.apply(this, [].slice.call(arguments, 1));
		    return fix3dPosition(this, pos, true);
		});

		addEvent(Axis, 'drawCrosshair', function (e) {
		    if (this.chart.is3d() && this.coll !== 'colorAxis') {
		        if (e.point) {
		            e.point.crosshairPos = this.isXAxis ?
		                e.point.axisXpos :
		                this.len - (e.point.axisYpos);
		        }
		    }
		});

		addEvent(Axis, 'destroy', function () {
		    each(['backFrame', 'bottomFrame', 'sideFrame'], function (prop) {
		        if (this[prop]) {
		            this[prop] = this[prop].destroy();
		        }
		    }, this);
		});

		/*
		Z-AXIS
		*/

		Axis.prototype.swapZ = function (p, insidePlotArea) {
		    if (this.isZAxis) {
		        var plotLeft = insidePlotArea ? 0 : this.chart.plotLeft;
		        return {
		            x: plotLeft + p.z,
		            y: p.y,
		            z: p.x - plotLeft
		        };
		    }
		    return p;
		};

		ZAxis = H.ZAxis = function () {
		    this.init.apply(this, arguments);
		};
		extend(ZAxis.prototype, Axis.prototype);
		extend(ZAxis.prototype, {
		    isZAxis: true,
		    setOptions: function (userOptions) {
		        userOptions = merge({
		            offset: 0,
		            lineWidth: 0
		        }, userOptions);
		        Axis.prototype.setOptions.call(this, userOptions);
		        this.coll = 'zAxis';
		    },
		    setAxisSize: function () {
		        Axis.prototype.setAxisSize.call(this);
		        this.width = this.len = this.chart.options.chart.options3d.depth;
		        this.right = this.chart.chartWidth - this.width - this.left;
		    },
		    getSeriesExtremes: function () {
		        var axis = this,
		            chart = axis.chart;

		        axis.hasVisibleSeries = false;

		        // Reset properties in case we're redrawing (#3353)
		        axis.dataMin =
		            axis.dataMax =
		            axis.ignoreMinPadding =
		            axis.ignoreMaxPadding = null;

		        if (axis.buildStacks) {
		            axis.buildStacks();
		        }

		        // loop through this axis' series
		        each(axis.series, function (series) {

		            if (series.visible || !chart.options.chart.ignoreHiddenSeries) {

		                var seriesOptions = series.options,
		                    zData,
		                    threshold = seriesOptions.threshold;

		                axis.hasVisibleSeries = true;

		                // Validate threshold in logarithmic axes
		                if (axis.positiveValuesOnly && threshold <= 0) {
		                    threshold = null;
		                }

		                zData = series.zData;
		                if (zData.length) {
		                    axis.dataMin = Math.min(
		                        pick(axis.dataMin, zData[0]),
		                        Math.min.apply(null, zData)
		                    );
		                    axis.dataMax = Math.max(
		                        pick(axis.dataMax, zData[0]),
		                        Math.max.apply(null, zData)
		                    );
		                }
		            }
		        });
		    }
		});


		/**
		* Get the Z axis in addition to the default X and Y.
		*/
		addEvent(Chart, 'afterGetAxes', function () {
		    var chart = this,
		        options = this.options,
		        zAxisOptions = options.zAxis = splat(options.zAxis || {});

		    if (!chart.is3d()) {
		        return;
		    }
		    this.zAxis = [];
		    each(zAxisOptions, function (axisOptions, i) {
		        axisOptions.index = i;
		        // Z-Axis is shown horizontally, so it's kind of a X-Axis
		        axisOptions.isX = true;
		        var zAxis = new ZAxis(chart, axisOptions);
		        zAxis.setScale();
		    });
		});
		/**
		 * Wrap getSlotWidth function to calculate individual width value
		 * for each slot (#8042).
		 */
		wrap(Axis.prototype, 'getSlotWidth', function (proceed, tick) {
		    if (this.chart.is3d() &&
		        tick &&
		        tick.label &&
		        this.categories &&
		        this.chart.frameShapes
		    ) {
		        var chart = this.chart,
		            ticks = this.ticks,
		            gridGroup = this.gridGroup.element.childNodes,
		            firstGridLine = gridGroup[0].getBBox(),
		            frame3DLeft = chart.frameShapes.left.getBBox(),
		            options3d = chart.options.chart.options3d,
		            origin = {
		                x: chart.plotWidth / 2,
		                y: chart.plotHeight / 2,
		                z: options3d.depth / 2,
		                vd: pick(options3d.depth, 1) * pick(options3d.viewDistance, 0)
		            },
		            labelPos,
		            prevLabelPos,
		            nextLabelPos,
		            slotWidth,
		            tickId = tick.pos,
		            prevTick = ticks[tickId - 1],
		            nextTick = ticks[tickId + 1];

		        // Check whether the tick is not the first one and previous tick exists,
		        // then calculate position of previous label.
		        if (tickId !== 0 && prevTick && prevTick.label.xy) { // #8621
		            prevLabelPos = perspective3D({
		                x: prevTick.label.xy.x,
		                y: prevTick.label.xy.y,
		                z: null
		            }, origin, origin.vd);
		        }
		        // If next label position is defined, then recalculate its position
		        // basing on the perspective.
		        if (nextTick && nextTick.label.xy) {
		            nextLabelPos = perspective3D({
		                x: nextTick.label.xy.x,
		                y: nextTick.label.xy.y,
		                z: null
		            }, origin, origin.vd);
		        }
		        labelPos = {
		            x: tick.label.xy.x,
		            y: tick.label.xy.y,
		            z: null
		        };

		        labelPos = perspective3D(labelPos, origin, origin.vd);

		        // If tick is first one, check whether next label position is already
		        // calculated, then return difference between the first and the second
		        // label. If there is no next label position calculated, return the
		        // difference between the first grid line and left 3d frame.
		        slotWidth = Math.abs(prevLabelPos ?
		            labelPos.x - prevLabelPos.x : nextLabelPos ?
		                nextLabelPos.x - labelPos.x : firstGridLine.x - frame3DLeft.x
		        );
		        return slotWidth;
		    }
		    return proceed.apply(this, [].slice.call(arguments, 1));
		});

	}(Highcharts));
	(function (H) {
		/**
		 * (c) 2010-2018 Torstein Honsi
		 *
		 * Extension to the Series object in 3D charts.
		 *
		 * License: www.highcharts.com/license
		 */
		var addEvent = H.addEvent,
		    perspective = H.perspective,
		    pick = H.pick;

		// Wrap the translate method to post-translate points into 3D perspective
		addEvent(H.Series, 'afterTranslate', function () {
		    if (this.chart.is3d()) {
		        this.translate3dPoints();
		    }
		});

		/**
		 * Translate the plotX, plotY properties and add plotZ.
		 */
		H.Series.prototype.translate3dPoints = function () {
		    var series = this,
		        chart = series.chart,
		        zAxis = pick(series.zAxis, chart.options.zAxis[0]),
		        rawPoints = [],
		        rawPoint,
		        projectedPoints,
		        projectedPoint,
		        zValue,
		        i;

		    for (i = 0; i < series.data.length; i++) {
		        rawPoint = series.data[i];

		        if (zAxis && zAxis.translate) {
		            zValue = zAxis.isLog && zAxis.val2lin ?
		                zAxis.val2lin(rawPoint.z) :
		                rawPoint.z; // #4562
		            rawPoint.plotZ = zAxis.translate(zValue);
		            rawPoint.isInside = rawPoint.isInside ?
		                (zValue >= zAxis.min && zValue <= zAxis.max) :
		                false;
		        } else {
		            rawPoint.plotZ = 0;
		        }

		        rawPoint.axisXpos = rawPoint.plotX;
		        rawPoint.axisYpos = rawPoint.plotY;
		        rawPoint.axisZpos = rawPoint.plotZ;

		        rawPoints.push({
		            x: rawPoint.plotX,
		            y: rawPoint.plotY,
		            z: rawPoint.plotZ
		        });
		    }

		    projectedPoints = perspective(rawPoints, chart, true);

		    for (i = 0; i < series.data.length; i++) {
		        rawPoint = series.data[i];
		        projectedPoint = projectedPoints[i];

		        rawPoint.plotX = projectedPoint.x;
		        rawPoint.plotY = projectedPoint.y;
		        rawPoint.plotZ = projectedPoint.z;
		    }
		};


	}(Highcharts));
	(function (H) {
		/**
		 * (c) 2010-2018 Torstein Honsi
		 *
		 * License: www.highcharts.com/license
		 */
		var addEvent = H.addEvent,
		    each = H.each,
		    perspective = H.perspective,
		    pick = H.pick,
		    Series = H.Series,
		    seriesTypes = H.seriesTypes,
		    inArray = H.inArray,
		    svg = H.svg,
		    wrap = H.wrap;



		/**
		 * Depth of the columns in a 3D column chart. Requires `highcharts-3d.js`.
		 *
		 * @type {Number}
		 * @default 25
		 * @since 4.0
		 * @product highcharts
		 * @apioption plotOptions.column.depth
		 */

		/**
		 * 3D columns only. The color of the edges. Similar to `borderColor`,
		 *  except it defaults to the same color as the column.
		 *
		 * @type {Color}
		 * @product highcharts
		 * @apioption plotOptions.column.edgeColor
		 */

		/**
		 * 3D columns only. The width of the colored edges.
		 *
		 * @type {Number}
		 * @default 1
		 * @product highcharts
		 * @apioption plotOptions.column.edgeWidth
		 */

		/**
		 * The spacing between columns on the Z Axis in a 3D chart. Requires
		 * `highcharts-3d.js`.
		 *
		 * @type {Number}
		 * @default 1
		 * @since 4.0
		 * @product highcharts
		 * @apioption plotOptions.column.groupZPadding
		 */

		wrap(seriesTypes.column.prototype, 'translate', function (proceed) {
		    proceed.apply(this, [].slice.call(arguments, 1));

		    // Do not do this if the chart is not 3D
		    if (this.chart.is3d()) {
		        this.translate3dShapes();
		    }
		});

		// In 3D we need to pass point.outsidePlot option to the justifyDataLabel
		// method for disabling justifying dataLabels in columns outside plot
		wrap(H.Series.prototype, 'alignDataLabel', function (proceed) {
		    arguments[3].outside3dPlot = arguments[1].outside3dPlot;
		    proceed.apply(this, [].slice.call(arguments, 1));
		});

		// Don't use justifyDataLabel when point is outsidePlot
		wrap(H.Series.prototype, 'justifyDataLabel', function (proceed) {
		    return !(arguments[2].outside3dPlot) ?
		        proceed.apply(this, [].slice.call(arguments, 1)) :
		        false;
		});

		seriesTypes.column.prototype.translate3dPoints = function () {};
		seriesTypes.column.prototype.translate3dShapes = function () {

		    var series = this,
		        chart = series.chart,
		        seriesOptions = series.options,
		        depth = seriesOptions.depth || 25,
		        stack = seriesOptions.stacking ?
		            (seriesOptions.stack || 0) :
		            series.index, // #4743
		        z = stack * (depth + (seriesOptions.groupZPadding || 1)),
		        borderCrisp = series.borderWidth % 2 ? 0.5 : 0;

		    if (chart.inverted && !series.yAxis.reversed) {
		        borderCrisp *= -1;
		    }

		    if (seriesOptions.grouping !== false) {
		        z = 0;
		    }

		    z += (seriesOptions.groupZPadding || 1);
		    each(series.data, function (point) {
		        // #7103 Reset outside3dPlot flag
		        point.outside3dPlot = null;
		        if (point.y !== null) {
		            var shapeArgs = point.shapeArgs,
		                tooltipPos = point.tooltipPos,
		                // Array for final shapeArgs calculation.
		                // We are checking two dimensions (x and y).
		                dimensions = [['x', 'width'], ['y', 'height']],
		                borderlessBase; // Crisped rects can have +/- 0.5 pixels offset.

		            // #3131 We need to check if column is inside plotArea.
		            each(dimensions, function (d) {
		                borderlessBase = shapeArgs[d[0]] - borderCrisp;
		                if (borderlessBase < 0) {
		                    // If borderLessBase is smaller than 0, it is needed to set
		                    // its value to 0 or 0.5 depending on borderWidth
		                    // borderWidth may be even or odd.
		                    shapeArgs[d[1]] += shapeArgs[d[0]] + borderCrisp;
		                    shapeArgs[d[0]] = -borderCrisp;
		                    borderlessBase = 0;
		                }
		                if (
		                    (
		                        borderlessBase + shapeArgs[d[1]] >
		                        series[d[0] + 'Axis'].len
		                    ) &&
		                    // Do not change height/width of column if 0 (#6708)
		                    shapeArgs[d[1]] !== 0
		                ) {
		                    shapeArgs[d[1]] =
		                        series[d[0] + 'Axis'].len - shapeArgs[d[0]];
		                }
		                if (
		                    // Do not remove columns with zero height/width.
		                    (shapeArgs[d[1]] !== 0) &&
		                    (
		                        shapeArgs[d[0]] >= series[d[0] + 'Axis'].len ||
		                        shapeArgs[d[0]] + shapeArgs[d[1]] <= borderCrisp
		                    )
		                ) {
		                    // Set args to 0 if column is outside the chart.
		                    for (var key in shapeArgs) {
		                        shapeArgs[key] = 0;
		                    }
		                    // #7103 outside3dPlot flag is set on Points which are
		                    // currently outside of plot.
		                    point.outside3dPlot = true;
		                }
		            });

		            point.shapeType = 'cuboid';
		            shapeArgs.z = z;
		            shapeArgs.depth = depth;
		            shapeArgs.insidePlotArea = true;

		            // Translate the tooltip position in 3d space
		            tooltipPos = perspective(
		                [{ x: tooltipPos[0], y: tooltipPos[1], z: z }],
		                chart,
		                true
		            )[0];
		            point.tooltipPos = [tooltipPos.x, tooltipPos.y];
		        }
		    });
		    // store for later use #4067
		    series.z = z;
		};

		wrap(seriesTypes.column.prototype, 'animate', function (proceed) {
		    if (!this.chart.is3d()) {
		        proceed.apply(this, [].slice.call(arguments, 1));
		    } else {
		        var args = arguments,
		            init = args[1],
		            yAxis = this.yAxis,
		            series = this,
		            reversed = this.yAxis.reversed;

		        if (svg) { // VML is too slow anyway
		            if (init) {
		                each(series.data, function (point) {
		                    if (point.y !== null) {
		                        point.height = point.shapeArgs.height;
		                        point.shapey = point.shapeArgs.y;    // #2968
		                        point.shapeArgs.height = 1;
		                        if (!reversed) {
		                            if (point.stackY) {
		                                point.shapeArgs.y =
		                                    point.plotY + yAxis.translate(point.stackY);
		                            } else {
		                                point.shapeArgs.y =
		                                    point.plotY +
		                                    (
		                                        point.negative ?
		                                        -point.height :
		                                        point.height
		                                    );
		                            }
		                        }
		                    }
		                });

		            } else { // run the animation
		                each(series.data, function (point) {
		                    if (point.y !== null) {
		                        point.shapeArgs.height = point.height;
		                        point.shapeArgs.y = point.shapey;    // #2968
		                        // null value do not have a graphic
		                        if (point.graphic) {
		                            point.graphic.animate(
		                                point.shapeArgs,
		                                series.options.animation
		                            );
		                        }
		                    }
		                });

		                // redraw datalabels to the correct position
		                this.drawDataLabels();

		                // delete this function to allow it only once
		                series.animate = null;
		            }
		        }
		    }
		});

		/*
		 * In case of 3d columns there is no sense to add this columns
		 * to a specific series group - if series is added to a group
		 * all columns will have the same zIndex in comparison with different series
		 */

		wrap(
		    seriesTypes.column.prototype,
		    'plotGroup',
		    function (proceed, prop, name, visibility, zIndex, parent) {
		        if (this.chart.is3d() && parent && !this[prop]) {
		            if (!this.chart.columnGroup) {
		                this.chart.columnGroup =
		                    this.chart.renderer.g('columnGroup').add(parent);
		            }
		            this[prop] = this.chart.columnGroup;
		            this.chart.columnGroup.attr(this.getPlotBox());
		            this[prop].survive = true;
		        }
		        return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
		    }
		);

		/*
		 * When series is not added to group it is needed to change
		 * setVisible method to allow correct Legend funcionality
		 * This wrap is basing on pie chart series
		 */
		wrap(
		    seriesTypes.column.prototype,
		    'setVisible',
		    function (proceed, vis) {
		        var series = this,
		            pointVis;
		        if (series.chart.is3d()) {
		            each(series.data, function (point) {
		                point.visible = point.options.visible = vis =
		                    vis === undefined ? !point.visible : vis;
		                pointVis = vis ? 'visible' : 'hidden';
		                series.options.data[inArray(point, series.data)] =
		                    point.options;
		                if (point.graphic) {
		                    point.graphic.attr({
		                        visibility: pointVis
		                    });
		                }
		            });
		        }
		        proceed.apply(this, Array.prototype.slice.call(arguments, 1));
		    }
		);

		seriesTypes.column.prototype.handle3dGrouping = true;
		addEvent(Series, 'afterInit', function () {
		    if (this.chart.is3d() && this.handle3dGrouping) {
		        var seriesOptions = this.options,
		            grouping = seriesOptions.grouping,
		            stacking = seriesOptions.stacking,
		            reversedStacks = pick(this.yAxis.options.reversedStacks, true),
		            z = 0;

		        if (!(grouping !== undefined && !grouping)) {
		            var stacks = this.chart.retrieveStacks(stacking),
		                stack = seriesOptions.stack || 0,
		                i; // position within the stack
		            for (i = 0; i < stacks[stack].series.length; i++) {
		                if (stacks[stack].series[i] === this) {
		                    break;
		                }
		            }
		            z = (10 * (stacks.totalStacks - stacks[stack].position)) +
		                (reversedStacks ? i : -i); // #4369

		            // In case when axis is reversed, columns are also reversed inside
		            // the group (#3737)
		            if (!this.xAxis.reversed) {
		                z = (stacks.totalStacks * 10) - z;
		            }
		        }

		        seriesOptions.zIndex = z;
		    }
		});


		function pointAttribs(proceed) {
		    var attr = proceed.apply(this, [].slice.call(arguments, 1));

		    if (this.chart.is3d && this.chart.is3d()) {
		        // Set the fill color to the fill color to provide a smooth edge
		        attr.stroke = this.options.edgeColor || attr.fill;
		        attr['stroke-width'] = pick(this.options.edgeWidth, 1); // #4055
		    }

		    return attr;
		}

		wrap(seriesTypes.column.prototype, 'pointAttribs', pointAttribs);
		if (seriesTypes.columnrange) {
		    wrap(seriesTypes.columnrange.prototype, 'pointAttribs', pointAttribs);
		    seriesTypes.columnrange.prototype.plotGroup =
		        seriesTypes.column.prototype.plotGroup;
		    seriesTypes.columnrange.prototype.setVisible =
		        seriesTypes.column.prototype.setVisible;
		}


		wrap(Series.prototype, 'alignDataLabel', function (proceed) {

		    // Only do this for 3D columns and columnranges
		    if (
		        this.chart.is3d() &&
		        (this.type === 'column' || this.type === 'columnrange')
		    ) {
		        var series = this,
		            chart = series.chart;

		        var args = arguments,
		            alignTo = args[4],
		            point = args[1];

		        var pos = ({ x: alignTo.x, y: alignTo.y, z: series.z });
		        pos = perspective([pos], chart, true)[0];
		        alignTo.x = pos.x;
		        // #7103 If point is outside of plotArea, hide data label.
		        alignTo.y = point.outside3dPlot ? -9e9 : pos.y;
		    }

		    proceed.apply(this, [].slice.call(arguments, 1));
		});

		// Added stackLabels position calculation for 3D charts.
		wrap(H.StackItem.prototype, 'getStackBox', function (proceed, chart) { // #3946
		    var stackBox = proceed.apply(this, [].slice.call(arguments, 1));

		    // Only do this for 3D chart.
		    if (chart.is3d()) {
		        var pos = ({
		            x: stackBox.x,
		            y: stackBox.y,
		            z: 0
		        });
		        pos = H.perspective([pos], chart, true)[0];
		        stackBox.x = pos.x;
		        stackBox.y = pos.y;
		    }

		    return stackBox;
		});

		/*
		    EXTENSION FOR 3D CYLINDRICAL COLUMNS
		    Not supported
		*/
		/*
		var defaultOptions = H.getOptions();
		defaultOptions.plotOptions.cylinder =
		    H.merge(defaultOptions.plotOptions.column);
		var CylinderSeries = H.extendClass(seriesTypes.column, {
		    type: 'cylinder'
		});
		seriesTypes.cylinder = CylinderSeries;

		wrap(seriesTypes.cylinder.prototype, 'translate', function (proceed) {
		    proceed.apply(this, [].slice.call(arguments, 1));

		    // Do not do this if the chart is not 3D
		    if (!this.chart.is3d()) {
		        return;
		    }

		    var series = this,
		        chart = series.chart,
		        options = chart.options,
		        cylOptions = options.plotOptions.cylinder,
		        options3d = options.chart.options3d,
		        depth = cylOptions.depth || 0,
		        alpha = chart.alpha3d;

		    var z = cylOptions.stacking ?
		        (this.options.stack || 0) * depth :
		        series._i * depth;
		    z += depth / 2;

		    if (cylOptions.grouping !== false) { z = 0; }

		    each(series.data, function (point) {
		        var shapeArgs = point.shapeArgs,
		            deg2rad = H.deg2rad;
		        point.shapeType = 'arc3d';
		        shapeArgs.x += depth / 2;
		        shapeArgs.z = z;
		        shapeArgs.start = 0;
		        shapeArgs.end = 2 * PI;
		        shapeArgs.r = depth * 0.95;
		        shapeArgs.innerR = 0;
		        shapeArgs.depth =
		            shapeArgs.height * (1 / sin((90 - alpha) * deg2rad)) - z;
		        shapeArgs.alpha = 90 - alpha;
		        shapeArgs.beta = 0;
		    });
		});
		*/

	}(Highcharts));
	(function (H) {
		/**
		 * (c) 2010-2018 Torstein Honsi
		 *
		 * 3D pie series
		 *
		 * License: www.highcharts.com/license
		 */
		var deg2rad = H.deg2rad,
		    each = H.each,
		    pick = H.pick,
		    seriesTypes = H.seriesTypes,
		    svg = H.svg,
		    wrap = H.wrap;


		/**
		 * The thickness of a 3D pie. Requires `highcharts-3d.js`
		 *
		 * @type {Number}
		 * @default 0
		 * @since 4.0
		 * @product highcharts
		 * @apioption plotOptions.pie.depth
		 */

		wrap(seriesTypes.pie.prototype, 'translate', function (proceed) {
		    proceed.apply(this, [].slice.call(arguments, 1));

		    // Do not do this if the chart is not 3D
		    if (!this.chart.is3d()) {
		        return;
		    }

		    var series = this,
		        seriesOptions = series.options,
		        depth = seriesOptions.depth || 0,
		        options3d = series.chart.options.chart.options3d,
		        alpha = options3d.alpha,
		        beta = options3d.beta,
		        z = seriesOptions.stacking ?
		            (seriesOptions.stack || 0) * depth :
		            series._i * depth;

		    z += depth / 2;

		    if (seriesOptions.grouping !== false) {
		        z = 0;
		    }

		    each(series.data, function (point) {

		        var shapeArgs = point.shapeArgs,
		            angle;

		        point.shapeType = 'arc3d';

		        shapeArgs.z = z;
		        shapeArgs.depth = depth * 0.75;
		        shapeArgs.alpha = alpha;
		        shapeArgs.beta = beta;
		        shapeArgs.center = series.center;

		        angle = (shapeArgs.end + shapeArgs.start) / 2;

		        point.slicedTranslation = {
		            translateX: Math.round(
		                Math.cos(angle) *
		                seriesOptions.slicedOffset *
		                Math.cos(alpha * deg2rad)
		            ),
		            translateY: Math.round(
		                Math.sin(angle) *
		                seriesOptions.slicedOffset *
		                Math.cos(alpha * deg2rad)
		            )
		        };
		    });
		});

		wrap(
		    seriesTypes.pie.prototype.pointClass.prototype,
		    'haloPath',
		    function (proceed) {
		        var args = arguments;
		        return this.series.chart.is3d() ? [] : proceed.call(this, args[1]);
		    }
		);


		wrap(
		    seriesTypes.pie.prototype,
		    'pointAttribs',
		    function (proceed, point, state) {
		        var attr = proceed.call(this, point, state),
		            options = this.options;

		        if (this.chart.is3d()) {
		            attr.stroke = options.edgeColor || point.color || this.color;
		            attr['stroke-width'] = pick(options.edgeWidth, 1);
		        }

		        return attr;
		    }
		);


		wrap(seriesTypes.pie.prototype, 'drawPoints', function (proceed) {
		    proceed.apply(this, [].slice.call(arguments, 1));

		    if (this.chart.is3d()) {
		        each(this.points, function (point) {
		            var graphic = point.graphic;

		            // #4584 Check if has graphic - null points don't have it
		            if (graphic) {
		                // Hide null or 0 points (#3006, 3650)
		                graphic[point.y && point.visible ? 'show' : 'hide']();
		            }
		        });
		    }
		});

		wrap(seriesTypes.pie.prototype, 'drawDataLabels', function (proceed) {
		    if (this.chart.is3d()) {
		        var series = this,
		            chart = series.chart,
		            options3d = chart.options.chart.options3d;
		        each(series.data, function (point) {
		            var shapeArgs = point.shapeArgs,
		                r = shapeArgs.r,
		                // #3240 issue with datalabels for 0 and null values
		                a1 = (shapeArgs.alpha || options3d.alpha) * deg2rad,
		                b1 = (shapeArgs.beta || options3d.beta) * deg2rad,
		                a2 = (shapeArgs.start + shapeArgs.end) / 2,
		                labelPos = point.labelPos,
		                labelIndexes = [0, 2, 4], // [x1, y1, x2, y2, x3, y3]
		                yOffset = (-r * (1 - Math.cos(a1)) * Math.sin(a2)),
		                xOffset = r * (Math.cos(b1) - 1) * Math.cos(a2);

		            // Apply perspective on label positions
		            each(labelIndexes, function (index) {
		                labelPos[index] += xOffset;
		                labelPos[index + 1] += yOffset;
		            });
		        });
		    }

		    proceed.apply(this, [].slice.call(arguments, 1));
		});

		wrap(seriesTypes.pie.prototype, 'addPoint', function (proceed) {
		    proceed.apply(this, [].slice.call(arguments, 1));
		    if (this.chart.is3d()) {
		        // destroy (and rebuild) everything!!!
		        this.update(this.userOptions, true); // #3845 pass the old options
		    }
		});

		wrap(seriesTypes.pie.prototype, 'animate', function (proceed) {
		    if (!this.chart.is3d()) {
		        proceed.apply(this, [].slice.call(arguments, 1));
		    } else {
		        var args = arguments,
		            init = args[1],
		            animation = this.options.animation,
		            attribs,
		            center = this.center,
		            group = this.group,
		            markerGroup = this.markerGroup;

		        if (svg) { // VML is too slow anyway

		            if (animation === true) {
		                animation = {};
		            }
		            // Initialize the animation
		            if (init) {

		                // Scale down the group and place it in the center
		                group.oldtranslateX = group.translateX;
		                group.oldtranslateY = group.translateY;
		                attribs = {
		                    translateX: center[0],
		                    translateY: center[1],
		                    scaleX: 0.001, // #1499
		                    scaleY: 0.001
		                };

		                group.attr(attribs);
		                if (markerGroup) {
		                    markerGroup.attrSetters = group.attrSetters;
		                    markerGroup.attr(attribs);
		                }

		            // Run the animation
		            } else {
		                attribs = {
		                    translateX: group.oldtranslateX,
		                    translateY: group.oldtranslateY,
		                    scaleX: 1,
		                    scaleY: 1
		                };
		                group.animate(attribs, animation);

		                if (markerGroup) {
		                    markerGroup.animate(attribs, animation);
		                }

		                // Delete this function to allow it only once
		                this.animate = null;
		            }

		        }
		    }
		});

	}(Highcharts));
	(function (H) {
		/**
		 * (c) 2010-2018 Torstein Honsi
		 *
		 * Scatter 3D series.
		 *
		 * License: www.highcharts.com/license
		 */
		var Point = H.Point,
		    seriesType = H.seriesType,
		    seriesTypes = H.seriesTypes;

		/**
		 * A 3D scatter plot uses x, y and z coordinates to display values for three
		 * variables for a set of data.
		 *
		 * @sample {highcharts} highcharts/3d/scatter/
		 *         Simple 3D scatter
		 * @sample {highcharts} highcharts/demo/3d-scatter-draggable
		 *         Draggable 3d scatter
		 *
		 * @extends plotOptions.scatter
		 * @product highcharts
		 * @optionparent plotOptions.scatter3d
		 */
		seriesType('scatter3d', 'scatter', {
		    tooltip: {
		        pointFormat: 'x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>z: <b>{point.z}</b><br/>'
		    }

		// Series class
		}, {
		    pointAttribs: function (point) {
		        var attribs = seriesTypes.scatter.prototype.pointAttribs
		            .apply(this, arguments);

		        if (this.chart.is3d() && point) {
		            attribs.zIndex = H.pointCameraDistance(point, this.chart);
		        }

		        return attribs;
		    },
		    axisTypes: ['xAxis', 'yAxis', 'zAxis'],
		    pointArrayMap: ['x', 'y', 'z'],
		    parallelArrays: ['x', 'y', 'z'],

		    // Require direct touch rather than using the k-d-tree, because the k-d-tree
		    // currently doesn't take the xyz coordinate system into account (#4552)
		    directTouch: true

		// Point class
		}, {
		    applyOptions: function () {
		        Point.prototype.applyOptions.apply(this, arguments);
		        if (this.z === undefined) {
		            this.z = 0;
		        }

		        return this;
		    }

		});


		/**
		 * A `scatter3d` series. If the [type](#series.scatter3d.type) option is
		 * not specified, it is inherited from [chart.type](#chart.type).
		 *
		 * scatter3d](#plotOptions.scatter3d).
		 *
		 * @type {Object}
		 * @extends series,plotOptions.scatter3d
		 * @product highcharts
		 * @apioption series.scatter3d
		 */

		/**
		 * An array of data points for the series. For the `scatter3d` series
		 * type, points can be given in the following ways:
		 *
		 * 1.  An array of arrays with 3 values. In this case, the values correspond
		 * to `x,y,z`. If the first value is a string, it is applied as the name
		 * of the point, and the `x` value is inferred.
		 *
		 *  ```js
		 *     data: [
		 *         [0, 0, 1],
		 *         [1, 8, 7],
		 *         [2, 9, 2]
		 *     ]
		 *  ```
		 *
		 * 3.  An array of objects with named values. The following snippet shows only a
		 * few settings, see the complete options set below. If the total number of data
		 * points exceeds the series'
		 * [turboThreshold](#series.scatter3d.turboThreshold), this option is not
		 * available.
		 *
		 *  ```js
		 *     data: [{
		 *         x: 1,
		 *         y: 2,
		 *         z: 24,
		 *         name: "Point2",
		 *         color: "#00FF00"
		 *     }, {
		 *         x: 1,
		 *         y: 4,
		 *         z: 12,
		 *         name: "Point1",
		 *         color: "#FF00FF"
		 *     }]
		 *  ```
		 *
		 * @type {Array<Object|Array>}
		 * @extends series.scatter.data
		 * @sample {highcharts} highcharts/chart/reflow-true/
		 *         Numerical values
		 * @sample {highcharts} highcharts/series/data-array-of-arrays/
		 *         Arrays of numeric x and y
		 * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
		 *         Arrays of datetime x and y
		 * @sample {highcharts} highcharts/series/data-array-of-name-value/
		 *         Arrays of point.name and y
		 * @sample {highcharts} highcharts/series/data-array-of-objects/
		 *         Config objects
		 * @product highcharts
		 * @apioption series.scatter3d.data
		 */

		/**
		 * The z value for each data point.
		 *
		 * @type {Number}
		 * @product highcharts
		 * @apioption series.scatter3d.data.z
		 */

	}(Highcharts));
	(function (H) {
		/**
		 * (c) 2010-2018 Torstein Honsi
		 *
		 * License: www.highcharts.com/license
		 */

		var addEvent = H.addEvent,
		    Axis = H.Axis,
		    SVGRenderer = H.SVGRenderer,
		    VMLRenderer = H.VMLRenderer;

		/**
		 *    Extension to the VML Renderer
		 */
		if (VMLRenderer) {

		    H.setOptions({ animate: false });

		    VMLRenderer.prototype.face3d = SVGRenderer.prototype.face3d;
		    VMLRenderer.prototype.polyhedron = SVGRenderer.prototype.polyhedron;
		    VMLRenderer.prototype.cuboid = SVGRenderer.prototype.cuboid;
		    VMLRenderer.prototype.cuboidPath = SVGRenderer.prototype.cuboidPath;

		    VMLRenderer.prototype.toLinePath = SVGRenderer.prototype.toLinePath;
		    VMLRenderer.prototype.toLineSegments = SVGRenderer.prototype.toLineSegments;

		    VMLRenderer.prototype.createElement3D =
		        SVGRenderer.prototype.createElement3D;

		    VMLRenderer.prototype.arc3d = function (shapeArgs) {
		        var result = SVGRenderer.prototype.arc3d.call(this, shapeArgs);
		        result.css({ zIndex: result.zIndex });
		        return result;
		    };

		    H.VMLRenderer.prototype.arc3dPath = H.SVGRenderer.prototype.arc3dPath;

		    addEvent(Axis, 'render', function () {

		        // VML doesn't support a negative z-index
		        if (this.sideFrame) {
		            this.sideFrame.css({ zIndex: 0 });
		            this.sideFrame.front.attr({ fill: this.sideFrame.color });
		        }
		        if (this.bottomFrame) {
		            this.bottomFrame.css({ zIndex: 1 });
		            this.bottomFrame.front.attr({ fill: this.bottomFrame.color });
		        }
		        if (this.backFrame) {
		            this.backFrame.css({ zIndex: 0 });
		            this.backFrame.front.attr({ fill: this.backFrame.color });
		        }
		    });

		}


	}(Highcharts));
	return (function () {


	}());
}));