highcharts-rails 5.0.14 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.markdown +60 -0
  3. data/Rakefile +54 -5
  4. data/app/assets/images/highcharts/earth.svg +432 -0
  5. data/app/assets/javascripts/highcharts.js +5103 -3147
  6. data/app/assets/javascripts/highcharts/highcharts-3d.js +930 -277
  7. data/app/assets/javascripts/highcharts/highcharts-more.js +1374 -249
  8. data/app/assets/javascripts/highcharts/lib/canvg.js +3073 -0
  9. data/app/assets/javascripts/highcharts/lib/jspdf.js +16624 -0
  10. data/app/assets/javascripts/highcharts/lib/rgbcolor.js +299 -0
  11. data/app/assets/javascripts/highcharts/lib/svg2pdf.js +3488 -0
  12. data/app/assets/javascripts/highcharts/modules/accessibility.js +654 -212
  13. data/app/assets/javascripts/highcharts/modules/annotations.js +1552 -274
  14. data/app/assets/javascripts/highcharts/modules/boost-canvas.js +773 -0
  15. data/app/assets/javascripts/highcharts/modules/boost.js +636 -210
  16. data/app/assets/javascripts/highcharts/modules/broken-axis.js +2 -2
  17. data/app/assets/javascripts/highcharts/modules/bullet.js +364 -0
  18. data/app/assets/javascripts/highcharts/modules/data.js +766 -38
  19. data/app/assets/javascripts/highcharts/modules/drag-panes.js +588 -0
  20. data/app/assets/javascripts/highcharts/modules/drilldown.js +106 -36
  21. data/app/assets/javascripts/highcharts/modules/export-data.js +597 -0
  22. data/app/assets/javascripts/highcharts/modules/exporting.js +424 -162
  23. data/app/assets/javascripts/highcharts/modules/funnel.js +144 -22
  24. data/app/assets/javascripts/highcharts/modules/gantt.js +1154 -0
  25. data/app/assets/javascripts/highcharts/modules/grid-axis.js +1 -1
  26. data/app/assets/javascripts/highcharts/modules/heatmap.js +406 -80
  27. data/app/assets/javascripts/highcharts/modules/histogram-bellcurve.js +513 -0
  28. data/app/assets/javascripts/highcharts/modules/item-series.js +126 -0
  29. data/app/assets/javascripts/highcharts/modules/no-data-to-display.js +31 -13
  30. data/app/assets/javascripts/highcharts/modules/offline-exporting.js +179 -57
  31. data/app/assets/javascripts/highcharts/modules/oldie.js +1378 -0
  32. data/app/assets/javascripts/highcharts/modules/overlapping-datalabels.js +8 -6
  33. data/app/assets/javascripts/highcharts/modules/parallel-coordinates.js +494 -0
  34. data/app/assets/javascripts/highcharts/modules/pareto.js +275 -0
  35. data/app/assets/javascripts/highcharts/modules/sankey.js +641 -0
  36. data/app/assets/javascripts/highcharts/modules/series-label.js +355 -145
  37. data/app/assets/javascripts/highcharts/modules/solid-gauge.js +122 -1
  38. data/app/assets/javascripts/highcharts/modules/static-scale.js +64 -0
  39. data/app/assets/javascripts/highcharts/modules/stock.js +1944 -676
  40. data/app/assets/javascripts/highcharts/modules/streamgraph.js +139 -0
  41. data/app/assets/javascripts/highcharts/modules/sunburst.js +2403 -0
  42. data/app/assets/javascripts/highcharts/modules/tilemap.js +1199 -0
  43. data/app/assets/javascripts/highcharts/modules/treemap.js +538 -134
  44. data/app/assets/javascripts/highcharts/modules/variable-pie.js +490 -0
  45. data/app/assets/javascripts/highcharts/modules/variwide.js +283 -0
  46. data/app/assets/javascripts/highcharts/modules/vector.js +294 -0
  47. data/app/assets/javascripts/highcharts/modules/windbarb.js +490 -0
  48. data/app/assets/javascripts/highcharts/modules/wordcloud.js +681 -0
  49. data/app/assets/javascripts/highcharts/modules/xrange.js +615 -0
  50. data/app/assets/javascripts/highcharts/themes/avocado.js +54 -0
  51. data/app/assets/javascripts/highcharts/themes/dark-blue.js +6 -6
  52. data/app/assets/javascripts/highcharts/themes/dark-green.js +6 -6
  53. data/app/assets/javascripts/highcharts/themes/dark-unica.js +6 -6
  54. data/app/assets/javascripts/highcharts/themes/gray.js +14 -10
  55. data/app/assets/javascripts/highcharts/themes/grid-light.js +6 -6
  56. data/app/assets/javascripts/highcharts/themes/grid.js +7 -5
  57. data/app/assets/javascripts/highcharts/themes/sand-signika.js +8 -7
  58. data/app/assets/javascripts/highcharts/themes/skies.js +15 -9
  59. data/app/assets/javascripts/highcharts/themes/sunset.js +53 -0
  60. data/app/assets/stylesheets/highcharts/highcharts.css +802 -0
  61. data/app/assets/stylesheets/highcharts/highcharts.scss +665 -0
  62. data/lib/highcharts/version.rb +1 -1
  63. metadata +31 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v5.0.14 (2017-07-28)
2
+ * @license Highcharts JS v6.0.0 (2017-10-04)
3
3
  *
4
4
  * 3D features for Highcharts JS
5
5
  *
@@ -184,10 +184,10 @@
184
184
  SVGElement = H.SVGElement,
185
185
  SVGRenderer = H.SVGRenderer,
186
186
  wrap = H.wrap;
187
- /***
187
+ /*
188
188
  EXTENSION TO THE SVG-RENDERER TO ENABLE 3D SHAPES
189
- ***/
190
- ////// HELPER METHODS //////
189
+ */
190
+ // HELPER METHODS //
191
191
 
192
192
  var dFactor = (4 * (Math.sqrt(2) - 1) / 3) / (PI / 2);
193
193
 
@@ -375,7 +375,7 @@
375
375
  return result.attr(args);
376
376
  };
377
377
 
378
- ////// CUBOIDS //////
378
+ // CUBOIDS //
379
379
  SVGRenderer.prototype.cuboid = function(shapeArgs) {
380
380
 
381
381
  var result = this.g(),
@@ -659,7 +659,7 @@
659
659
  ]; // #4774
660
660
  };
661
661
 
662
- ////// SECTORS //////
662
+ // SECTORS //
663
663
  H.SVGRenderer.prototype.arc3d = function(attribs) {
664
664
 
665
665
  var wrapper = this.g(),
@@ -1077,6 +1077,8 @@
1077
1077
  /**
1078
1078
  * (c) 2010-2017 Torstein Honsi
1079
1079
  *
1080
+ * Extension for 3D charts
1081
+ *
1080
1082
  * License: www.highcharts.com/license
1081
1083
  */
1082
1084
  var Chart = H.Chart,
@@ -1086,9 +1088,6 @@
1086
1088
  pick = H.pick,
1087
1089
  wrap = H.wrap;
1088
1090
 
1089
- /***
1090
- EXTENSION FOR 3D CHARTS
1091
- ***/
1092
1091
  // Shorthand to check the is3d flag
1093
1092
  Chart.prototype.is3d = function() {
1094
1093
  return this.options.chart.options3d && this.options.chart.options3d.enabled; // #4280
@@ -1097,6 +1096,18 @@
1097
1096
  Chart.prototype.propsRequireDirtyBox.push('chart.options3d');
1098
1097
  Chart.prototype.propsRequireUpdateSeries.push('chart.options3d');
1099
1098
 
1099
+ // Legacy support for HC < 6 to make 'scatter' series in a 3D chart route to the
1100
+ // real 'scatter3d' series type.
1101
+ wrap(Chart.prototype, 'initSeries', function(proceed, options) {
1102
+ var type = options.type ||
1103
+ this.options.chart.type ||
1104
+ this.options.chart.defaultSeriesType;
1105
+ if (this.is3d() && type === 'scatter') {
1106
+ options.type = 'scatter3d';
1107
+ }
1108
+ return proceed.call(this, options);
1109
+ });
1110
+
1100
1111
  /**
1101
1112
  * Calculate scale of the 3D view. That is required to
1102
1113
  * fit chart's 3D projection into the actual plotting area. Reported as #4933.
@@ -1213,8 +1224,7 @@
1213
1224
  /**
1214
1225
  * Options regarding the chart area and plot area as well as general
1215
1226
  * chart options.
1216
- *
1217
- * @product highcharts highstock highmaps
1227
+ *
1218
1228
  */
1219
1229
  chart: {
1220
1230
 
@@ -1314,10 +1324,12 @@
1314
1324
  frame: {
1315
1325
 
1316
1326
  /**
1327
+ * Whether the frames are visible.
1317
1328
  */
1318
1329
  visible: 'default',
1319
1330
 
1320
1331
  /**
1332
+ * General pixel thickness for the frame faces.
1321
1333
  */
1322
1334
  size: 1,
1323
1335
 
@@ -1327,34 +1339,75 @@
1327
1339
  * @since 4.0
1328
1340
  * @product highcharts
1329
1341
  */
1330
- bottom: {},
1342
+ bottom: {
1343
+ /**
1344
+ * The color of the panel.
1345
+ *
1346
+ * @type {Color}
1347
+ * @default transparent
1348
+ * @since 4.0
1349
+ * @product highcharts
1350
+ * @apioption chart.options3d.frame.bottom.color
1351
+ */
1352
+
1353
+ /**
1354
+ * The thickness of the panel.
1355
+ *
1356
+ * @type {Number}
1357
+ * @default 1
1358
+ * @since 4.0
1359
+ * @product highcharts
1360
+ * @apioption chart.options3d.frame.bottom.size
1361
+ */
1362
+
1363
+ /**
1364
+ * Whether to display the frame. Possible values are `true`, `false`,
1365
+ * `"auto"` to display only the frames behind the data, and `"default"`
1366
+ * to display faces behind the data based on the axis layout, ignoring
1367
+ * the point of view.
1368
+ *
1369
+ * @validvalue ["default", "auto", true, false]
1370
+ * @type {Boolean|String}
1371
+ * @sample {highcharts} highcharts/3d/scatter-frame/ Auto frames
1372
+ * @default default
1373
+ * @since 5.0.12
1374
+ * @product highcharts
1375
+ * @apioption chart.options3d.frame.bottom.visible
1376
+ */
1377
+ },
1331
1378
 
1332
1379
  /**
1333
1380
  * The top of the frame around a 3D chart.
1334
- *
1335
- * @type {Object}
1336
- * @since 5.0.12
1337
- * @product highcharts
1381
+ *
1382
+ * @extends {chart.options3d.frame.bottom}
1338
1383
  */
1339
1384
  top: {},
1340
1385
 
1341
1386
  /**
1387
+ * The left side of the frame around a 3D chart.
1388
+ *
1389
+ * @extends {chart.options3d.frame.bottom}
1342
1390
  */
1343
1391
  left: {},
1344
1392
 
1345
1393
  /**
1394
+ * The right of the frame around a 3D chart.
1395
+ *
1396
+ * @extends {chart.options3d.frame.bottom}
1346
1397
  */
1347
1398
  right: {},
1348
1399
 
1349
1400
  /**
1350
- * Defines the back panel of the frame around 3D charts.
1351
- *
1352
- * @since 4.0
1353
- * @product highcharts
1401
+ * The back side of the frame around a 3D chart.
1402
+ *
1403
+ * @extends {chart.options3d.frame.bottom}
1354
1404
  */
1355
1405
  back: {},
1356
1406
 
1357
1407
  /**
1408
+ * The front of the frame around a 3D chart.
1409
+ *
1410
+ * @extends {chart.options3d.frame.bottom}
1358
1411
  */
1359
1412
  front: {}
1360
1413
  }
@@ -1470,7 +1523,7 @@
1470
1523
  this.frameShapes.bottom[verb]({
1471
1524
  'class': 'highcharts-3d-frame highcharts-3d-frame-bottom',
1472
1525
  zIndex: frame.bottom.frontFacing ? -1000 : 1000,
1473
- faces: [{ //bottom
1526
+ faces: [{ // bottom
1474
1527
  fill: H.color(frame.bottom.color).brighten(0.1).get(),
1475
1528
  vertexes: [{
1476
1529
  x: xmm,
@@ -1491,7 +1544,7 @@
1491
1544
  }],
1492
1545
  enabled: frame.bottom.visible
1493
1546
  },
1494
- { //top
1547
+ { // top
1495
1548
  fill: H.color(frame.bottom.color).brighten(0.1).get(),
1496
1549
  vertexes: [{
1497
1550
  x: xm,
@@ -1512,7 +1565,7 @@
1512
1565
  }],
1513
1566
  enabled: frame.bottom.visible
1514
1567
  },
1515
- { //left
1568
+ { // left
1516
1569
  fill: H.color(frame.bottom.color).brighten(-0.1).get(),
1517
1570
  vertexes: [{
1518
1571
  x: xmm,
@@ -1533,7 +1586,7 @@
1533
1586
  }],
1534
1587
  enabled: frame.bottom.visible && !frame.left.visible
1535
1588
  },
1536
- { //right
1589
+ { // right
1537
1590
  fill: H.color(frame.bottom.color).brighten(-0.1).get(),
1538
1591
  vertexes: [{
1539
1592
  x: xpp,
@@ -1554,7 +1607,7 @@
1554
1607
  }],
1555
1608
  enabled: frame.bottom.visible && !frame.right.visible
1556
1609
  },
1557
- { //front
1610
+ { // front
1558
1611
  fill: H.color(frame.bottom.color).get(),
1559
1612
  vertexes: [{
1560
1613
  x: xpp,
@@ -1575,7 +1628,7 @@
1575
1628
  }],
1576
1629
  enabled: frame.bottom.visible && !frame.front.visible
1577
1630
  },
1578
- { //back
1631
+ { // back
1579
1632
  fill: H.color(frame.bottom.color).get(),
1580
1633
  vertexes: [{
1581
1634
  x: xmm,
@@ -1601,7 +1654,7 @@
1601
1654
  this.frameShapes.top[verb]({
1602
1655
  'class': 'highcharts-3d-frame highcharts-3d-frame-top',
1603
1656
  zIndex: frame.top.frontFacing ? -1000 : 1000,
1604
- faces: [{ //bottom
1657
+ faces: [{ // bottom
1605
1658
  fill: H.color(frame.top.color).brighten(0.1).get(),
1606
1659
  vertexes: [{
1607
1660
  x: xmm,
@@ -1622,7 +1675,7 @@
1622
1675
  }],
1623
1676
  enabled: frame.top.visible
1624
1677
  },
1625
- { //top
1678
+ { // top
1626
1679
  fill: H.color(frame.top.color).brighten(0.1).get(),
1627
1680
  vertexes: [{
1628
1681
  x: xm,
@@ -1643,7 +1696,7 @@
1643
1696
  }],
1644
1697
  enabled: frame.top.visible
1645
1698
  },
1646
- { //left
1699
+ { // left
1647
1700
  fill: H.color(frame.top.color).brighten(-0.1).get(),
1648
1701
  vertexes: [{
1649
1702
  x: xmm,
@@ -1664,7 +1717,7 @@
1664
1717
  }],
1665
1718
  enabled: frame.top.visible && !frame.left.visible
1666
1719
  },
1667
- { //right
1720
+ { // right
1668
1721
  fill: H.color(frame.top.color).brighten(-0.1).get(),
1669
1722
  vertexes: [{
1670
1723
  x: xpp,
@@ -1685,7 +1738,7 @@
1685
1738
  }],
1686
1739
  enabled: frame.top.visible && !frame.right.visible
1687
1740
  },
1688
- { //front
1741
+ { // front
1689
1742
  fill: H.color(frame.top.color).get(),
1690
1743
  vertexes: [{
1691
1744
  x: xmm,
@@ -1706,7 +1759,7 @@
1706
1759
  }],
1707
1760
  enabled: frame.top.visible && !frame.front.visible
1708
1761
  },
1709
- { //back
1762
+ { // back
1710
1763
  fill: H.color(frame.top.color).get(),
1711
1764
  vertexes: [{
1712
1765
  x: xpp,
@@ -1732,7 +1785,7 @@
1732
1785
  this.frameShapes.left[verb]({
1733
1786
  'class': 'highcharts-3d-frame highcharts-3d-frame-left',
1734
1787
  zIndex: frame.left.frontFacing ? -1000 : 1000,
1735
- faces: [{ //bottom
1788
+ faces: [{ // bottom
1736
1789
  fill: H.color(frame.left.color).brighten(0.1).get(),
1737
1790
  vertexes: [{
1738
1791
  x: xmm,
@@ -1753,7 +1806,7 @@
1753
1806
  }],
1754
1807
  enabled: frame.left.visible && !frame.bottom.visible
1755
1808
  },
1756
- { //top
1809
+ { // top
1757
1810
  fill: H.color(frame.left.color).brighten(0.1).get(),
1758
1811
  vertexes: [{
1759
1812
  x: xmm,
@@ -1774,7 +1827,7 @@
1774
1827
  }],
1775
1828
  enabled: frame.left.visible && !frame.top.visible
1776
1829
  },
1777
- { //left
1830
+ { // left
1778
1831
  fill: H.color(frame.left.color).brighten(-0.1).get(),
1779
1832
  vertexes: [{
1780
1833
  x: xmm,
@@ -1795,7 +1848,7 @@
1795
1848
  }],
1796
1849
  enabled: frame.left.visible
1797
1850
  },
1798
- { //right
1851
+ { // right
1799
1852
  fill: H.color(frame.left.color).brighten(-0.1).get(),
1800
1853
  vertexes: [{
1801
1854
  x: xm,
@@ -1816,7 +1869,7 @@
1816
1869
  }],
1817
1870
  enabled: frame.left.visible
1818
1871
  },
1819
- { //front
1872
+ { // front
1820
1873
  fill: H.color(frame.left.color).get(),
1821
1874
  vertexes: [{
1822
1875
  x: xmm,
@@ -1837,7 +1890,7 @@
1837
1890
  }],
1838
1891
  enabled: frame.left.visible && !frame.front.visible
1839
1892
  },
1840
- { //back
1893
+ { // back
1841
1894
  fill: H.color(frame.left.color).get(),
1842
1895
  vertexes: [{
1843
1896
  x: xmm,
@@ -1863,7 +1916,7 @@
1863
1916
  this.frameShapes.right[verb]({
1864
1917
  'class': 'highcharts-3d-frame highcharts-3d-frame-right',
1865
1918
  zIndex: frame.right.frontFacing ? -1000 : 1000,
1866
- faces: [{ //bottom
1919
+ faces: [{ // bottom
1867
1920
  fill: H.color(frame.right.color).brighten(0.1).get(),
1868
1921
  vertexes: [{
1869
1922
  x: xpp,
@@ -1884,7 +1937,7 @@
1884
1937
  }],
1885
1938
  enabled: frame.right.visible && !frame.bottom.visible
1886
1939
  },
1887
- { //top
1940
+ { // top
1888
1941
  fill: H.color(frame.right.color).brighten(0.1).get(),
1889
1942
  vertexes: [{
1890
1943
  x: xpp,
@@ -1905,7 +1958,7 @@
1905
1958
  }],
1906
1959
  enabled: frame.right.visible && !frame.top.visible
1907
1960
  },
1908
- { //left
1961
+ { // left
1909
1962
  fill: H.color(frame.right.color).brighten(-0.1).get(),
1910
1963
  vertexes: [{
1911
1964
  x: xp,
@@ -1926,7 +1979,7 @@
1926
1979
  }],
1927
1980
  enabled: frame.right.visible
1928
1981
  },
1929
- { //right
1982
+ { // right
1930
1983
  fill: H.color(frame.right.color).brighten(-0.1).get(),
1931
1984
  vertexes: [{
1932
1985
  x: xpp,
@@ -1947,7 +2000,7 @@
1947
2000
  }],
1948
2001
  enabled: frame.right.visible
1949
2002
  },
1950
- { //front
2003
+ { // front
1951
2004
  fill: H.color(frame.right.color).get(),
1952
2005
  vertexes: [{
1953
2006
  x: xpp,
@@ -1968,7 +2021,7 @@
1968
2021
  }],
1969
2022
  enabled: frame.right.visible && !frame.front.visible
1970
2023
  },
1971
- { //back
2024
+ { // back
1972
2025
  fill: H.color(frame.right.color).get(),
1973
2026
  vertexes: [{
1974
2027
  x: xpp,
@@ -1994,7 +2047,7 @@
1994
2047
  this.frameShapes.back[verb]({
1995
2048
  'class': 'highcharts-3d-frame highcharts-3d-frame-back',
1996
2049
  zIndex: frame.back.frontFacing ? -1000 : 1000,
1997
- faces: [{ //bottom
2050
+ faces: [{ // bottom
1998
2051
  fill: H.color(frame.back.color).brighten(0.1).get(),
1999
2052
  vertexes: [{
2000
2053
  x: xpp,
@@ -2015,7 +2068,7 @@
2015
2068
  }],
2016
2069
  enabled: frame.back.visible && !frame.bottom.visible
2017
2070
  },
2018
- { //top
2071
+ { // top
2019
2072
  fill: H.color(frame.back.color).brighten(0.1).get(),
2020
2073
  vertexes: [{
2021
2074
  x: xmm,
@@ -2036,7 +2089,7 @@
2036
2089
  }],
2037
2090
  enabled: frame.back.visible && !frame.top.visible
2038
2091
  },
2039
- { //left
2092
+ { // left
2040
2093
  fill: H.color(frame.back.color).brighten(-0.1).get(),
2041
2094
  vertexes: [{
2042
2095
  x: xmm,
@@ -2057,7 +2110,7 @@
2057
2110
  }],
2058
2111
  enabled: frame.back.visible && !frame.left.visible
2059
2112
  },
2060
- { //right
2113
+ { // right
2061
2114
  fill: H.color(frame.back.color).brighten(-0.1).get(),
2062
2115
  vertexes: [{
2063
2116
  x: xpp,
@@ -2078,7 +2131,7 @@
2078
2131
  }],
2079
2132
  enabled: frame.back.visible && !frame.right.visible
2080
2133
  },
2081
- { //front
2134
+ { // front
2082
2135
  fill: H.color(frame.back.color).get(),
2083
2136
  vertexes: [{
2084
2137
  x: xm,
@@ -2099,7 +2152,7 @@
2099
2152
  }],
2100
2153
  enabled: frame.back.visible
2101
2154
  },
2102
- { //back
2155
+ { // back
2103
2156
  fill: H.color(frame.back.color).get(),
2104
2157
  vertexes: [{
2105
2158
  x: xmm,
@@ -2125,7 +2178,7 @@
2125
2178
  this.frameShapes.front[verb]({
2126
2179
  'class': 'highcharts-3d-frame highcharts-3d-frame-front',
2127
2180
  zIndex: frame.front.frontFacing ? -1000 : 1000,
2128
- faces: [{ //bottom
2181
+ faces: [{ // bottom
2129
2182
  fill: H.color(frame.front.color).brighten(0.1).get(),
2130
2183
  vertexes: [{
2131
2184
  x: xmm,
@@ -2146,7 +2199,7 @@
2146
2199
  }],
2147
2200
  enabled: frame.front.visible && !frame.bottom.visible
2148
2201
  },
2149
- { //top
2202
+ { // top
2150
2203
  fill: H.color(frame.front.color).brighten(0.1).get(),
2151
2204
  vertexes: [{
2152
2205
  x: xpp,
@@ -2167,7 +2220,7 @@
2167
2220
  }],
2168
2221
  enabled: frame.front.visible && !frame.top.visible
2169
2222
  },
2170
- { //left
2223
+ { // left
2171
2224
  fill: H.color(frame.front.color).brighten(-0.1).get(),
2172
2225
  vertexes: [{
2173
2226
  x: xmm,
@@ -2188,7 +2241,7 @@
2188
2241
  }],
2189
2242
  enabled: frame.front.visible && !frame.left.visible
2190
2243
  },
2191
- { //right
2244
+ { // right
2192
2245
  fill: H.color(frame.front.color).brighten(-0.1).get(),
2193
2246
  vertexes: [{
2194
2247
  x: xpp,
@@ -2209,7 +2262,7 @@
2209
2262
  }],
2210
2263
  enabled: frame.front.visible && !frame.right.visible
2211
2264
  },
2212
- { //front
2265
+ { // front
2213
2266
  fill: H.color(frame.front.color).get(),
2214
2267
  vertexes: [{
2215
2268
  x: xp,
@@ -2230,7 +2283,7 @@
2230
2283
  }],
2231
2284
  enabled: frame.front.visible
2232
2285
  },
2233
- { //back
2286
+ { // back
2234
2287
  fill: H.color(frame.front.color).get(),
2235
2288
  vertexes: [{
2236
2289
  x: xpp,
@@ -2291,7 +2344,18 @@
2291
2344
  yp = chart.plotTop + chart.plotHeight,
2292
2345
  zm = 0,
2293
2346
  zp = options3d.depth,
2294
- bottomOrientation = H.shapeArea3d([{
2347
+ faceOrientation = function(vertexes) {
2348
+ var area = H.shapeArea3d(vertexes, chart);
2349
+ // Give it 0.5 squared-pixel as a margin for rounding errors.
2350
+ if (area > 0.5) {
2351
+ return 1;
2352
+ }
2353
+ if (area < -0.5) {
2354
+ return -1;
2355
+ }
2356
+ return 0;
2357
+ },
2358
+ bottomOrientation = faceOrientation([{
2295
2359
  x: xm,
2296
2360
  y: yp,
2297
2361
  z: zp
@@ -2307,8 +2371,8 @@
2307
2371
  x: xm,
2308
2372
  y: yp,
2309
2373
  z: zm
2310
- }], chart),
2311
- topOrientation = H.shapeArea3d([{
2374
+ }]),
2375
+ topOrientation = faceOrientation([{
2312
2376
  x: xm,
2313
2377
  y: ym,
2314
2378
  z: zm
@@ -2324,8 +2388,8 @@
2324
2388
  x: xm,
2325
2389
  y: ym,
2326
2390
  z: zp
2327
- }], chart),
2328
- leftOrientation = H.shapeArea3d([{
2391
+ }]),
2392
+ leftOrientation = faceOrientation([{
2329
2393
  x: xm,
2330
2394
  y: ym,
2331
2395
  z: zm
@@ -2341,8 +2405,8 @@
2341
2405
  x: xm,
2342
2406
  y: yp,
2343
2407
  z: zm
2344
- }], chart),
2345
- rightOrientation = H.shapeArea3d([{
2408
+ }]),
2409
+ rightOrientation = faceOrientation([{
2346
2410
  x: xp,
2347
2411
  y: ym,
2348
2412
  z: zp
@@ -2358,8 +2422,8 @@
2358
2422
  x: xp,
2359
2423
  y: yp,
2360
2424
  z: zp
2361
- }], chart),
2362
- frontOrientation = H.shapeArea3d([{
2425
+ }]),
2426
+ frontOrientation = faceOrientation([{
2363
2427
  x: xm,
2364
2428
  y: yp,
2365
2429
  z: zm
@@ -2375,8 +2439,8 @@
2375
2439
  x: xm,
2376
2440
  y: ym,
2377
2441
  z: zm
2378
- }], chart),
2379
- backOrientation = H.shapeArea3d([{
2442
+ }]),
2443
+ backOrientation = faceOrientation([{
2380
2444
  x: xm,
2381
2445
  y: ym,
2382
2446
  z: zp
@@ -2392,7 +2456,7 @@
2392
2456
  x: xm,
2393
2457
  y: yp,
2394
2458
  z: zp
2395
- }], chart),
2459
+ }]),
2396
2460
  defaultShowBottom = false,
2397
2461
  defaultShowTop = false,
2398
2462
  defaultShowLeft = false,
@@ -2440,7 +2504,7 @@
2440
2504
  if (options.visible === true || options.visible === false) {
2441
2505
  isVisible = options.visible;
2442
2506
  } else if (options.visible === 'auto') {
2443
- isVisible = faceOrientation >= 0;
2507
+ isVisible = faceOrientation > 0;
2444
2508
  }
2445
2509
 
2446
2510
  return {
@@ -2517,28 +2581,48 @@
2517
2581
  yEdges.push({
2518
2582
  y: (ym + yp) / 2,
2519
2583
  x: xm,
2520
- z: zm
2584
+ z: zm,
2585
+ xDir: {
2586
+ x: 1,
2587
+ y: 0,
2588
+ z: 0
2589
+ }
2521
2590
  });
2522
2591
  }
2523
2592
  if (isValidEdge(ret.left, ret.back)) {
2524
2593
  yEdges.push({
2525
2594
  y: (ym + yp) / 2,
2526
2595
  x: xm,
2527
- z: zp
2596
+ z: zp,
2597
+ xDir: {
2598
+ x: 0,
2599
+ y: 0,
2600
+ z: -1
2601
+ }
2528
2602
  });
2529
2603
  }
2530
2604
  if (isValidEdge(ret.right, ret.front)) {
2531
2605
  yEdges.push({
2532
2606
  y: (ym + yp) / 2,
2533
2607
  x: xp,
2534
- z: zm
2608
+ z: zm,
2609
+ xDir: {
2610
+ x: 0,
2611
+ y: 0,
2612
+ z: 1
2613
+ }
2535
2614
  });
2536
2615
  }
2537
2616
  if (isValidEdge(ret.right, ret.back)) {
2538
2617
  yEdges.push({
2539
2618
  y: (ym + yp) / 2,
2540
2619
  x: xp,
2541
- z: zp
2620
+ z: zp,
2621
+ xDir: {
2622
+ x: -1,
2623
+ y: 0,
2624
+ z: 0
2625
+ }
2542
2626
  });
2543
2627
  }
2544
2628
 
@@ -2547,14 +2631,24 @@
2547
2631
  xBottomEdges.push({
2548
2632
  x: (xm + xp) / 2,
2549
2633
  y: yp,
2550
- z: zm
2634
+ z: zm,
2635
+ xDir: {
2636
+ x: 1,
2637
+ y: 0,
2638
+ z: 0
2639
+ }
2551
2640
  });
2552
2641
  }
2553
2642
  if (isValidEdge(ret.bottom, ret.back)) {
2554
2643
  xBottomEdges.push({
2555
2644
  x: (xm + xp) / 2,
2556
2645
  y: yp,
2557
- z: zp
2646
+ z: zp,
2647
+ xDir: {
2648
+ x: -1,
2649
+ y: 0,
2650
+ z: 0
2651
+ }
2558
2652
  });
2559
2653
  }
2560
2654
 
@@ -2563,14 +2657,24 @@
2563
2657
  xTopEdges.push({
2564
2658
  x: (xm + xp) / 2,
2565
2659
  y: ym,
2566
- z: zm
2660
+ z: zm,
2661
+ xDir: {
2662
+ x: 1,
2663
+ y: 0,
2664
+ z: 0
2665
+ }
2567
2666
  });
2568
2667
  }
2569
2668
  if (isValidEdge(ret.top, ret.back)) {
2570
2669
  xTopEdges.push({
2571
2670
  x: (xm + xp) / 2,
2572
2671
  y: ym,
2573
- z: zp
2672
+ z: zp,
2673
+ xDir: {
2674
+ x: -1,
2675
+ y: 0,
2676
+ z: 0
2677
+ }
2574
2678
  });
2575
2679
  }
2576
2680
 
@@ -2579,14 +2683,24 @@
2579
2683
  zBottomEdges.push({
2580
2684
  z: (zm + zp) / 2,
2581
2685
  y: yp,
2582
- x: xm
2686
+ x: xm,
2687
+ xDir: {
2688
+ x: 0,
2689
+ y: 0,
2690
+ z: -1
2691
+ }
2583
2692
  });
2584
2693
  }
2585
2694
  if (isValidEdge(ret.bottom, ret.right)) {
2586
2695
  zBottomEdges.push({
2587
2696
  z: (zm + zp) / 2,
2588
2697
  y: yp,
2589
- x: xp
2698
+ x: xp,
2699
+ xDir: {
2700
+ x: 0,
2701
+ y: 0,
2702
+ z: 1
2703
+ }
2590
2704
  });
2591
2705
  }
2592
2706
 
@@ -2595,14 +2709,24 @@
2595
2709
  zTopEdges.push({
2596
2710
  z: (zm + zp) / 2,
2597
2711
  y: ym,
2598
- x: xm
2712
+ x: xm,
2713
+ xDir: {
2714
+ x: 0,
2715
+ y: 0,
2716
+ z: -1
2717
+ }
2599
2718
  });
2600
2719
  }
2601
2720
  if (isValidEdge(ret.top, ret.right)) {
2602
2721
  zTopEdges.push({
2603
2722
  z: (zm + zp) / 2,
2604
2723
  y: ym,
2605
- x: xp
2724
+ x: xp,
2725
+ xDir: {
2726
+ x: 0,
2727
+ y: 0,
2728
+ z: 1
2729
+ }
2606
2730
  });
2607
2731
  }
2608
2732
 
@@ -2642,31 +2766,69 @@
2642
2766
  y: {
2643
2767
  'left': {
2644
2768
  x: xm,
2645
- z: zm
2769
+ z: zm,
2770
+ xDir: {
2771
+ x: 1,
2772
+ y: 0,
2773
+ z: 0
2774
+ }
2646
2775
  },
2647
2776
  'right': {
2648
2777
  x: xp,
2649
- z: zm
2778
+ z: zm,
2779
+ xDir: {
2780
+ x: 0,
2781
+ y: 0,
2782
+ z: 1
2783
+ }
2650
2784
  }
2651
2785
  },
2652
2786
  x: {
2653
2787
  'top': {
2654
2788
  y: ym,
2655
- z: zm
2789
+ z: zm,
2790
+ xDir: {
2791
+ x: 1,
2792
+ y: 0,
2793
+ z: 0
2794
+ }
2656
2795
  },
2657
2796
  'bottom': {
2658
2797
  y: yp,
2659
- z: zm
2798
+ z: zm,
2799
+ xDir: {
2800
+ x: 1,
2801
+ y: 0,
2802
+ z: 0
2803
+ }
2660
2804
  }
2661
2805
  },
2662
2806
  z: {
2663
2807
  'top': {
2664
2808
  x: defaultShowLeft ? xp : xm,
2665
- y: ym
2809
+ y: ym,
2810
+ xDir: defaultShowLeft ? {
2811
+ x: 0,
2812
+ y: 0,
2813
+ z: 1
2814
+ } : {
2815
+ x: 0,
2816
+ y: 0,
2817
+ z: -1
2818
+ }
2666
2819
  },
2667
2820
  'bottom': {
2668
2821
  x: defaultShowLeft ? xp : xm,
2669
- y: yp
2822
+ y: yp,
2823
+ xDir: defaultShowLeft ? {
2824
+ x: 0,
2825
+ y: 0,
2826
+ z: 1
2827
+ } : {
2828
+ x: 0,
2829
+ y: 0,
2830
+ z: -1
2831
+ }
2670
2832
  }
2671
2833
  }
2672
2834
  };
@@ -2675,29 +2837,179 @@
2675
2837
  return ret;
2676
2838
  };
2677
2839
 
2840
+ /**
2841
+ * Animation setter for matrix property.
2842
+ */
2843
+ H.Fx.prototype.matrixSetter = function() {
2844
+ var interpolated;
2845
+ if (this.pos < 1 &&
2846
+ (H.isArray(this.start) || H.isArray(this.end))) {
2847
+ var start = this.start || [1, 0, 0, 1, 0, 0];
2848
+ var end = this.end || [1, 0, 0, 1, 0, 0];
2849
+ interpolated = [];
2850
+ for (var i = 0; i < 6; i++) {
2851
+ interpolated.push(this.pos * end[i] + (1 - this.pos) * start[i]);
2852
+ }
2853
+ } else {
2854
+ interpolated = this.end;
2855
+ }
2856
+
2857
+ this.elem.attr(
2858
+ this.prop,
2859
+ interpolated,
2860
+ null,
2861
+ true
2862
+ );
2863
+ };
2864
+
2865
+ /**
2866
+ * Note: As of v5.0.12, `frame.left` or `frame.right` should be used
2867
+ * instead.
2868
+ *
2869
+ * The side for the frame around a 3D chart.
2870
+ *
2871
+ * @since 4.0
2872
+ * @product highcharts
2873
+ * @apioption chart.options3d.frame.side
2874
+ */
2875
+
2876
+ /**
2877
+ * The color of the panel.
2878
+ *
2879
+ * @type {Color}
2880
+ * @default transparent
2881
+ * @since 4.0
2882
+ * @product highcharts
2883
+ * @apioption chart.options3d.frame.side.color
2884
+ */
2885
+
2886
+ /**
2887
+ * The thickness of the panel.
2888
+ *
2889
+ * @type {Number}
2890
+ * @default 1
2891
+ * @since 4.0
2892
+ * @product highcharts
2893
+ * @apioption chart.options3d.frame.side.size
2894
+ */
2895
+
2678
2896
 
2679
2897
  }(Highcharts));
2680
2898
  (function(H) {
2681
2899
  /**
2682
2900
  * (c) 2010-2017 Torstein Honsi
2683
2901
  *
2902
+ * Extenstion for 3d axes
2903
+ *
2684
2904
  * License: www.highcharts.com/license
2685
2905
  */
2686
2906
  var ZAxis,
2687
2907
 
2688
2908
  Axis = H.Axis,
2689
2909
  Chart = H.Chart,
2910
+ deg2rad = H.deg2rad,
2690
2911
  each = H.each,
2691
2912
  extend = H.extend,
2692
2913
  merge = H.merge,
2693
2914
  perspective = H.perspective,
2694
2915
  pick = H.pick,
2916
+ shapeArea = H.shapeArea,
2695
2917
  splat = H.splat,
2696
2918
  Tick = H.Tick,
2697
2919
  wrap = H.wrap;
2698
- /***
2699
- EXTENSION TO THE AXIS
2700
- ***/
2920
+
2921
+ /**
2922
+ * Options to render axis in 3 dimensions.
2923
+ * @optionparent xAxis
2924
+ */
2925
+ var extendedOptions = {
2926
+ labels: {
2927
+ /**
2928
+ * Defines how the labels are be repositioned according to the 3D chart
2929
+ * orientation.
2930
+ * - `'offset'`: Maintain a fixed horizontal/vertical distance from the
2931
+ * tick marks, despite the chart orientation. This is the backwards
2932
+ * compatible behavior, and causes skewing of X and Z axes.
2933
+ * - `'chart'`: Preserve 3D position relative to the chart.
2934
+ * This looks nice, but hard to read if the text isn't
2935
+ * forward-facing.
2936
+ * - `'flap'`: Rotated text along the axis to compensate for the chart
2937
+ * orientation. This tries to maintain text as legible as possible on
2938
+ * all orientations.
2939
+ * - `'ortho'`: Rotated text along the axis direction so that the labels
2940
+ * are orthogonal to the axis. This is very similar to `'flap'`, but
2941
+ * prevents skewing the labels (X and Y scaling are still present).
2942
+ *
2943
+ * @validvalue ['offset', 'chart', 'flap', 'ortho']
2944
+ * @sample highcharts/3d/skewed-labels/ Skewed labels
2945
+ * @since 5.0.15
2946
+ * @product highcharts
2947
+ */
2948
+ position3d: 'offset',
2949
+
2950
+ /**
2951
+ * If enabled, the axis labels will skewed to follow the perspective.
2952
+ *
2953
+ * This will fix overlapping labels and titles, but texts become less
2954
+ * legible due to the distortion.
2955
+ *
2956
+ * The final appearance depends heavily on `labels.position3d`.
2957
+ *
2958
+ * @since 5.0.15
2959
+ * @sample highcharts/3d/skewed-labels/ Skewed labels
2960
+ * @product highcharts
2961
+ */
2962
+ skew3d: false
2963
+ },
2964
+ title: {
2965
+ /**
2966
+ * Defines how the title is repositioned according to the 3D chart
2967
+ * orientation.
2968
+ * - `'offset'`: Maintain a fixed horizontal/vertical distance from the
2969
+ * tick marks, despite the chart orientation. This is the backwards
2970
+ * compatible behavior, and causes skewing of X and Z axes.
2971
+ * - `'chart'`: Preserve 3D position relative to the chart.
2972
+ * This looks nice, but hard to read if the text isn't
2973
+ * forward-facing.
2974
+ * - `'flap'`: Rotated text along the axis to compensate for the chart
2975
+ * orientation. This tries to maintain text as legible as possible on
2976
+ * all orientations.
2977
+ * - `'ortho'`: Rotated text along the axis direction so that the labels
2978
+ * are orthogonal to the axis. This is very similar to `'flap'`, but
2979
+ * prevents skewing the labels (X and Y scaling are still present).
2980
+ * - `null`: Will use the config from `labels.position3d`
2981
+ *
2982
+ * @validvalue ['offset', 'chart', 'flap', 'ortho', null]
2983
+ * @type {String}
2984
+ * @since 5.0.15
2985
+ * @sample highcharts/3d/skewed-labels/ Skewed labels
2986
+ * @product highcharts
2987
+ */
2988
+ position3d: null,
2989
+
2990
+ /**
2991
+ * If enabled, the axis title will skewed to follow the perspective.
2992
+ *
2993
+ * This will fix overlapping labels and titles, but texts become less
2994
+ * legible due to the distortion.
2995
+ *
2996
+ * The final appearance depends heavily on `title.position3d`.
2997
+ *
2998
+ * A `null` value will use the config from `labels.skew3d`.
2999
+ *
3000
+ * @validvalue [false, true, null]
3001
+ * @type {Boolean}
3002
+ * @sample highcharts/3d/skewed-labels/ Skewed labels
3003
+ * @since 5.0.15
3004
+ * @product highcharts
3005
+ */
3006
+ skew3d: null
3007
+ }
3008
+ };
3009
+
3010
+ merge(true, Axis.prototype.defaultOptions, extendedOptions);
3011
+
3012
+
2701
3013
  wrap(Axis.prototype, 'setOptions', function(proceed, userOptions) {
2702
3014
  var options;
2703
3015
  proceed.call(this, userOptions);
@@ -2797,7 +3109,12 @@
2797
3109
 
2798
3110
  // Do not draw axislines in 3D
2799
3111
  wrap(Axis.prototype, 'getLinePath', function(proceed) {
2800
- return this.chart.is3d() ? [] : proceed.apply(this, [].slice.call(arguments, 1));
3112
+ // Do not do this if the chart is not 3D
3113
+ if (!this.chart.is3d() || this.coll === 'colorAxis') {
3114
+ return proceed.apply(this, [].slice.call(arguments, 1));
3115
+ }
3116
+
3117
+ return [];
2801
3118
  });
2802
3119
 
2803
3120
  wrap(Axis.prototype, 'getPlotBandPath', function(proceed) {
@@ -2828,84 +3145,259 @@
2828
3145
  });
2829
3146
 
2830
3147
 
2831
- function fix3dPosition(axis, pos) {
2832
- if (axis.chart.is3d() && axis.coll !== 'colorAxis') {
2833
- var chart = axis.chart,
2834
- frame = chart.frame3d,
2835
- plotLeft = chart.plotLeft,
2836
- plotRight = chart.plotWidth + plotLeft,
2837
- plotTop = chart.plotTop,
2838
- plotBottom = chart.plotHeight + plotTop,
2839
- dx = 0,
2840
- dy = 0;
2841
-
2842
- pos = axis.swapZ({
2843
- x: pos.x,
2844
- y: pos.y,
3148
+ function fix3dPosition(axis, pos, isTitle) {
3149
+ // Do not do this if the chart is not 3D
3150
+ if (!axis.chart.is3d() || axis.coll === 'colorAxis') {
3151
+ return pos;
3152
+ }
3153
+
3154
+ var chart = axis.chart,
3155
+ alpha = deg2rad * chart.options.chart.options3d.alpha,
3156
+ beta = deg2rad * chart.options.chart.options3d.beta,
3157
+ positionMode = pick(
3158
+ isTitle && axis.options.title.position3d,
3159
+ axis.options.labels.position3d
3160
+ ),
3161
+ skew = pick(
3162
+ isTitle && axis.options.title.skew3d,
3163
+ axis.options.labels.skew3d
3164
+ ),
3165
+ frame = chart.frame3d,
3166
+ plotLeft = chart.plotLeft,
3167
+ plotRight = chart.plotWidth + plotLeft,
3168
+ plotTop = chart.plotTop,
3169
+ plotBottom = chart.plotHeight + plotTop,
3170
+ // Indicates we are labelling an X or Z axis on the "back" of the chart
3171
+ reverseFlap = false,
3172
+ offsetX = 0,
3173
+ offsetY = 0,
3174
+ vecX,
3175
+ vecY = {
3176
+ x: 0,
3177
+ y: 1,
2845
3178
  z: 0
2846
- });
3179
+ };
2847
3180
 
3181
+ pos = axis.swapZ({
3182
+ x: pos.x,
3183
+ y: pos.y,
3184
+ z: 0
3185
+ });
2848
3186
 
2849
- if (axis.isZAxis) { // Z Axis
2850
- if (axis.opposite) {
2851
- if (frame.axes.z.top === null) {
2852
- return {};
2853
- }
2854
- dy = pos.y - plotTop;
2855
- pos.x = frame.axes.z.top.x;
2856
- pos.y = frame.axes.z.top.y;
2857
- } else {
2858
- if (frame.axes.z.bottom === null) {
2859
- return {};
2860
- }
2861
- dy = pos.y - plotBottom;
2862
- pos.x = frame.axes.z.bottom.x;
2863
- pos.y = frame.axes.z.bottom.y;
3187
+
3188
+ if (axis.isZAxis) { // Z Axis
3189
+ if (axis.opposite) {
3190
+ if (frame.axes.z.top === null) {
3191
+ return {};
2864
3192
  }
2865
- } else if (axis.horiz) { // X Axis
2866
- if (axis.opposite) {
2867
- if (frame.axes.x.top === null) {
2868
- return {};
2869
- }
2870
- dy = pos.y - plotTop;
2871
- pos.y = frame.axes.x.top.y;
2872
- pos.z = frame.axes.x.top.z;
2873
- } else {
2874
- if (frame.axes.x.bottom === null) {
2875
- return {};
2876
- }
2877
- dy = pos.y - plotBottom;
2878
- pos.y = frame.axes.x.bottom.y;
2879
- pos.z = frame.axes.x.bottom.z;
3193
+ offsetY = pos.y - plotTop;
3194
+ pos.x = frame.axes.z.top.x;
3195
+ pos.y = frame.axes.z.top.y;
3196
+ vecX = frame.axes.z.top.xDir;
3197
+ reverseFlap = !frame.top.frontFacing;
3198
+ } else {
3199
+ if (frame.axes.z.bottom === null) {
3200
+ return {};
3201
+ }
3202
+ offsetY = pos.y - plotBottom;
3203
+ pos.x = frame.axes.z.bottom.x;
3204
+ pos.y = frame.axes.z.bottom.y;
3205
+ vecX = frame.axes.z.bottom.xDir;
3206
+ reverseFlap = !frame.bottom.frontFacing;
3207
+ }
3208
+ } else if (axis.horiz) { // X Axis
3209
+ if (axis.opposite) {
3210
+ if (frame.axes.x.top === null) {
3211
+ return {};
3212
+ }
3213
+ offsetY = pos.y - plotTop;
3214
+ pos.y = frame.axes.x.top.y;
3215
+ pos.z = frame.axes.x.top.z;
3216
+ vecX = frame.axes.x.top.xDir;
3217
+ reverseFlap = !frame.top.frontFacing;
3218
+ } else {
3219
+ if (frame.axes.x.bottom === null) {
3220
+ return {};
3221
+ }
3222
+ offsetY = pos.y - plotBottom;
3223
+ pos.y = frame.axes.x.bottom.y;
3224
+ pos.z = frame.axes.x.bottom.z;
3225
+ vecX = frame.axes.x.bottom.xDir;
3226
+ reverseFlap = !frame.bottom.frontFacing;
3227
+ }
3228
+ } else { // Y Axis
3229
+ if (axis.opposite) {
3230
+ if (frame.axes.y.right === null) {
3231
+ return {};
3232
+ }
3233
+ offsetX = pos.x - plotRight;
3234
+ pos.x = frame.axes.y.right.x;
3235
+ pos.z = frame.axes.y.right.z;
3236
+ vecX = frame.axes.y.right.xDir;
3237
+ // Rotate 90º on opposite edge
3238
+ vecX = {
3239
+ x: vecX.z,
3240
+ y: vecX.y,
3241
+ z: -vecX.x
3242
+ };
3243
+ } else {
3244
+ if (frame.axes.y.left === null) {
3245
+ return {};
2880
3246
  }
2881
- } else { //Y Axis
3247
+ offsetX = pos.x - plotLeft;
3248
+ pos.x = frame.axes.y.left.x;
3249
+ pos.z = frame.axes.y.left.z;
3250
+ vecX = frame.axes.y.left.xDir;
3251
+ }
3252
+ }
3253
+
3254
+ if (positionMode === 'chart') {
3255
+ // Labels preserve their direction relative to the chart
3256
+ // nothing to do
3257
+
3258
+ } else if (positionMode === 'flap') {
3259
+ // Labels are be rotated around the axis direction to face the screen
3260
+ if (!axis.horiz) { // Y Axis
3261
+ vecX = {
3262
+ x: Math.cos(beta),
3263
+ y: 0,
3264
+ z: Math.sin(beta)
3265
+ };
3266
+ } else { // X and Z Axis
3267
+ var sin = Math.sin(alpha);
3268
+ var cos = Math.cos(alpha);
2882
3269
  if (axis.opposite) {
2883
- if (frame.axes.y.right === null) {
2884
- return {};
2885
- }
2886
- dx = pos.x - plotRight;
2887
- pos.x = frame.axes.y.right.x;
2888
- pos.z = frame.axes.y.right.z;
2889
- } else {
2890
- if (frame.axes.y.left === null) {
2891
- return {};
2892
- }
2893
- dx = pos.x - plotLeft;
2894
- pos.x = frame.axes.y.left.x;
2895
- pos.z = frame.axes.y.left.z;
3270
+ sin = -sin;
3271
+ }
3272
+ if (reverseFlap) {
3273
+ sin = -sin;
3274
+ }
3275
+ vecY = {
3276
+ x: vecX.z * sin,
3277
+ y: cos,
3278
+ z: -vecX.x * sin
3279
+ };
3280
+ }
3281
+ } else if (positionMode === 'ortho') {
3282
+ // Labels will be rotated to be ortogonal to the axis
3283
+ if (!axis.horiz) { // Y Axis
3284
+ vecX = {
3285
+ x: Math.cos(beta),
3286
+ y: 0,
3287
+ z: Math.sin(beta)
3288
+ };
3289
+ } else { // X and Z Axis
3290
+ var sina = Math.sin(alpha);
3291
+ var cosa = Math.cos(alpha);
3292
+ var sinb = Math.sin(beta);
3293
+ var cosb = Math.cos(beta);
3294
+ var vecZ = {
3295
+ x: sinb * cosa,
3296
+ y: -sina,
3297
+ z: -cosa * cosb
3298
+ };
3299
+ vecY = {
3300
+ x: vecX.y * vecZ.z - vecX.z * vecZ.y,
3301
+ y: vecX.z * vecZ.x - vecX.x * vecZ.z,
3302
+ z: vecX.x * vecZ.y - vecX.y * vecZ.x
3303
+ };
3304
+ var scale = 1 / Math.sqrt(
3305
+ vecY.x * vecY.x + vecY.y * vecY.y + vecY.z * vecY.z
3306
+ );
3307
+ if (reverseFlap) {
3308
+ scale = -scale;
2896
3309
  }
3310
+ vecY = {
3311
+ x: scale * vecY.x,
3312
+ y: scale * vecY.y,
3313
+ z: scale * vecY.z
3314
+ };
3315
+ }
3316
+ } else { // positionMode == 'offset'
3317
+ // Labels will be skewd to maintain vertical / horizontal offsets from
3318
+ // axis
3319
+ if (!axis.horiz) { // Y Axis
3320
+ vecX = {
3321
+ x: Math.cos(beta),
3322
+ y: 0,
3323
+ z: Math.sin(beta)
3324
+ };
3325
+ } else { // X and Z Axis
3326
+ vecY = {
3327
+ x: Math.sin(beta) * Math.sin(alpha),
3328
+ y: Math.cos(alpha),
3329
+ z: -Math.cos(beta) * Math.sin(alpha)
3330
+ };
2897
3331
  }
2898
- pos = perspective([pos], axis.chart)[0];
2899
- pos.x += dx;
2900
- pos.y += dy;
2901
3332
  }
2902
- return pos;
2903
- }
3333
+ pos.x += offsetX * vecX.x + offsetY * vecY.x;
3334
+ pos.y += offsetX * vecX.y + offsetY * vecY.y;
3335
+ pos.z += offsetX * vecX.z + offsetY * vecY.z;
3336
+
3337
+ var projected = perspective([pos], axis.chart)[0];
3338
+
3339
+ if (skew) {
3340
+ // Check if the label text would be mirrored
3341
+ var isMirrored = shapeArea(perspective([
3342
+ pos,
3343
+ {
3344
+ x: pos.x + vecX.x,
3345
+ y: pos.y + vecX.y,
3346
+ z: pos.z + vecX.z
3347
+ },
3348
+ {
3349
+ x: pos.x + vecY.x,
3350
+ y: pos.y + vecY.y,
3351
+ z: pos.z + vecY.z
3352
+ }
3353
+ ], axis.chart)) < 0;
3354
+ if (isMirrored) {
3355
+ vecX = {
3356
+ x: -vecX.x,
3357
+ y: -vecX.y,
3358
+ z: -vecX.z
3359
+ };
3360
+ }
2904
3361
 
2905
- /***
2906
- EXTENSION TO THE TICKS
2907
- ***/
3362
+ var pointsProjected = perspective([{
3363
+ x: pos.x,
3364
+ y: pos.y,
3365
+ z: pos.z
3366
+ },
3367
+ {
3368
+ x: pos.x + vecX.x,
3369
+ y: pos.y + vecX.y,
3370
+ z: pos.z + vecX.z
3371
+ },
3372
+ {
3373
+ x: pos.x + vecY.x,
3374
+ y: pos.y + vecY.y,
3375
+ z: pos.z + vecY.z
3376
+ }
3377
+ ], axis.chart);
3378
+
3379
+ projected.matrix = [
3380
+ pointsProjected[1].x - pointsProjected[0].x,
3381
+ pointsProjected[1].y - pointsProjected[0].y,
3382
+ pointsProjected[2].x - pointsProjected[0].x,
3383
+ pointsProjected[2].y - pointsProjected[0].y,
3384
+ projected.x,
3385
+ projected.y
3386
+ ];
3387
+ projected.matrix[4] -= projected.x * projected.matrix[0] +
3388
+ projected.y * projected.matrix[2];
3389
+ projected.matrix[5] -= projected.x * projected.matrix[1] +
3390
+ projected.y * projected.matrix[3];
3391
+ } else {
3392
+ projected.matrix = null;
3393
+ }
3394
+
3395
+ return projected;
3396
+ }
2908
3397
 
3398
+ /*
3399
+ Tick extensions
3400
+ */
2909
3401
  wrap(Tick.prototype, 'getMarkPath', function(proceed) {
2910
3402
  var path = proceed.apply(this, [].slice.call(arguments, 1));
2911
3403
 
@@ -2930,14 +3422,14 @@
2930
3422
  return fix3dPosition(this.axis, pos);
2931
3423
  });
2932
3424
 
2933
- H.wrap(Axis.prototype, 'getTitlePosition', function(proceed) {
3425
+ wrap(Axis.prototype, 'getTitlePosition', function(proceed) {
2934
3426
  var pos = proceed.apply(this, [].slice.call(arguments, 1));
2935
- return fix3dPosition(this, pos);
3427
+ return fix3dPosition(this, pos, true);
2936
3428
  });
2937
3429
 
2938
3430
  wrap(Axis.prototype, 'drawCrosshair', function(proceed) {
2939
3431
  var args = arguments;
2940
- if (this.chart.is3d()) {
3432
+ if (this.chart.is3d() && this.coll !== 'colorAxis') {
2941
3433
  if (args[2]) {
2942
3434
  args[2] = {
2943
3435
  plotX: args[2].plotXold || args[2].plotX,
@@ -2957,9 +3449,9 @@
2957
3449
  proceed.apply(this, [].slice.call(arguments, 1));
2958
3450
  });
2959
3451
 
2960
- /***
2961
- Z-AXIS
2962
- ***/
3452
+ /*
3453
+ Z-AXIS
3454
+ */
2963
3455
 
2964
3456
  Axis.prototype.swapZ = function(p, insidePlotArea) {
2965
3457
  if (this.isZAxis) {
@@ -2999,7 +3491,10 @@
2999
3491
  axis.hasVisibleSeries = false;
3000
3492
 
3001
3493
  // Reset properties in case we're redrawing (#3353)
3002
- axis.dataMin = axis.dataMax = axis.ignoreMinPadding = axis.ignoreMaxPadding = null;
3494
+ axis.dataMin =
3495
+ axis.dataMax =
3496
+ axis.ignoreMinPadding =
3497
+ axis.ignoreMaxPadding = null;
3003
3498
 
3004
3499
  if (axis.buildStacks) {
3005
3500
  axis.buildStacks();
@@ -3023,8 +3518,14 @@
3023
3518
 
3024
3519
  zData = series.zData;
3025
3520
  if (zData.length) {
3026
- axis.dataMin = Math.min(pick(axis.dataMin, zData[0]), Math.min.apply(null, zData));
3027
- axis.dataMax = Math.max(pick(axis.dataMax, zData[0]), Math.max.apply(null, zData));
3521
+ axis.dataMin = Math.min(
3522
+ pick(axis.dataMin, zData[0]),
3523
+ Math.min.apply(null, zData)
3524
+ );
3525
+ axis.dataMax = Math.max(
3526
+ pick(axis.dataMax, zData[0]),
3527
+ Math.max.apply(null, zData)
3528
+ );
3028
3529
  }
3029
3530
  }
3030
3531
  });
@@ -3048,12 +3549,87 @@
3048
3549
  this.zAxis = [];
3049
3550
  each(zAxisOptions, function(axisOptions, i) {
3050
3551
  axisOptions.index = i;
3051
- axisOptions.isX = true; //Z-Axis is shown horizontally, so it's kind of a X-Axis
3552
+ // Z-Axis is shown horizontally, so it's kind of a X-Axis
3553
+ axisOptions.isX = true;
3052
3554
  var zAxis = new ZAxis(chart, axisOptions);
3053
3555
  zAxis.setScale();
3054
3556
  });
3055
3557
  });
3056
3558
 
3559
+ }(Highcharts));
3560
+ (function(H) {
3561
+ /**
3562
+ * (c) 2010-2017 Torstein Honsi
3563
+ *
3564
+ * Extension to the Series object in 3D charts.
3565
+ *
3566
+ * License: www.highcharts.com/license
3567
+ */
3568
+ var perspective = H.perspective,
3569
+ pick = H.pick,
3570
+ wrap = H.wrap;
3571
+
3572
+ // Wrap the translate method to post-translate points into 3D perspective
3573
+ wrap(H.Series.prototype, 'translate', function(proceed) {
3574
+ proceed.apply(this, [].slice.call(arguments, 1));
3575
+
3576
+ if (this.chart.is3d()) {
3577
+ this.translate3dPoints();
3578
+ }
3579
+
3580
+ });
3581
+
3582
+ /**
3583
+ * Translate the plotX, plotY properties and add plotZ.
3584
+ */
3585
+ H.Series.prototype.translate3dPoints = function() {
3586
+ var series = this,
3587
+ chart = series.chart,
3588
+ zAxis = pick(series.zAxis, chart.options.zAxis[0]),
3589
+ rawPoints = [],
3590
+ rawPoint,
3591
+ projectedPoints,
3592
+ projectedPoint,
3593
+ zValue,
3594
+ i;
3595
+
3596
+ for (i = 0; i < series.data.length; i++) {
3597
+ rawPoint = series.data[i];
3598
+
3599
+ if (zAxis && zAxis.translate) {
3600
+ zValue = zAxis.isLog && zAxis.val2lin ?
3601
+ zAxis.val2lin(rawPoint.z) :
3602
+ rawPoint.z; // #4562
3603
+ rawPoint.plotZ = zAxis.translate(zValue);
3604
+ rawPoint.isInside = rawPoint.isInside ?
3605
+ (zValue >= zAxis.min && zValue <= zAxis.max) :
3606
+ false;
3607
+ }
3608
+
3609
+ rawPoints.push({
3610
+ x: pick(rawPoint.plotXold, rawPoint.plotX),
3611
+ y: pick(rawPoint.plotYold, rawPoint.plotY),
3612
+ z: pick(rawPoint.plotZold, rawPoint.plotZ)
3613
+ });
3614
+ }
3615
+
3616
+ projectedPoints = perspective(rawPoints, chart, true);
3617
+
3618
+ for (i = 0; i < series.data.length; i++) {
3619
+ rawPoint = series.data[i];
3620
+ projectedPoint = projectedPoints[i];
3621
+
3622
+ rawPoint.plotXold = rawPoint.plotX;
3623
+ rawPoint.plotYold = rawPoint.plotY;
3624
+ rawPoint.plotZold = rawPoint.plotZ;
3625
+
3626
+ rawPoint.plotX = projectedPoint.x;
3627
+ rawPoint.plotY = projectedPoint.y;
3628
+ rawPoint.plotZ = projectedPoint.z;
3629
+ }
3630
+ };
3631
+
3632
+
3057
3633
  }(Highcharts));
3058
3634
  (function(H) {
3059
3635
  /**
@@ -3070,16 +3646,59 @@
3070
3646
  svg = H.svg,
3071
3647
  wrap = H.wrap;
3072
3648
 
3073
- /***
3074
- EXTENSION FOR 3D COLUMNS
3075
- ***/
3649
+
3650
+
3651
+ /**
3652
+ * Depth of the columns in a 3D column chart. Requires `highcharts-3d.
3653
+ * js`.
3654
+ *
3655
+ * @type {Number}
3656
+ * @default 25
3657
+ * @since 4.0
3658
+ * @product highcharts
3659
+ * @apioption plotOptions.column.depth
3660
+ */
3661
+
3662
+ /**
3663
+ * 3D columns only. The color of the edges. Similar to `borderColor`,
3664
+ * except it defaults to the same color as the column.
3665
+ *
3666
+ * @type {Color}
3667
+ * @product highcharts
3668
+ * @apioption plotOptions.column.edgeColor
3669
+ */
3670
+
3671
+ /**
3672
+ * 3D columns only. The width of the colored edges.
3673
+ *
3674
+ * @type {Number}
3675
+ * @default 1
3676
+ * @product highcharts
3677
+ * @apioption plotOptions.column.edgeWidth
3678
+ */
3679
+
3680
+ /**
3681
+ * The spacing between columns on the Z Axis in a 3D chart. Requires
3682
+ * `highcharts-3d.js`.
3683
+ *
3684
+ * @type {Number}
3685
+ * @default 1
3686
+ * @since 4.0
3687
+ * @product highcharts
3688
+ * @apioption plotOptions.column.groupZPadding
3689
+ */
3690
+
3076
3691
  wrap(seriesTypes.column.prototype, 'translate', function(proceed) {
3077
3692
  proceed.apply(this, [].slice.call(arguments, 1));
3078
3693
 
3079
3694
  // Do not do this if the chart is not 3D
3080
- if (!this.chart.is3d()) {
3081
- return;
3695
+ if (this.chart.is3d()) {
3696
+ this.translate3dShapes();
3082
3697
  }
3698
+ });
3699
+
3700
+ seriesTypes.column.prototype.translate3dPoints = function() {};
3701
+ seriesTypes.column.prototype.translate3dShapes = function() {
3083
3702
 
3084
3703
  var series = this,
3085
3704
  chart = series.chart,
@@ -3159,7 +3778,7 @@
3159
3778
  });
3160
3779
  // store for later use #4067
3161
3780
  series.z = z;
3162
- });
3781
+ };
3163
3782
 
3164
3783
  wrap(seriesTypes.column.prototype, 'animate', function(proceed) {
3165
3784
  if (!this.chart.is3d()) {
@@ -3176,7 +3795,7 @@
3176
3795
  each(series.data, function(point) {
3177
3796
  if (point.y !== null) {
3178
3797
  point.height = point.shapeArgs.height;
3179
- point.shapey = point.shapeArgs.y; //#2968
3798
+ point.shapey = point.shapeArgs.y; // #2968
3180
3799
  point.shapeArgs.height = 1;
3181
3800
  if (!reversed) {
3182
3801
  if (point.stackY) {
@@ -3192,7 +3811,7 @@
3192
3811
  each(series.data, function(point) {
3193
3812
  if (point.y !== null) {
3194
3813
  point.shapeArgs.height = point.height;
3195
- point.shapeArgs.y = point.shapey; //#2968
3814
+ point.shapeArgs.y = point.shapey; // #2968
3196
3815
  // null value do not have a graphic
3197
3816
  if (point.graphic) {
3198
3817
  point.graphic.animate(point.shapeArgs, series.options.animation);
@@ -3218,8 +3837,11 @@
3218
3837
 
3219
3838
  wrap(seriesTypes.column.prototype, 'plotGroup', function(proceed, prop, name, visibility, zIndex, parent) {
3220
3839
  if (this.chart.is3d() && parent && !this[prop]) {
3221
- this[prop] = parent;
3222
- parent.attr(this.getPlotBox());
3840
+ if (!this.chart.columnGroup) {
3841
+ this.chart.columnGroup = this.chart.renderer.g('columnGroup').add(parent);
3842
+ }
3843
+ this[prop] = this.chart.columnGroup;
3844
+ this.chart.columnGroup.attr(this.getPlotBox());
3223
3845
  this[prop].survive = true;
3224
3846
  }
3225
3847
  return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
@@ -3342,10 +3964,10 @@
3342
3964
  return stackBox;
3343
3965
  });
3344
3966
 
3345
- /***
3967
+ /*
3346
3968
  EXTENSION FOR 3D CYLINDRICAL COLUMNS
3347
3969
  Not supported
3348
- ***/
3970
+ */
3349
3971
  /*
3350
3972
  var defaultOptions = H.getOptions();
3351
3973
  defaultOptions.plotOptions.cylinder = H.merge(defaultOptions.plotOptions.column);
@@ -3397,6 +4019,8 @@
3397
4019
  /**
3398
4020
  * (c) 2010-2017 Torstein Honsi
3399
4021
  *
4022
+ * 3D pie series
4023
+ *
3400
4024
  * License: www.highcharts.com/license
3401
4025
  */
3402
4026
  var deg2rad = H.deg2rad,
@@ -3406,9 +4030,16 @@
3406
4030
  svg = H.svg,
3407
4031
  wrap = H.wrap;
3408
4032
 
3409
- /***
3410
- EXTENSION FOR 3D PIES
3411
- ***/
4033
+
4034
+ /**
4035
+ * The thickness of a 3D pie. Requires `highcharts-3d.js`
4036
+ *
4037
+ * @type {Number}
4038
+ * @default 0
4039
+ * @since 4.0
4040
+ * @product highcharts
4041
+ * @apioption plotOptions.pie.depth
4042
+ */
3412
4043
 
3413
4044
  wrap(seriesTypes.pie.prototype, 'translate', function(proceed) {
3414
4045
  proceed.apply(this, [].slice.call(arguments, 1));
@@ -3497,7 +4128,7 @@
3497
4128
  each(series.data, function(point) {
3498
4129
  var shapeArgs = point.shapeArgs,
3499
4130
  r = shapeArgs.r,
3500
- a1 = (shapeArgs.alpha || options3d.alpha) * deg2rad, //#3240 issue with datalabels for 0 and null values
4131
+ a1 = (shapeArgs.alpha || options3d.alpha) * deg2rad, // #3240 issue with datalabels for 0 and null values
3501
4132
  b1 = (shapeArgs.beta || options3d.beta) * deg2rad,
3502
4133
  a2 = (shapeArgs.start + shapeArgs.end) / 2,
3503
4134
  labelPos = point.labelPos,
@@ -3587,115 +4218,136 @@
3587
4218
  /**
3588
4219
  * (c) 2010-2017 Torstein Honsi
3589
4220
  *
4221
+ * Scatter 3D series.
4222
+ *
3590
4223
  * License: www.highcharts.com/license
3591
4224
  */
3592
- var perspective = H.perspective,
3593
- pick = H.pick,
3594
- Point = H.Point,
3595
- seriesTypes = H.seriesTypes,
3596
- wrap = H.wrap;
3597
-
3598
- /***
3599
- EXTENSION FOR 3D SCATTER CHART
3600
- ***/
3601
-
3602
- wrap(seriesTypes.scatter.prototype, 'translate', function(proceed) {
3603
- //function translate3d(proceed) {
3604
- proceed.apply(this, [].slice.call(arguments, 1));
3605
-
3606
- if (!this.chart.is3d()) {
3607
- return;
3608
- }
3609
-
3610
- var series = this,
3611
- chart = series.chart,
3612
- zAxis = pick(series.zAxis, chart.options.zAxis[0]),
3613
- rawPoints = [],
3614
- rawPoint,
3615
- projectedPoints,
3616
- projectedPoint,
3617
- zValue,
3618
- i;
4225
+ var Point = H.Point,
4226
+ seriesType = H.seriesType,
4227
+ seriesTypes = H.seriesTypes;
3619
4228
 
3620
- for (i = 0; i < series.data.length; i++) {
3621
- rawPoint = series.data[i];
3622
- zValue = zAxis.isLog && zAxis.val2lin ? zAxis.val2lin(rawPoint.z) : rawPoint.z; // #4562
3623
- rawPoint.plotZ = zAxis.translate(zValue);
3624
-
3625
- rawPoint.isInside = rawPoint.isInside ? (zValue >= zAxis.min && zValue <= zAxis.max) : false;
3626
-
3627
- rawPoints.push({
3628
- x: rawPoint.plotX,
3629
- y: rawPoint.plotY,
3630
- z: rawPoint.plotZ
3631
- });
4229
+ /**
4230
+ * A 3D scatter plot uses x, y and z coordinates to display values for three
4231
+ * variables for a set of data.
4232
+ *
4233
+ * @sample {highcharts} highcharts/3d/scatter/
4234
+ * Simple 3D scatter
4235
+ * @sample {highcharts} highcharts/demo/3d-scatter-draggable
4236
+ * Draggable 3d scatter
4237
+ *
4238
+ * @extends {plotOptions.scatter}
4239
+ * @product highcharts
4240
+ * @optionparent plotOptions.scatter3d
4241
+ */
4242
+ seriesType('scatter3d', 'scatter', {
4243
+ tooltip: {
4244
+ pointFormat: 'x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>z: <b>{point.z}</b><br/>'
3632
4245
  }
3633
4246
 
3634
- projectedPoints = perspective(rawPoints, chart, true);
4247
+ // Series class
4248
+ }, {
4249
+ pointAttribs: function(point) {
4250
+ var attribs = seriesTypes.scatter.prototype.pointAttribs
4251
+ .apply(this, arguments);
3635
4252
 
3636
- for (i = 0; i < series.data.length; i++) {
3637
- rawPoint = series.data[i];
3638
- projectedPoint = projectedPoints[i];
3639
-
3640
- rawPoint.plotXold = rawPoint.plotX;
3641
- rawPoint.plotYold = rawPoint.plotY;
3642
- rawPoint.plotZold = rawPoint.plotZ;
4253
+ if (this.chart.is3d() && point) {
4254
+ attribs.zIndex = H.pointCameraDistance(point, this.chart);
4255
+ }
3643
4256
 
3644
- rawPoint.plotX = projectedPoint.x;
3645
- rawPoint.plotY = projectedPoint.y;
3646
- rawPoint.plotZ = projectedPoint.z;
4257
+ return attribs;
4258
+ },
4259
+ axisTypes: ['xAxis', 'yAxis', 'zAxis'],
4260
+ pointArrayMap: ['x', 'y', 'z'],
4261
+ parallelArrays: ['x', 'y', 'z'],
4262
+
4263
+ // Require direct touch rather than using the k-d-tree, because the k-d-tree
4264
+ // currently doesn't take the xyz coordinate system into account (#4552)
4265
+ directTouch: true
4266
+
4267
+ // Point class
4268
+ }, {
4269
+ applyOptions: function() {
4270
+ Point.prototype.applyOptions.apply(this, arguments);
4271
+ if (this.z === undefined) {
4272
+ this.z = 0;
4273
+ }
3647
4274
 
4275
+ return this;
3648
4276
  }
3649
4277
 
3650
4278
  });
3651
4279
 
3652
4280
 
3653
- wrap(seriesTypes.scatter.prototype, 'init', function(proceed, chart, options) {
3654
- if (chart.is3d()) {
3655
- // add a third coordinate
3656
- this.axisTypes = ['xAxis', 'yAxis', 'zAxis'];
3657
- this.pointArrayMap = ['x', 'y', 'z'];
3658
- this.parallelArrays = ['x', 'y', 'z'];
3659
-
3660
- // Require direct touch rather than using the k-d-tree, because the k-d-tree currently doesn't
3661
- // take the xyz coordinate system into account (#4552)
3662
- this.directTouch = true;
3663
- }
3664
-
3665
- var result = proceed.apply(this, [chart, options]);
3666
-
3667
- if (this.chart.is3d()) {
3668
- // Set a new default tooltip formatter
3669
- var default3dScatterTooltip = 'x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>z: <b>{point.z}</b><br/>';
3670
- if (this.userOptions.tooltip) {
3671
- this.tooltipOptions.pointFormat = this.userOptions.tooltip.pointFormat || default3dScatterTooltip;
3672
- } else {
3673
- this.tooltipOptions.pointFormat = default3dScatterTooltip;
3674
- }
3675
- }
3676
- return result;
3677
- });
3678
-
3679
4281
  /**
3680
- * Updating zIndex for every point - based on the distance from point to camera
4282
+ * A `scatter3d` series. If the [type](#series.scatter3d.type) option is
4283
+ * not specified, it is inherited from [chart.type](#chart.type).
4284
+ *
4285
+ * For options that apply to multiple series, it is recommended to add
4286
+ * them to the [plotOptions.series](#plotOptions.series) options structure.
4287
+ * To apply to all series of this specific type, apply it to [plotOptions.
4288
+ * scatter3d](#plotOptions.scatter3d).
4289
+ *
4290
+ * @type {Object}
4291
+ * @extends series,plotOptions.scatter3d
4292
+ * @product highcharts
4293
+ * @apioption series.scatter3d
3681
4294
  */
3682
- wrap(seriesTypes.scatter.prototype, 'pointAttribs', function(proceed, point) {
3683
- var pointOptions = proceed.apply(this, [].slice.call(arguments, 1));
3684
- if (this.chart.is3d() && point) {
3685
- pointOptions.zIndex = H.pointCameraDistance(point, this.chart);
3686
- }
3687
- return pointOptions;
3688
- });
3689
-
3690
4295
 
3691
- wrap(Point.prototype, 'applyOptions', function(proceed) {
3692
- var point = proceed.apply(this, [].slice.call(arguments, 1));
4296
+ /**
4297
+ * An array of data points for the series. For the `scatter3d` series
4298
+ * type, points can be given in the following ways:
4299
+ *
4300
+ * 1. An array of arrays with 3 values. In this case, the values correspond
4301
+ * to `x,y,z`. If the first value is a string, it is applied as the name
4302
+ * of the point, and the `x` value is inferred.
4303
+ *
4304
+ * ```js
4305
+ * data: [
4306
+ * [0, 0, 1],
4307
+ * [1, 8, 7],
4308
+ * [2, 9, 2]
4309
+ * ]
4310
+ * ```
4311
+ *
4312
+ * 3. An array of objects with named values. The objects are point
4313
+ * configuration objects as seen below. If the total number of data
4314
+ * points exceeds the series' [turboThreshold](#series.scatter3d.turboThreshold),
4315
+ * this option is not available.
4316
+ *
4317
+ * ```js
4318
+ * data: [{
4319
+ * x: 1,
4320
+ * y: 2,
4321
+ * z: 24,
4322
+ * name: "Point2",
4323
+ * color: "#00FF00"
4324
+ * }, {
4325
+ * x: 1,
4326
+ * y: 4,
4327
+ * z: 12,
4328
+ * name: "Point1",
4329
+ * color: "#FF00FF"
4330
+ * }]
4331
+ * ```
4332
+ *
4333
+ * @type {Array<Object|Array>}
4334
+ * @extends series.scatter.data
4335
+ * @sample {highcharts} highcharts/chart/reflow-true/ Numerical values
4336
+ * @sample {highcharts} highcharts/series/data-array-of-arrays/ Arrays of numeric x and y
4337
+ * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/ Arrays of datetime x and y
4338
+ * @sample {highcharts} highcharts/series/data-array-of-name-value/ Arrays of point.name and y
4339
+ * @sample {highcharts} highcharts/series/data-array-of-objects/ Config objects
4340
+ * @product highcharts
4341
+ * @apioption series.scatter3d.data
4342
+ */
3693
4343
 
3694
- if (this.series.chart.is3d() && point.z === undefined) {
3695
- point.z = 0;
3696
- }
3697
- return point;
3698
- });
4344
+ /**
4345
+ * The z value for each data point.
4346
+ *
4347
+ * @type {Number}
4348
+ * @product highcharts
4349
+ * @apioption series.scatter3d.data.z
4350
+ */
3699
4351
 
3700
4352
  }(Highcharts));
3701
4353
  (function(H) {
@@ -3726,7 +4378,8 @@
3726
4378
  VMLRenderer.prototype.toLinePath = SVGRenderer.prototype.toLinePath;
3727
4379
  VMLRenderer.prototype.toLineSegments = SVGRenderer.prototype.toLineSegments;
3728
4380
 
3729
- VMLRenderer.prototype.createElement3D = SVGRenderer.prototype.createElement3D;
4381
+ VMLRenderer.prototype.createElement3D =
4382
+ SVGRenderer.prototype.createElement3D;
3730
4383
 
3731
4384
  VMLRenderer.prototype.arc3d = function(shapeArgs) {
3732
4385
  var result = SVGRenderer.prototype.arc3d.call(this, shapeArgs);