heatmap.src.js 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518
  1. /**
  2. * @license Highcharts JS v6.1.0 (2018-04-13)
  3. *
  4. * (c) 2009-2017 Torstein Honsi
  5. *
  6. * License: www.highcharts.com/license
  7. */
  8. 'use strict';
  9. (function (factory) {
  10. if (typeof module === 'object' && module.exports) {
  11. module.exports = factory;
  12. } else {
  13. factory(Highcharts);
  14. }
  15. }(function (Highcharts) {
  16. (function (H) {
  17. /**
  18. * (c) 2010-2017 Torstein Honsi
  19. *
  20. * License: www.highcharts.com/license
  21. */
  22. var addEvent = H.addEvent,
  23. Axis = H.Axis,
  24. Chart = H.Chart,
  25. color = H.color,
  26. ColorAxis,
  27. each = H.each,
  28. extend = H.extend,
  29. isNumber = H.isNumber,
  30. Legend = H.Legend,
  31. LegendSymbolMixin = H.LegendSymbolMixin,
  32. noop = H.noop,
  33. merge = H.merge,
  34. pick = H.pick;
  35. // If ColorAxis already exists, we may be loading the heatmap module on top of
  36. // Highmaps.
  37. if (!H.ColorAxis) {
  38. /**
  39. * The ColorAxis object for inclusion in gradient legends
  40. */
  41. ColorAxis = H.ColorAxis = function () {
  42. this.init.apply(this, arguments);
  43. };
  44. extend(ColorAxis.prototype, Axis.prototype);
  45. extend(ColorAxis.prototype, {
  46. /**
  47. * A color axis for choropleth maps and heat maps. Visually, the color
  48. * axis will appear as a gradient or as separate items inside the
  49. * legend, depending on whether the axis is scalar or based on data
  50. * classes.
  51. *
  52. * For supported color formats, see the
  53. * [docs article about colors](http://www.highcharts.com/docs/chart-design-and-style/colors).
  54. *
  55. * A scalar color axis is represented by a gradient. The colors either
  56. * range between the [minColor](#colorAxis.minColor) and the
  57. * [maxColor](#colorAxis.maxColor), or for more fine grained control the
  58. * colors can be defined in [stops](#colorAxis.stops). Often times, the
  59. * color axis needs to be adjusted to get the right color spread for the
  60. * data. In addition to stops, consider using a logarithmic
  61. * [axis type](#colorAxis.type), or setting [min](#colorAxis.min) and
  62. * [max](#colorAxis.max) to avoid the colors being determined by
  63. * outliers.
  64. *
  65. * When [dataClasses](#colorAxis.dataClasses) are used, the ranges are
  66. * subdivided into separate classes like categories based on their
  67. * values. This can be used for ranges between two values, but also for
  68. * a true category. However, when your data is categorized, it may be as
  69. * convenient to add each category to a separate series.
  70. *
  71. * See [the Axis object](#Axis) for programmatic access to the axis.
  72. * @extends {xAxis}
  73. * @excluding allowDecimals,alternateGridColor,breaks,categories,
  74. * crosshair,dateTimeLabelFormats,lineWidth,linkedTo,maxZoom,
  75. * minRange,minTickInterval,offset,opposite,plotBands,
  76. * plotLines,showEmpty,title
  77. * @product highcharts highmaps
  78. * @optionparent colorAxis
  79. */
  80. defaultColorAxisOptions: {
  81. /**
  82. * Whether to allow decimals on the color axis.
  83. * @type {Boolean}
  84. * @default true
  85. * @product highcharts highmaps
  86. * @apioption colorAxis.allowDecimals
  87. */
  88. /**
  89. * Determines how to set each data class' color if no individual
  90. * color is set. The default value, `tween`, computes intermediate
  91. * colors between `minColor` and `maxColor`. The other possible
  92. * value, `category`, pulls colors from the global or chart specific
  93. * [colors](#colors) array.
  94. *
  95. * @validvalue ["tween", "category"]
  96. * @type {String}
  97. * @sample {highmaps} maps/coloraxis/dataclasscolor/ Category colors
  98. * @default tween
  99. * @product highcharts highmaps
  100. * @apioption colorAxis.dataClassColor
  101. */
  102. /**
  103. * An array of data classes or ranges for the choropleth map. If
  104. * none given, the color axis is scalar and values are distributed
  105. * as a gradient between the minimum and maximum colors.
  106. *
  107. * @type {Array<Object>}
  108. * @sample {highmaps} maps/demo/data-class-ranges/ Multiple ranges
  109. * @sample {highmaps} maps/demo/data-class-two-ranges/ Two ranges
  110. * @product highcharts highmaps
  111. * @apioption colorAxis.dataClasses
  112. */
  113. /**
  114. * The color of each data class. If not set, the color is pulled
  115. * from the global or chart-specific [colors](#colors) array. In
  116. * styled mode, this option is ignored. Instead, use colors defined
  117. * in CSS.
  118. *
  119. * @type {Color}
  120. * @sample {highmaps} maps/demo/data-class-two-ranges/
  121. * Explicit colors
  122. * @product highcharts highmaps
  123. * @apioption colorAxis.dataClasses.color
  124. */
  125. /**
  126. * The start of the value range that the data class represents,
  127. * relating to the point value.
  128. *
  129. * The range of each `dataClass` is closed in both ends, but can be
  130. * overridden by the next `dataClass`.
  131. *
  132. * @type {Number}
  133. * @product highcharts highmaps
  134. * @apioption colorAxis.dataClasses.from
  135. */
  136. /**
  137. * The name of the data class as it appears in the legend.
  138. * If no name is given, it is automatically created based on the
  139. * `from` and `to` values. For full programmatic control,
  140. * [legend.labelFormatter](#legend.labelFormatter) can be used.
  141. * In the formatter, `this.from` and `this.to` can be accessed.
  142. *
  143. * @type {String}
  144. * @sample {highmaps} maps/coloraxis/dataclasses-name/
  145. * Named data classes
  146. * @sample {highmaps} maps/coloraxis/dataclasses-labelformatter/
  147. * Formatted data classes
  148. * @product highcharts highmaps
  149. * @apioption colorAxis.dataClasses.name
  150. */
  151. /**
  152. * The end of the value range that the data class represents,
  153. * relating to the point value.
  154. *
  155. * The range of each `dataClass` is closed in both ends, but can be
  156. * overridden by the next `dataClass`.
  157. *
  158. * @type {Number}
  159. * @product highcharts highmaps
  160. * @apioption colorAxis.dataClasses.to
  161. */
  162. /**
  163. * @ignore-option
  164. */
  165. lineWidth: 0,
  166. /**
  167. * Padding of the min value relative to the length of the axis. A
  168. * padding of 0.05 will make a 100px axis 5px longer.
  169. *
  170. * @type {Number}
  171. * @product highcharts highmaps
  172. */
  173. minPadding: 0,
  174. /**
  175. * The maximum value of the axis in terms of map point values. If
  176. * `null`, the max value is automatically calculated. If the
  177. * `endOnTick` option is true, the max value might be rounded up.
  178. *
  179. * @type {Number}
  180. * @sample {highmaps} maps/coloraxis/gridlines/
  181. * Explicit min and max to reduce the effect of outliers
  182. * @product highcharts highmaps
  183. * @apioption colorAxis.max
  184. */
  185. /**
  186. * The minimum value of the axis in terms of map point values. If
  187. * `null`, the min value is automatically calculated. If the
  188. * `startOnTick` option is true, the min value might be rounded
  189. * down.
  190. *
  191. * @type {Number}
  192. * @sample {highmaps} maps/coloraxis/gridlines/
  193. * Explicit min and max to reduce the effect of outliers
  194. * @product highcharts highmaps
  195. * @apioption colorAxis.min
  196. */
  197. /**
  198. * Padding of the max value relative to the length of the axis. A
  199. * padding of 0.05 will make a 100px axis 5px longer.
  200. *
  201. * @type {Number}
  202. * @product highcharts highmaps
  203. */
  204. maxPadding: 0,
  205. /**
  206. * Color of the grid lines extending from the axis across the
  207. * gradient.
  208. *
  209. * @type {Color}
  210. * @sample {highmaps} maps/coloraxis/gridlines/
  211. * Grid lines demonstrated
  212. * @default #e6e6e6
  213. * @product highcharts highmaps
  214. * @apioption colorAxis.gridLineColor
  215. */
  216. /**
  217. * The width of the grid lines extending from the axis across the
  218. * gradient of a scalar color axis.
  219. *
  220. * @type {Number}
  221. * @sample {highmaps} maps/coloraxis/gridlines/
  222. * Grid lines demonstrated
  223. * @default 1
  224. * @product highcharts highmaps
  225. */
  226. gridLineWidth: 1,
  227. /**
  228. * The interval of the tick marks in axis units. When `null`, the
  229. * tick interval is computed to approximately follow the
  230. * `tickPixelInterval`.
  231. *
  232. * @type {Number}
  233. * @product highcharts highmaps
  234. * @apioption colorAxis.tickInterval
  235. */
  236. /**
  237. * If [tickInterval](#colorAxis.tickInterval) is `null` this option
  238. * sets the approximate pixel interval of the tick marks.
  239. *
  240. * @type {Number}
  241. * @default 72
  242. * @product highcharts highmaps
  243. */
  244. tickPixelInterval: 72,
  245. /**
  246. * Whether to force the axis to start on a tick. Use this option
  247. * with the `maxPadding` option to control the axis start.
  248. *
  249. * @type {Boolean}
  250. * @default true
  251. * @product highcharts highmaps
  252. */
  253. startOnTick: true,
  254. /**
  255. * Whether to force the axis to end on a tick. Use this option with
  256. * the [maxPadding](#colorAxis.maxPadding) option to control the
  257. * axis end.
  258. *
  259. * @type {Boolean}
  260. * @default true
  261. * @product highcharts highmaps
  262. */
  263. endOnTick: true,
  264. /** @ignore */
  265. offset: 0,
  266. /**
  267. * The triangular marker on a scalar color axis that points to the
  268. * value of the hovered area. To disable the marker, set
  269. * `marker: null`.
  270. *
  271. * @type {Object}
  272. * @sample {highmaps} maps/coloraxis/marker/ Black marker
  273. * @product highcharts highmaps
  274. */
  275. marker: {
  276. /**
  277. * Animation for the marker as it moves between values. Set to
  278. * `false` to disable animation. Defaults to `{ duration: 50 }`.
  279. *
  280. * @type {Object|Boolean}
  281. * @product highcharts highmaps
  282. */
  283. animation: {
  284. duration: 50
  285. },
  286. /**
  287. * @ignore
  288. */
  289. width: 0.01,
  290. /**
  291. * The color of the marker.
  292. *
  293. * @type {Color}
  294. * @default #999999
  295. * @product highcharts highmaps
  296. */
  297. color: '#999999'
  298. },
  299. /**
  300. * The axis labels show the number for each tick.
  301. *
  302. * For more live examples on label options, see [xAxis.labels in the
  303. * Highcharts API.](/highcharts#xAxis.labels)
  304. *
  305. * @type {Object}
  306. * @extends xAxis.labels
  307. * @product highcharts highmaps
  308. */
  309. labels: {
  310. /**
  311. * How to handle overflowing labels on horizontal color axis.
  312. * Can be undefined or "justify". If "justify", labels will not
  313. * render outside the legend area. If there is room to move it,
  314. * it will be aligned to the edge, else it will be removed.
  315. *
  316. * @validvalue [null, "justify"]
  317. * @type {String}
  318. * @default justify
  319. * @product highcharts highmaps
  320. */
  321. overflow: 'justify',
  322. rotation: 0
  323. },
  324. /**
  325. * The color to represent the minimum of the color axis. Unless
  326. * [dataClasses](#colorAxis.dataClasses) or
  327. * [stops](#colorAxis.stops) are set, the gradient starts at this
  328. * value.
  329. *
  330. * If dataClasses are set, the color is based on minColor and
  331. * maxColor unless a color is set for each data class, or the
  332. * [dataClassColor](#colorAxis.dataClassColor) is set.
  333. *
  334. * @type {Color}
  335. * @sample {highmaps} maps/coloraxis/mincolor-maxcolor/
  336. * Min and max colors on scalar (gradient) axis
  337. * @sample {highmaps} maps/coloraxis/mincolor-maxcolor-dataclasses/
  338. * On data classes
  339. * @default #e6ebf5
  340. * @product highcharts highmaps
  341. */
  342. minColor: '#e6ebf5',
  343. /**
  344. * The color to represent the maximum of the color axis. Unless
  345. * [dataClasses](#colorAxis.dataClasses) or
  346. * [stops](#colorAxis.stops) are set, the gradient ends at this
  347. * value.
  348. *
  349. * If dataClasses are set, the color is based on minColor and
  350. * maxColor unless a color is set for each data class, or the
  351. * [dataClassColor](#colorAxis.dataClassColor) is set.
  352. *
  353. * @type {Color}
  354. * @sample {highmaps} maps/coloraxis/mincolor-maxcolor/
  355. * Min and max colors on scalar (gradient) axis
  356. * @sample {highmaps} maps/coloraxis/mincolor-maxcolor-dataclasses/
  357. * On data classes
  358. * @default #003399
  359. * @product highcharts highmaps
  360. */
  361. maxColor: '#003399',
  362. /**
  363. * Color stops for the gradient of a scalar color axis. Use this in
  364. * cases where a linear gradient between a `minColor` and `maxColor`
  365. * is not sufficient. The stops is an array of tuples, where the
  366. * first item is a float between 0 and 1 assigning the relative
  367. * position in the gradient, and the second item is the color.
  368. *
  369. * @type {Array<Array>}
  370. * @sample {highmaps} maps/demo/heatmap/
  371. * Heatmap with three color stops
  372. * @product highcharts highmaps
  373. * @apioption colorAxis.stops
  374. */
  375. /**
  376. * The pixel length of the main tick marks on the color axis.
  377. */
  378. tickLength: 5,
  379. /**
  380. * The type of interpolation to use for the color axis. Can be
  381. * `linear` or `logarithmic`.
  382. *
  383. * @validvalue ["linear", "logarithmic"]
  384. * @type {String}
  385. * @default linear
  386. * @product highcharts highmaps
  387. * @apioption colorAxis.type
  388. */
  389. /**
  390. * Whether to reverse the axis so that the highest number is closest
  391. * to the origin. Defaults to `false` in a horizontal legend and
  392. * `true` in a vertical legend, where the smallest value starts on
  393. * top.
  394. *
  395. * @type {Boolean}
  396. * @product highcharts highmaps
  397. * @apioption colorAxis.reversed
  398. */
  399. /**
  400. * Fires when the legend item belonging to the colorAxis is clicked.
  401. * One parameter, `event`, is passed to the function.
  402. *
  403. * @type {Function}
  404. * @product highcharts highmaps
  405. * @apioption colorAxis.events.legendItemClick
  406. */
  407. /**
  408. * Whether to display the colorAxis in the legend.
  409. *
  410. * @type {Boolean}
  411. * @see [heatmap.showInLegend](#series.heatmap.showInLegend)
  412. * @default true
  413. * @since 4.2.7
  414. * @product highcharts highmaps
  415. */
  416. showInLegend: true
  417. },
  418. // Properties to preserve after destroy, for Axis.update (#5881, #6025)
  419. keepProps: [
  420. 'legendGroup',
  421. 'legendItemHeight',
  422. 'legendItemWidth',
  423. 'legendItem',
  424. 'legendSymbol'
  425. ].concat(Axis.prototype.keepProps),
  426. /**
  427. * Initialize the color axis
  428. */
  429. init: function (chart, userOptions) {
  430. var horiz = chart.options.legend.layout !== 'vertical',
  431. options;
  432. this.coll = 'colorAxis';
  433. // Build the options
  434. options = merge(this.defaultColorAxisOptions, {
  435. side: horiz ? 2 : 1,
  436. reversed: !horiz
  437. }, userOptions, {
  438. opposite: !horiz,
  439. showEmpty: false,
  440. title: null,
  441. visible: chart.options.legend.enabled
  442. });
  443. Axis.prototype.init.call(this, chart, options);
  444. // Base init() pushes it to the xAxis array, now pop it again
  445. // chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
  446. // Prepare data classes
  447. if (userOptions.dataClasses) {
  448. this.initDataClasses(userOptions);
  449. }
  450. this.initStops();
  451. // Override original axis properties
  452. this.horiz = horiz;
  453. this.zoomEnabled = false;
  454. // Add default values
  455. this.defaultLegendLength = 200;
  456. },
  457. initDataClasses: function (userOptions) {
  458. var chart = this.chart,
  459. dataClasses,
  460. colorCounter = 0,
  461. colorCount = chart.options.chart.colorCount,
  462. options = this.options,
  463. len = userOptions.dataClasses.length;
  464. this.dataClasses = dataClasses = [];
  465. this.legendItems = [];
  466. each(userOptions.dataClasses, function (dataClass, i) {
  467. var colors;
  468. dataClass = merge(dataClass);
  469. dataClasses.push(dataClass);
  470. if (dataClass.color) {
  471. return;
  472. }
  473. if (options.dataClassColor === 'category') {
  474. colors = chart.options.colors;
  475. colorCount = colors.length;
  476. dataClass.color = colors[colorCounter];
  477. dataClass.colorIndex = colorCounter;
  478. // increase and loop back to zero
  479. colorCounter++;
  480. if (colorCounter === colorCount) {
  481. colorCounter = 0;
  482. }
  483. } else {
  484. dataClass.color = color(options.minColor).tweenTo(
  485. color(options.maxColor),
  486. len < 2 ? 0.5 : i / (len - 1) // #3219
  487. );
  488. }
  489. });
  490. },
  491. /**
  492. * Override so that ticks are not added in data class axes (#6914)
  493. */
  494. setTickPositions: function () {
  495. if (!this.dataClasses) {
  496. return Axis.prototype.setTickPositions.call(this);
  497. }
  498. },
  499. initStops: function () {
  500. this.stops = this.options.stops || [
  501. [0, this.options.minColor],
  502. [1, this.options.maxColor]
  503. ];
  504. each(this.stops, function (stop) {
  505. stop.color = color(stop[1]);
  506. });
  507. },
  508. /**
  509. * Extend the setOptions method to process extreme colors and color
  510. * stops.
  511. */
  512. setOptions: function (userOptions) {
  513. Axis.prototype.setOptions.call(this, userOptions);
  514. this.options.crosshair = this.options.marker;
  515. },
  516. setAxisSize: function () {
  517. var symbol = this.legendSymbol,
  518. chart = this.chart,
  519. legendOptions = chart.options.legend || {},
  520. x,
  521. y,
  522. width,
  523. height;
  524. if (symbol) {
  525. this.left = x = symbol.attr('x');
  526. this.top = y = symbol.attr('y');
  527. this.width = width = symbol.attr('width');
  528. this.height = height = symbol.attr('height');
  529. this.right = chart.chartWidth - x - width;
  530. this.bottom = chart.chartHeight - y - height;
  531. this.len = this.horiz ? width : height;
  532. this.pos = this.horiz ? x : y;
  533. } else {
  534. // Fake length for disabled legend to avoid tick issues
  535. // and such (#5205)
  536. this.len = (
  537. this.horiz ?
  538. legendOptions.symbolWidth :
  539. legendOptions.symbolHeight
  540. ) || this.defaultLegendLength;
  541. }
  542. },
  543. normalizedValue: function (value) {
  544. if (this.isLog) {
  545. value = this.val2lin(value);
  546. }
  547. return 1 - ((this.max - value) / ((this.max - this.min) || 1));
  548. },
  549. /**
  550. * Translate from a value to a color
  551. */
  552. toColor: function (value, point) {
  553. var pos,
  554. stops = this.stops,
  555. from,
  556. to,
  557. color,
  558. dataClasses = this.dataClasses,
  559. dataClass,
  560. i;
  561. if (dataClasses) {
  562. i = dataClasses.length;
  563. while (i--) {
  564. dataClass = dataClasses[i];
  565. from = dataClass.from;
  566. to = dataClass.to;
  567. if (
  568. (from === undefined || value >= from) &&
  569. (to === undefined || value <= to)
  570. ) {
  571. color = dataClass.color;
  572. if (point) {
  573. point.dataClass = i;
  574. point.colorIndex = dataClass.colorIndex;
  575. }
  576. break;
  577. }
  578. }
  579. } else {
  580. pos = this.normalizedValue(value);
  581. i = stops.length;
  582. while (i--) {
  583. if (pos > stops[i][0]) {
  584. break;
  585. }
  586. }
  587. from = stops[i] || stops[i + 1];
  588. to = stops[i + 1] || from;
  589. // The position within the gradient
  590. pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
  591. color = from.color.tweenTo(
  592. to.color,
  593. pos
  594. );
  595. }
  596. return color;
  597. },
  598. /**
  599. * Override the getOffset method to add the whole axis groups inside
  600. * the legend.
  601. */
  602. getOffset: function () {
  603. var group = this.legendGroup,
  604. sideOffset = this.chart.axisOffset[this.side];
  605. if (group) {
  606. // Hook for the getOffset method to add groups to this parent
  607. // group
  608. this.axisParent = group;
  609. // Call the base
  610. Axis.prototype.getOffset.call(this);
  611. // First time only
  612. if (!this.added) {
  613. this.added = true;
  614. this.labelLeft = 0;
  615. this.labelRight = this.width;
  616. }
  617. // Reset it to avoid color axis reserving space
  618. this.chart.axisOffset[this.side] = sideOffset;
  619. }
  620. },
  621. /**
  622. * Create the color gradient
  623. */
  624. setLegendColor: function () {
  625. var grad,
  626. horiz = this.horiz,
  627. reversed = this.reversed,
  628. one = reversed ? 1 : 0,
  629. zero = reversed ? 0 : 1;
  630. grad = horiz ? [one, 0, zero, 0] : [0, zero, 0, one]; // #3190
  631. this.legendColor = {
  632. linearGradient: {
  633. x1: grad[0], y1: grad[1],
  634. x2: grad[2], y2: grad[3]
  635. },
  636. stops: this.stops
  637. };
  638. },
  639. /**
  640. * The color axis appears inside the legend and has its own legend
  641. * symbol
  642. */
  643. drawLegendSymbol: function (legend, item) {
  644. var padding = legend.padding,
  645. legendOptions = legend.options,
  646. horiz = this.horiz,
  647. width = pick(
  648. legendOptions.symbolWidth,
  649. horiz ? this.defaultLegendLength : 12
  650. ),
  651. height = pick(
  652. legendOptions.symbolHeight,
  653. horiz ? 12 : this.defaultLegendLength
  654. ),
  655. labelPadding = pick(
  656. legendOptions.labelPadding,
  657. horiz ? 16 : 30
  658. ),
  659. itemDistance = pick(legendOptions.itemDistance, 10);
  660. this.setLegendColor();
  661. // Create the gradient
  662. item.legendSymbol = this.chart.renderer.rect(
  663. 0,
  664. legend.baseline - 11,
  665. width,
  666. height
  667. ).attr({
  668. zIndex: 1
  669. }).add(item.legendGroup);
  670. // Set how much space this legend item takes up
  671. this.legendItemWidth = width + padding +
  672. (horiz ? itemDistance : labelPadding);
  673. this.legendItemHeight = height + padding +
  674. (horiz ? labelPadding : 0);
  675. },
  676. /**
  677. * Fool the legend
  678. */
  679. setState: function (state) {
  680. each(this.series, function (series) {
  681. series.setState(state);
  682. });
  683. },
  684. visible: true,
  685. setVisible: noop,
  686. getSeriesExtremes: function () {
  687. var series = this.series,
  688. i = series.length;
  689. this.dataMin = Infinity;
  690. this.dataMax = -Infinity;
  691. while (i--) {
  692. if (series[i].valueMin !== undefined) {
  693. this.dataMin = Math.min(this.dataMin, series[i].valueMin);
  694. this.dataMax = Math.max(this.dataMax, series[i].valueMax);
  695. }
  696. }
  697. },
  698. drawCrosshair: function (e, point) {
  699. var plotX = point && point.plotX,
  700. plotY = point && point.plotY,
  701. crossPos,
  702. axisPos = this.pos,
  703. axisLen = this.len;
  704. if (point) {
  705. crossPos = this.toPixels(point[point.series.colorKey]);
  706. if (crossPos < axisPos) {
  707. crossPos = axisPos - 2;
  708. } else if (crossPos > axisPos + axisLen) {
  709. crossPos = axisPos + axisLen + 2;
  710. }
  711. point.plotX = crossPos;
  712. point.plotY = this.len - crossPos;
  713. Axis.prototype.drawCrosshair.call(this, e, point);
  714. point.plotX = plotX;
  715. point.plotY = plotY;
  716. if (
  717. this.cross &&
  718. !this.cross.addedToColorAxis &&
  719. this.legendGroup
  720. ) {
  721. this.cross
  722. .addClass('highcharts-coloraxis-marker')
  723. .add(this.legendGroup);
  724. this.cross.addedToColorAxis = true;
  725. this.cross.attr({
  726. fill: this.crosshair.color
  727. });
  728. }
  729. }
  730. },
  731. getPlotLinePath: function (a, b, c, d, pos) {
  732. // crosshairs only
  733. return isNumber(pos) ? // pos can be 0 (#3969)
  734. (
  735. this.horiz ? [
  736. 'M',
  737. pos - 4, this.top - 6,
  738. 'L',
  739. pos + 4, this.top - 6,
  740. pos, this.top,
  741. 'Z'
  742. ] : [
  743. 'M',
  744. this.left, pos,
  745. 'L',
  746. this.left - 6, pos + 6,
  747. this.left - 6, pos - 6,
  748. 'Z'
  749. ]
  750. ) :
  751. Axis.prototype.getPlotLinePath.call(this, a, b, c, d);
  752. },
  753. update: function (newOptions, redraw) {
  754. var chart = this.chart,
  755. legend = chart.legend;
  756. each(this.series, function (series) {
  757. // Needed for Axis.update when choropleth colors change
  758. series.isDirtyData = true;
  759. });
  760. // When updating data classes, destroy old items and make sure new
  761. // ones are created (#3207)
  762. if (newOptions.dataClasses && legend.allItems) {
  763. each(legend.allItems, function (item) {
  764. if (item.isDataClass && item.legendGroup) {
  765. item.legendGroup.destroy();
  766. }
  767. });
  768. chart.isDirtyLegend = true;
  769. }
  770. // Keep the options structure updated for export. Unlike xAxis and
  771. // yAxis, the colorAxis is not an array. (#3207)
  772. chart.options[this.coll] = merge(this.userOptions, newOptions);
  773. Axis.prototype.update.call(this, newOptions, redraw);
  774. if (this.legendItem) {
  775. this.setLegendColor();
  776. legend.colorizeItem(this, true);
  777. }
  778. },
  779. /**
  780. * Extend basic axis remove by also removing the legend item.
  781. */
  782. remove: function () {
  783. if (this.legendItem) {
  784. this.chart.legend.destroyItem(this);
  785. }
  786. Axis.prototype.remove.call(this);
  787. },
  788. /**
  789. * Get the legend item symbols for data classes
  790. */
  791. getDataClassLegendSymbols: function () {
  792. var axis = this,
  793. chart = this.chart,
  794. legendItems = this.legendItems,
  795. legendOptions = chart.options.legend,
  796. valueDecimals = legendOptions.valueDecimals,
  797. valueSuffix = legendOptions.valueSuffix || '',
  798. name;
  799. if (!legendItems.length) {
  800. each(this.dataClasses, function (dataClass, i) {
  801. var vis = true,
  802. from = dataClass.from,
  803. to = dataClass.to;
  804. // Assemble the default name. This can be overridden
  805. // by legend.options.labelFormatter
  806. name = '';
  807. if (from === undefined) {
  808. name = '< ';
  809. } else if (to === undefined) {
  810. name = '> ';
  811. }
  812. if (from !== undefined) {
  813. name += H.numberFormat(from, valueDecimals) +
  814. valueSuffix;
  815. }
  816. if (from !== undefined && to !== undefined) {
  817. name += ' - ';
  818. }
  819. if (to !== undefined) {
  820. name += H.numberFormat(to, valueDecimals) + valueSuffix;
  821. }
  822. // Add a mock object to the legend items
  823. legendItems.push(extend({
  824. chart: chart,
  825. name: name,
  826. options: {},
  827. drawLegendSymbol: LegendSymbolMixin.drawRectangle,
  828. visible: true,
  829. setState: noop,
  830. isDataClass: true,
  831. setVisible: function () {
  832. vis = this.visible = !vis;
  833. each(axis.series, function (series) {
  834. each(series.points, function (point) {
  835. if (point.dataClass === i) {
  836. point.setVisible(vis);
  837. }
  838. });
  839. });
  840. chart.legend.colorizeItem(this, vis);
  841. }
  842. }, dataClass));
  843. });
  844. }
  845. return legendItems;
  846. },
  847. name: '' // Prevents 'undefined' in legend in IE8
  848. });
  849. /**
  850. * Handle animation of the color attributes directly
  851. */
  852. each(['fill', 'stroke'], function (prop) {
  853. H.Fx.prototype[prop + 'Setter'] = function () {
  854. this.elem.attr(
  855. prop,
  856. color(this.start).tweenTo(
  857. color(this.end),
  858. this.pos
  859. ),
  860. null,
  861. true
  862. );
  863. };
  864. });
  865. /**
  866. * Extend the chart getAxes method to also get the color axis
  867. */
  868. addEvent(Chart, 'afterGetAxes', function () {
  869. var options = this.options,
  870. colorAxisOptions = options.colorAxis;
  871. this.colorAxis = [];
  872. if (colorAxisOptions) {
  873. new ColorAxis(this, colorAxisOptions); // eslint-disable-line no-new
  874. }
  875. });
  876. /**
  877. * Add the color axis. This also removes the axis' own series to prevent
  878. * them from showing up individually.
  879. */
  880. addEvent(Legend, 'afterGetAllItems', function (e) {
  881. var colorAxisItems = [],
  882. colorAxis = this.chart.colorAxis[0];
  883. if (colorAxis && colorAxis.options) {
  884. if (colorAxis.options.showInLegend) {
  885. // Data classes
  886. if (colorAxis.options.dataClasses) {
  887. colorAxisItems = colorAxis.getDataClassLegendSymbols();
  888. // Gradient legend
  889. } else {
  890. // Add this axis on top
  891. colorAxisItems.push(colorAxis);
  892. }
  893. }
  894. // Don't add the color axis' series
  895. each(colorAxis.series, function (series) {
  896. H.erase(e.allItems, series);
  897. });
  898. }
  899. while (colorAxisItems.length) {
  900. e.allItems.unshift(colorAxisItems.pop());
  901. }
  902. });
  903. addEvent(Legend, 'afterColorizeItem', function (e) {
  904. if (e.visible && e.item.legendColor) {
  905. e.item.legendSymbol.attr({
  906. fill: e.item.legendColor
  907. });
  908. }
  909. });
  910. // Updates in the legend need to be reflected in the color axis (6888)
  911. addEvent(Legend, 'afterUpdate', function () {
  912. if (this.chart.colorAxis[0]) {
  913. this.chart.colorAxis[0].update({}, arguments[2]);
  914. }
  915. });
  916. }
  917. }(Highcharts));
  918. (function (H) {
  919. /**
  920. * (c) 2010-2017 Torstein Honsi
  921. *
  922. * License: www.highcharts.com/license
  923. */
  924. var defined = H.defined,
  925. each = H.each,
  926. noop = H.noop,
  927. seriesTypes = H.seriesTypes;
  928. /**
  929. * Mixin for maps and heatmaps
  930. */
  931. H.colorPointMixin = {
  932. /**
  933. * Color points have a value option that determines whether or not it is
  934. * a null point
  935. */
  936. isValid: function () {
  937. // undefined is allowed
  938. return (
  939. this.value !== null &&
  940. this.value !== Infinity &&
  941. this.value !== -Infinity
  942. );
  943. },
  944. /**
  945. * Set the visibility of a single point
  946. */
  947. setVisible: function (vis) {
  948. var point = this,
  949. method = vis ? 'show' : 'hide';
  950. // Show and hide associated elements
  951. each(['graphic', 'dataLabel'], function (key) {
  952. if (point[key]) {
  953. point[key][method]();
  954. }
  955. });
  956. },
  957. setState: function (state) {
  958. H.Point.prototype.setState.call(this, state);
  959. if (this.graphic) {
  960. this.graphic.attr({
  961. zIndex: state === 'hover' ? 1 : 0
  962. });
  963. }
  964. }
  965. };
  966. H.colorSeriesMixin = {
  967. pointArrayMap: ['value'],
  968. axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
  969. optionalAxis: 'colorAxis',
  970. trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
  971. getSymbol: noop,
  972. parallelArrays: ['x', 'y', 'value'],
  973. colorKey: 'value',
  974. pointAttribs: seriesTypes.column.prototype.pointAttribs,
  975. /**
  976. * In choropleth maps, the color is a result of the value, so this needs
  977. * translation too
  978. */
  979. translateColors: function () {
  980. var series = this,
  981. nullColor = this.options.nullColor,
  982. colorAxis = this.colorAxis,
  983. colorKey = this.colorKey;
  984. each(this.data, function (point) {
  985. var value = point[colorKey],
  986. color;
  987. color = point.options.color ||
  988. (
  989. point.isNull ?
  990. nullColor :
  991. (colorAxis && value !== undefined) ?
  992. colorAxis.toColor(value, point) :
  993. point.color || series.color
  994. );
  995. if (color) {
  996. point.color = color;
  997. }
  998. });
  999. },
  1000. /**
  1001. * Get the color attibutes to apply on the graphic
  1002. */
  1003. colorAttribs: function (point) {
  1004. var ret = {};
  1005. if (defined(point.color)) {
  1006. ret[this.colorProp || 'fill'] = point.color;
  1007. }
  1008. return ret;
  1009. }
  1010. };
  1011. }(Highcharts));
  1012. (function (H) {
  1013. /**
  1014. * (c) 2010-2017 Torstein Honsi
  1015. *
  1016. * License: www.highcharts.com/license
  1017. */
  1018. var colorPointMixin = H.colorPointMixin,
  1019. colorSeriesMixin = H.colorSeriesMixin,
  1020. each = H.each,
  1021. LegendSymbolMixin = H.LegendSymbolMixin,
  1022. merge = H.merge,
  1023. noop = H.noop,
  1024. pick = H.pick,
  1025. Series = H.Series,
  1026. seriesType = H.seriesType,
  1027. seriesTypes = H.seriesTypes;
  1028. /**
  1029. * A heatmap is a graphical representation of data where the individual values
  1030. * contained in a matrix are represented as colors.
  1031. *
  1032. * @sample highcharts/demo/heatmap/
  1033. * Simple heatmap
  1034. * @sample highcharts/demo/heatmap-canvas/
  1035. * Heavy heatmap
  1036. * @extends {plotOptions.scatter}
  1037. * @excluding animationLimit,connectEnds,connectNulls,dashStyle,
  1038. * findNearestPointBy,getExtremesFromAll,linecap,lineWidth,marker,
  1039. * pointInterval,pointIntervalUnit,pointRange,pointStart,shadow,
  1040. * softThreshold,stacking,step,threshold
  1041. * @product highcharts highmaps
  1042. * @optionparent plotOptions.heatmap
  1043. */
  1044. seriesType('heatmap', 'scatter', {
  1045. /**
  1046. * Animation is disabled by default on the heatmap series.
  1047. *
  1048. * @type {Boolean|Object}
  1049. */
  1050. animation: false,
  1051. /**
  1052. * The border width for each heat map item.
  1053. */
  1054. borderWidth: 0,
  1055. /**
  1056. * Padding between the points in the heatmap.
  1057. *
  1058. * @type {Number}
  1059. * @default 0
  1060. * @since 6.0
  1061. * @apioption plotOptions.heatmap.pointPadding
  1062. */
  1063. /**
  1064. * The main color of the series. In heat maps this color is rarely used,
  1065. * as we mostly use the color to denote the value of each point. Unless
  1066. * options are set in the [colorAxis](#colorAxis), the default value
  1067. * is pulled from the [options.colors](#colors) array.
  1068. *
  1069. * @type {Color}
  1070. * @default null
  1071. * @since 4.0
  1072. * @product highcharts
  1073. * @apioption plotOptions.heatmap.color
  1074. */
  1075. /**
  1076. * The column size - how many X axis units each column in the heatmap
  1077. * should span.
  1078. *
  1079. * @type {Number}
  1080. * @sample {highcharts} maps/demo/heatmap/ One day
  1081. * @sample {highmaps} maps/demo/heatmap/ One day
  1082. * @default 1
  1083. * @since 4.0
  1084. * @product highcharts highmaps
  1085. * @apioption plotOptions.heatmap.colsize
  1086. */
  1087. /**
  1088. * The row size - how many Y axis units each heatmap row should span.
  1089. *
  1090. * @type {Number}
  1091. * @sample {highcharts} maps/demo/heatmap/ 1 by default
  1092. * @sample {highmaps} maps/demo/heatmap/ 1 by default
  1093. * @default 1
  1094. * @since 4.0
  1095. * @product highcharts highmaps
  1096. * @apioption plotOptions.heatmap.rowsize
  1097. */
  1098. /**
  1099. * The color applied to null points. In styled mode, a general CSS class is
  1100. * applied instead.
  1101. *
  1102. * @type {Color}
  1103. */
  1104. nullColor: '#f7f7f7',
  1105. dataLabels: {
  1106. formatter: function () { // #2945
  1107. return this.point.value;
  1108. },
  1109. inside: true,
  1110. verticalAlign: 'middle',
  1111. crop: false,
  1112. overflow: false,
  1113. padding: 0 // #3837
  1114. },
  1115. /**
  1116. * @ignore
  1117. */
  1118. marker: null,
  1119. /** @ignore */
  1120. pointRange: null, // dynamically set to colsize by default
  1121. tooltip: {
  1122. pointFormat: '{point.x}, {point.y}: {point.value}<br/>'
  1123. },
  1124. states: {
  1125. hover: {
  1126. /**
  1127. * @ignore
  1128. */
  1129. halo: false, // #3406, halo is disabled on heatmaps by default
  1130. /**
  1131. * How much to brighten the point on interaction. Requires the main
  1132. * color to be defined in hex or rgb(a) format.
  1133. *
  1134. * In styled mode, the hover brightening is by default replaced
  1135. * with a fill-opacity set in the `.highcharts-point:hover` rule.
  1136. *
  1137. * @type {Number}
  1138. * @product highcharts highmaps
  1139. */
  1140. brightness: 0.2
  1141. }
  1142. }
  1143. }, merge(colorSeriesMixin, {
  1144. pointArrayMap: ['y', 'value'],
  1145. hasPointSpecificOptions: true,
  1146. getExtremesFromAll: true,
  1147. directTouch: true,
  1148. /**
  1149. * Override the init method to add point ranges on both axes.
  1150. */
  1151. init: function () {
  1152. var options;
  1153. seriesTypes.scatter.prototype.init.apply(this, arguments);
  1154. options = this.options;
  1155. // #3758, prevent resetting in setData
  1156. options.pointRange = pick(options.pointRange, options.colsize || 1);
  1157. this.yAxis.axisPointRange = options.rowsize || 1; // general point range
  1158. },
  1159. translate: function () {
  1160. var series = this,
  1161. options = series.options,
  1162. xAxis = series.xAxis,
  1163. yAxis = series.yAxis,
  1164. seriesPointPadding = options.pointPadding || 0,
  1165. between = function (x, a, b) {
  1166. return Math.min(Math.max(a, x), b);
  1167. };
  1168. series.generatePoints();
  1169. each(series.points, function (point) {
  1170. var xPad = (options.colsize || 1) / 2,
  1171. yPad = (options.rowsize || 1) / 2,
  1172. x1 = between(
  1173. Math.round(
  1174. xAxis.len -
  1175. xAxis.translate(point.x - xPad, 0, 1, 0, 1)
  1176. ),
  1177. -xAxis.len, 2 * xAxis.len
  1178. ),
  1179. x2 = between(
  1180. Math.round(
  1181. xAxis.len -
  1182. xAxis.translate(point.x + xPad, 0, 1, 0, 1)
  1183. ),
  1184. -xAxis.len, 2 * xAxis.len
  1185. ),
  1186. y1 = between(
  1187. Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)),
  1188. -yAxis.len, 2 * yAxis.len
  1189. ),
  1190. y2 = between(
  1191. Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1)),
  1192. -yAxis.len, 2 * yAxis.len
  1193. ),
  1194. pointPadding = pick(point.pointPadding, seriesPointPadding);
  1195. // Set plotX and plotY for use in K-D-Tree and more
  1196. point.plotX = point.clientX = (x1 + x2) / 2;
  1197. point.plotY = (y1 + y2) / 2;
  1198. point.shapeType = 'rect';
  1199. point.shapeArgs = {
  1200. x: Math.min(x1, x2) + pointPadding,
  1201. y: Math.min(y1, y2) + pointPadding,
  1202. width: Math.abs(x2 - x1) - pointPadding * 2,
  1203. height: Math.abs(y2 - y1) - pointPadding * 2
  1204. };
  1205. });
  1206. series.translateColors();
  1207. },
  1208. drawPoints: function () {
  1209. seriesTypes.column.prototype.drawPoints.call(this);
  1210. each(this.points, function (point) {
  1211. point.graphic.attr(this.colorAttribs(point));
  1212. }, this);
  1213. },
  1214. animate: noop,
  1215. getBox: noop,
  1216. drawLegendSymbol: LegendSymbolMixin.drawRectangle,
  1217. alignDataLabel: seriesTypes.column.prototype.alignDataLabel,
  1218. getExtremes: function () {
  1219. // Get the extremes from the value data
  1220. Series.prototype.getExtremes.call(this, this.valueData);
  1221. this.valueMin = this.dataMin;
  1222. this.valueMax = this.dataMax;
  1223. // Get the extremes from the y data
  1224. Series.prototype.getExtremes.call(this);
  1225. }
  1226. }), H.extend({
  1227. haloPath: function (size) {
  1228. if (!size) {
  1229. return [];
  1230. }
  1231. var rect = this.shapeArgs;
  1232. return [
  1233. 'M', rect.x - size, rect.y - size,
  1234. 'L', rect.x - size, rect.y + rect.height + size,
  1235. rect.x + rect.width + size, rect.y + rect.height + size,
  1236. rect.x + rect.width + size, rect.y - size,
  1237. 'Z'
  1238. ];
  1239. }
  1240. }, colorPointMixin));
  1241. /**
  1242. * A `heatmap` series. If the [type](#series.heatmap.type) option is
  1243. * not specified, it is inherited from [chart.type](#chart.type).
  1244. *
  1245. * @type {Object}
  1246. * @extends series,plotOptions.heatmap
  1247. * @excluding dataParser,dataURL,marker,pointRange,stack
  1248. * @product highcharts highmaps
  1249. * @apioption series.heatmap
  1250. */
  1251. /**
  1252. * An array of data points for the series. For the `heatmap` series
  1253. * type, points can be given in the following ways:
  1254. *
  1255. * 1. An array of arrays with 3 or 2 values. In this case, the values
  1256. * correspond to `x,y,value`. If the first value is a string, it is
  1257. * applied as the name of the point, and the `x` value is inferred.
  1258. * The `x` value can also be omitted, in which case the inner arrays
  1259. * should be of length 2\. Then the `x` value is automatically calculated,
  1260. * either starting at 0 and incremented by 1, or from `pointStart`
  1261. * and `pointInterval` given in the series options.
  1262. *
  1263. * ```js
  1264. * data: [
  1265. * [0, 9, 7],
  1266. * [1, 10, 4],
  1267. * [2, 6, 3]
  1268. * ]
  1269. * ```
  1270. *
  1271. * 2. An array of objects with named values. The objects are point
  1272. * configuration objects as seen below. If the total number of data
  1273. * points exceeds the series' [turboThreshold](#series.heatmap.turboThreshold),
  1274. * this option is not available.
  1275. *
  1276. * ```js
  1277. * data: [{
  1278. * x: 1,
  1279. * y: 3,
  1280. * value: 10,
  1281. * name: "Point2",
  1282. * color: "#00FF00"
  1283. * }, {
  1284. * x: 1,
  1285. * y: 7,
  1286. * value: 10,
  1287. * name: "Point1",
  1288. * color: "#FF00FF"
  1289. * }]
  1290. * ```
  1291. *
  1292. * @type {Array<Object|Array>}
  1293. * @extends series.line.data
  1294. * @excluding marker
  1295. * @sample {highcharts} highcharts/chart/reflow-true/
  1296. * Numerical values
  1297. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  1298. * Arrays of numeric x and y
  1299. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  1300. * Arrays of datetime x and y
  1301. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  1302. * Arrays of point.name and y
  1303. * @sample {highcharts} highcharts/series/data-array-of-objects/
  1304. * Config objects
  1305. * @product highcharts highmaps
  1306. * @apioption series.heatmap.data
  1307. */
  1308. /**
  1309. * The color of the point. In heat maps the point color is rarely set
  1310. * explicitly, as we use the color to denote the `value`. Options for
  1311. * this are set in the [colorAxis](#colorAxis) configuration.
  1312. *
  1313. * @type {Color}
  1314. * @product highcharts highmaps
  1315. * @apioption series.heatmap.data.color
  1316. */
  1317. /**
  1318. * The value of the point, resulting in a color controled by options
  1319. * as set in the [colorAxis](#colorAxis) configuration.
  1320. *
  1321. * @type {Number}
  1322. * @product highcharts highmaps
  1323. * @apioption series.heatmap.data.value
  1324. */
  1325. /**
  1326. * The x value of the point. For datetime axes,
  1327. * the X value is the timestamp in milliseconds since 1970.
  1328. *
  1329. * @type {Number}
  1330. * @product highcharts highmaps
  1331. * @apioption series.heatmap.data.x
  1332. */
  1333. /**
  1334. * The y value of the point.
  1335. *
  1336. * @type {Number}
  1337. * @product highcharts highmaps
  1338. * @apioption series.heatmap.data.y
  1339. */
  1340. /**
  1341. * Point padding for a single point.
  1342. *
  1343. * @type {Number}
  1344. * @sample maps/plotoptions/tilemap-pointpadding Point padding on tiles
  1345. * @apioption series.heatmap.data.pointPadding
  1346. */
  1347. }(Highcharts));
  1348. }));