Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vacation2020 #13910

Merged
merged 87 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
69d3406
Enhancement, annotations in data table - proof of concept.
madepiet Feb 27, 2020
eb5ea55
Enhancement #12789, added headers for data table, added polyfill.
madepiet Mar 17, 2020
6cfaf48
Enhancement #12789, added new property includeInDataExport.
madepiet Apr 8, 2020
ab14ecd
Enhancement #12789, corrected API declaration of includeInDataExport …
madepiet Apr 14, 2020
c5d65ad
Enhancement #12789, added new property concatenatePointAnnotations.
madepiet Apr 24, 2020
d405c77
Merge branch 'master' into enhancement/12789-annotations-in-data-table
Jun 10, 2020
2077a3e
Addition to #12789, joinAnnotations, annotationSeparator.
madepiet Jun 17, 2020
ab8ecfc
Addition to #12789, added tests.
madepiet Jun 19, 2020
62e8b1a
Addition to #12789, corrected API for annotation options in data-export.
madepiet Jul 2, 2020
7cf1867
Addition to #12789, added itemDelimiter and join prop.
madepiet Jul 2, 2020
adc4bb8
Fixed #13739, excluded boost options from unsupported series
goransle Jul 10, 2020
1389c73
Migrated mixins/indicator-required to ES6 pattern.
marvin19 Jul 13, 2020
f571bc1
Migrated mixins/geometry to ES6 pattern.
marvin19 Jul 13, 2020
d0148a7
Migrated legend-symbol to ES6 pattern.
marvin19 Jul 13, 2020
a521eee
Migrated mixins/multiple-lines to ES6 pattern.
marvin19 Jul 14, 2020
5106c65
Merge branches
marvin19 Jul 15, 2020
266e219
Migrated mixins/navigation to ES6 pattern.
marvin19 Jul 14, 2020
11f614e
Migrated mixins/nelder-mead to ES6 pattern.
marvin19 Jul 14, 2020
05381cf
Migrated mixins/nodes to ES6 pattern.
marvin19 Jul 14, 2020
4acbeba
Migrated mixins/on-series to ES6 pattern.
marvin19 Jul 14, 2020
8c4fb6c
Migrated mixins/polygon to ES6 pattern.
marvin19 Jul 15, 2020
4a79d0b
Migrated mixins/reduce-array to ES6 pattern.
marvin19 Jul 15, 2020
75c5d08
Migrated mixins/tree-series to ES6 pattern.
marvin19 Jul 15, 2020
47a047c
Tools: Updated the feature request template
cvasseng Jul 13, 2020
27e6662
Fix typo in demo description
alvarezguille Jul 13, 2020
5d35e51
Merge pull request #13890 from highcharts/enhancement/mixins-indicato…
oysteinmoseng Jul 15, 2020
0be5542
Fixed #13736, draggable annotations on touch devices.
mateuszkornecki Jul 14, 2020
e7de7c7
Enhancement #13715, updated docs and added the demo.
karolkolodziej Jul 13, 2020
b138e29
Fixed issue with sonification timeline.atStart false positive.
oysteinmoseng Jul 15, 2020
12c4917
Renaming and moving of the mixins
marvin19 Jul 16, 2020
83ba184
deleted js/mixin folder
marvin19 Jul 16, 2020
15e31b8
Prepared renaming mixins-folder.
marvin19 Jul 16, 2020
c6a94ed
Renamed and moved the mixins-folder
marvin19 Jul 16, 2020
de84c19
Updated reference between GeometryCircles and Geometry.
marvin19 Jul 16, 2020
226365c
Updated references in the js-folder
marvin19 Jul 16, 2020
47049e0
Fixed #13914, negative logarithmic values not visible.
bre1470 Jul 16, 2020
ef3892e
Tools: Updated moved file references.
bre1470 Jul 16, 2020
be0657d
Added allowNegativeLog options in LogarithmicAxis.
bre1470 Jul 20, 2020
f2c9020
Fixed #13789, incorrect arearange path when connectEnds is false.
PaulDalek Jul 16, 2020
fcc6995
Fixed time test of range selector input.
bre1470 Jul 17, 2020
b613fd1
Second merge branch master into enhancement/12789
madepiet Jul 23, 2020
7cfcbb7
Merge branch 'master' into enhancement/12789-annotations-in-data-table
madepiet Jul 23, 2020
d720ac1
Merge branch 'vacation2020' into docs/unboostable-boost-options
goransle Jul 24, 2020
dff1741
Docs: Added missing time probe in boost doc.
bre1470 Jul 23, 2020
12dd825
Tools: Fixed moved references in gulp task.
bre1470 Jul 20, 2020
63abcdc
Fixed #13958, changed module, removed CSS height from the demo.
karolkolodziej Jul 27, 2020
161c4c9
Fixed #13719, keep set state after the redraw call.
Jul 17, 2020
8772136
Fixed another wrong reference in a jsdoc task.
bre1470 Jul 21, 2020
b8a142e
Docs: added redirect for old url to packed bubble doc
goransle Jul 27, 2020
454f2c0
Fixed #13359, more than one scrollbar were visible when grid enabled.
karolkolodziej Jul 23, 2020
85801d3
Touch #13359, added test.
karolkolodziej Jul 24, 2020
0086461
Closes #12959, #13937, treemap/sunburst drilldown did not work.
Denyllon Jul 22, 2020
4f469ac
Test added.
Denyllon Jul 22, 2020
fc6eaf3
Fixed #10281, yAxis label adjustment for long text.
Jul 28, 2020
5b18def
Addition to #12789, added better support for csv and lang options.
madepiet Jul 29, 2020
9be4982
Merge branch 'vacation2020' into bugfix/13914-axis-negative-log
bre1470 Jul 29, 2020
aace59b
Fixed #10779, yAxis max value used to breaks the chart.
Jul 29, 2020
08e967a
Fixed #10779, conflict resolving.
Jul 30, 2020
d6d4cba
Removed normalization for lin2log and log2lin.
bre1470 Jul 30, 2020
98f8e5b
Fixed backwards compatibility of lin2log and log2lin.
bre1470 Jul 30, 2020
c08d94c
Merge branch 'vacation2020'
bre1470 Jul 31, 2020
d309bc6
Added sample for allowNegativeLog option.
bre1470 Jul 31, 2020
ed80044
Fixed #10779, label animation for the categorized yAxis.
Jul 31, 2020
756c708
Fixed #10779, label animation requested changes.
Jul 31, 2020
f347b3b
Fixed #10779, polishing changes.
Jul 31, 2020
300befe
Merge pull request #13035 from highcharts/enhancement/12789-annotatio…
oysteinmoseng Aug 3, 2020
c70465a
Fixed #10555, scrollablePlotArea not rendering correctly on FireFox
goransle Jul 30, 2020
721a9bf
Touch #10555, added classname & reference in chart object
goransle Jul 30, 2020
40479dd
Fixed #13971, missing Series import in ColorAxis.
bre1470 Jul 30, 2020
5e8e681
Fixed #13971, added Series imports in case of reference.
bre1470 Jul 30, 2020
4a0aeb0
Merge pull request #13919 from highcharts/bugfix/13914-axis-negative-log
oysteinmoseng Aug 3, 2020
4c6ab47
Merge pull request #13880 from highcharts/docs/unboostable-boost-options
oysteinmoseng Aug 3, 2020
722ba55
Fixed #13707, view table link should be a button.
oysteinmoseng Aug 3, 2020
455a880
Fixed #13864, better accessible legend item labels.
oysteinmoseng Aug 3, 2020
124964e
Update boost-module.md
goransle Jul 30, 2020
2e78ff7
Tools: Updated dependencies.
bre1470 Jul 30, 2020
61e05b1
Tools: Downgraded closure compiler because of increased file size.
bre1470 Jul 30, 2020
32d50c6
Fixed #13729, focus issues with shift+tab.
oysteinmoseng Aug 3, 2020
33a54df
Fixed #10779, requested changes.
Aug 3, 2020
0c1a1bc
Docs: Updated TS readme with latest best practice patterns.
bre1470 Aug 3, 2020
cca4f36
Docs: Clarified type splitting in TS readme.
bre1470 Aug 4, 2020
cc3af28
Docs: Fixed types of ajax options. #13965
bre1470 Jul 30, 2020
4584082
Merge pull request #13970 from highcharts/bugfix/10779-yAxis-max-issue
oysteinmoseng Aug 4, 2020
7dc1d28
Reverted fix #13914, negative logarithmic axis.
bre1470 Aug 10, 2020
49cb070
Fixed legacy support of negative logarithmic demo.
bre1470 Aug 10, 2020
fdea1db
Removed legacy hook
TorsteinHonsi Aug 11, 2020
18c4f5b
Removed legacy sample
TorsteinHonsi Aug 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 2 additions & 10 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@ js/Core/**/*.js
js/Extensions/**/*.js
js/Gantt/**/*.js
js/Maps/**/*.js
js/Mixins/**/*.js
js/Series/**/*.js
js/Stock/**/*.js
js/annotations/**/*.js
js/indicators/**/*.js
js/modules/**/*.js
js/mixins/**/*.js
js/parts/**/*.js
js/parts-3d/**/*.js
js/parts-gantt/**/*.js
js/parts-map/**/*.js
js/parts-more/**/*.js
js/themes/**/*.js
js/Themes/**/*.js
samples/data/**/*.js
samples/highcharts/common-js/**/*.js
samples/highcharts/esm/async-await/demo.js
Expand Down
31 changes: 16 additions & 15 deletions docs/advanced-chart-features/boost-module.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Boost module
===
============

Boost is a stripped-down renderer-in-a-module for Highcharts. It bypasses some of the standard Highcharts features (such as animation), and focuses on pushing as many points as possible as quickly as possible.

Expand All @@ -8,7 +8,7 @@ This document will guide you through your first steps with the Highcharts boost
Including boost in your project
-------------------------------

The boost module is a renderer-in-a-module. Including [modules/boost.js](https://code.highcharts.com/modules/boost.js) will, by default, activate boost for all series that support it (line series, column, bar, treemap, heatmap, scatter, bubble, area).
The boost module is a "renderer-in-a-module". Including [modules/boost.js](https://code.highcharts.com/modules/boost.js) will, by default, activate boost for all series that support it (line series, column, bar, treemap, heatmap, scatter, bubble, area).

If needed, boost can be disabled on a chart-by-chart basis by setting `boost.enabled` to `false` in the chart configuration.

Expand All @@ -17,7 +17,7 @@ If needed, boost can be disabled on a chart-by-chart basis by setting `boost.ena
Configuration Options
---------------------

The main boost configuration is set in the `boost property in the chart options.`
The main boost configuration is set in the `boost` property in the chart options.

|Option|Description|
|--- |--- |
Expand Down Expand Up @@ -92,6 +92,7 @@ There are five different probes that can be activated:
* Series processing (`timeSeriesProcessing`)
* K-d tree processing (`timeKDTree`)
* Buffer copy (`timeBufferCopy`)
* Rendering (`timeRendering`)

All of the above settings are booleans set in the `debug` object on the `boost` property.

Expand All @@ -100,15 +101,15 @@ Note that the K-d tree is build async, which means that it will not lock up the
Samples
-------

* [Area chart](https://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/boost/area/) – 500,000 points
* [Stacked area chart](https://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/boost/area-stacked) – 50,000 points
* [Area range chart](https://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/boost/arearange) – 500,000 points
* [Bubble chart](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/boost/bubble/) - 50,000 points
* [Column chart](https://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/boost/column) – 500,000 points
* [Heatmap](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/boost/heatmap/)
* [Line chart](https://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/boost/line/) – 500,000 points
* [Series-heavy line chart](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/boost/line-series-heavy/) - 600 series, 600,000 points
* [Series-heavy stock chart](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/boost/line-series-heavy-stock/) \- 600 series, 72,000 points
* [Dynamic series-heavy stock chart](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/boost/line-series-heavy-dynamic/) - 600 series, 12,000 initial points; adds 1 point to all series every second
* [Scatter chart](https://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/boost/scatter) – 1,000,000 points
* [Treemap](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/boost/treemap/)
* [Area chart](https://highcharts.com/samples/highcharts/boost/area) – 500,000 points
* [Stacked area chart](https://highcharts.com/samples/highcharts/boost/area-stacked) – 50,000 points
* [Area range chart](https://highcharts.com/samples/highcharts/boost/arearange) – 500,000 points
* [Bubble chart](https://highcharts.com/samples/highcharts/boost/bubble) - 50,000 points
* [Column chart](https://highcharts.com/samples/highcharts/boost/column) – 500,000 points
* [Heatmap](https://highcharts.com/samples/highcharts/boost/heatmap)
* [Line chart](https://highcharts.com/samples/highcharts/boost/line) – 500,000 points
* [Series-heavy line chart](https://highcharts.com/samples/highcharts/boost/line-series-heavy) - 600 series, 600,000 points
* [Series-heavy stock chart](https://highcharts.com/samples/highcharts/boost/line-series-heavy-stock) \- 600 series, 72,000 points
* [Dynamic series-heavy stock chart](https://highcharts.com/samples/highcharts/boost/line-series-heavy-dynamic) - 600 series, 12,000 initial points; adds 1 point to all series every second
* [Scatter chart](https://highcharts.com/samples/highcharts/boost/scatter) – 1,000,000 points
* [Treemap](https://highcharts.com/samples/highcharts/boost/treemap)
3 changes: 2 additions & 1 deletion docs/doc-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
{ from: 'advanced-chart-features/highcharts-typescript-beta', to: 'advanced-chart-features/highcharts-typescript-declarations' },
{ from: 'maps/create-custom-maps-for-highmaps', to: 'maps/create-custom-maps' },
{ from: 'stock/understanding-highstock', to: 'stock/understanding-highcharts-stock' },
{ from: 'getting-started/compatibility', to: 'getting-started/system-requirements' }
{ from: 'getting-started/compatibility', to: 'getting-started/system-requirements' },
{ from: 'chart-and-series-types/packed-bubble-charts', to: 'chart-and-series-types/packed-bubble' }
]
};
6 changes: 2 additions & 4 deletions js/Accessibility/Components/InfoRegionsComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ extend(InfoRegionsComponent.prototype, /** @lends Highcharts.InfoRegionsComponen
*/
getDataTableButtonText: function (buttonId) {
var chart = this.chart, buttonText = chart.langFormat('accessibility.table.viewAsDataTableButtonText', { chart: chart, chartTitle: getChartTitle(chart) });
return '<a id="' + buttonId + '">' + buttonText + '</a>';
return '<button id="' + buttonId + '">' + buttonText + '</button>';
},
/**
* @private
Expand Down Expand Up @@ -420,10 +420,8 @@ extend(InfoRegionsComponent.prototype, /** @lends Highcharts.InfoRegionsComponen
var el = this.viewDataTableButton = getElement(tableButtonId), chart = this.chart, tableId = tableButtonId.replace('hc-linkto-', '');
if (el) {
setElAttrs(el, {
role: 'button',
tabindex: '-1',
'aria-expanded': !!getElement(tableId),
href: '#' + tableId
'aria-expanded': !!getElement(tableId)
});
el.onclick = chart.options.accessibility
.screenReaderSection.onViewDataTableClick ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import KeyboardNavigationHandler from '../../KeyboardNavigationHandler.js';
import EventProvider from '../../Utils/EventProvider.js';
import ChartUtilities from '../../Utils/ChartUtilities.js';
var getPointFromXY = ChartUtilities.getPointFromXY, getSeriesFromName = ChartUtilities.getSeriesFromName, scrollToPoint = ChartUtilities.scrollToPoint;
import '../../../Series/ColumnSeries.js';
import '../../../Series/PieSeries.js';
/* eslint-disable no-invalid-this, valid-jsdoc */
/*
* Set for which series types it makes sense to move to the closest point with
Expand Down
4 changes: 2 additions & 2 deletions js/Accessibility/KeyboardNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ KeyboardNavigation.prototype = {
this.currentModuleIx = 0;
// Run an update to get all modules
this.update();
ep.addEvent(chart.renderTo, 'keydown', function (e) { return _this.onKeydown(e); });
ep.addEvent(this.tabindexContainer, 'keydown', function (e) { return _this.onKeydown(e); });
ep.addEvent(this.tabindexContainer, 'focus', function (e) { return _this.onFocus(e); });
ep.addEvent(doc, 'mouseup', function () { return _this.onMouseUp(); });
ep.addEvent(chart.renderTo, 'mousedown', function () {
Expand Down Expand Up @@ -319,7 +319,7 @@ KeyboardNavigation.prototype = {
var e = ev || win.event, curModule, focusComesFromChart = (e.relatedTarget &&
chart.container.contains(e.relatedTarget)), comingInBackwards = !(focusComesFromChart || keyboardNavigation.exiting);
if (comingInBackwards) {
chart.renderTo.focus();
keyboardNavigation.tabindexContainer.focus();
e.preventDefault();
// Move to last valid keyboard nav module
// Note the we don't run it, just set the index
Expand Down
2 changes: 1 addition & 1 deletion js/Accessibility/Options/LangOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var langOptions = {
*/
legend: {
legendLabel: 'Toggle series visibility',
legendItem: 'Toggle visibility of {itemName}'
legendItem: 'Hide {itemName}'
},
/**
* Chart and map zoom accessibility language options.
Expand Down
4 changes: 2 additions & 2 deletions js/Core/Axis/Axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ var Axis = /** @class */ (function () {
// Placeholder for plotlines and plotbands groups
axis.plotLinesAndBandsGroups = {};
// Shorthand types
axis.positiveValuesOnly = !!(axis.logarithmic && !options.allowNegativeLog);
axis.positiveValuesOnly = !!axis.logarithmic;
// Flag, if axis is linked to another axis
axis.isLinked = defined(options.linkedTo);
/**
Expand Down Expand Up @@ -3472,7 +3472,7 @@ var Axis = /** @class */ (function () {
* More information in x axis labels
*
* @declare Highcharts.AxisDateTimeLabelFormatsOptions
* @product highcharts highstock gantt
* @product highcharts highstock
*/
dateTimeLabelFormats: {
/**
Expand Down
5 changes: 3 additions & 2 deletions js/Core/Axis/ColorAxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var color = Color.parse;
import H from '../Globals.js';
var noop = H.noop;
import Legend from '../Legend.js';
import LegendSymbolMixin from '../../mixins/legend-symbol.js';
import LegendSymbolMixin from '../../Mixins/LegendSymbol.js';
import Point from '../Series/Point.js';
import U from '../Utilities.js';
var addEvent = U.addEvent, erase = U.erase, extend = U.extend, Fx = U.Fx, isNumber = U.isNumber, merge = U.merge, pick = U.pick, splat = U.splat;
Expand All @@ -38,7 +38,8 @@ var addEvent = U.addEvent, erase = U.erase, extend = U.extend, Fx = U.Fx, isNumb
* @typedef {"linear"|"logarithmic"} Highcharts.ColorAxisTypeValue
*/
''; // detach doclet above
import '../../mixins/color-series.js';
import '../../Mixins/ColorSeries.js';
import '../Series/Series.js';
var Series = H.Series, colorPointMixin = H.colorPointMixin, colorSeriesMixin = H.colorSeriesMixin;
extend(Series.prototype, colorSeriesMixin);
extend(Point.prototype, colorPointMixin);
Expand Down
52 changes: 45 additions & 7 deletions js/Core/Axis/GridAxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,42 @@ var applyGridOptions = function applyGridOptions(axis) {
axis.labelRotation = 0;
options.labels.rotation = 0;
};
/**
* For a datetime axis, the scale will automatically adjust to the
* appropriate unit. This member gives the default string
* representations used for each unit. For intermediate values,
* different units may be used, for example the `day` unit can be used
* on midnight and `hour` unit be used for intermediate values on the
* same axis.
* For Gantt possible to declare as a list to provide different
* formats depending on available space.
* For an overview of the replacement codes, see
* [dateFormat](/class-reference/Highcharts#dateFormat).
*
* Defaults to:
* ```js
* {
hour: {
list: ['%H:%M', '%H']
},
day: {
list: ['%A, %e. %B', '%a, %e. %b', '%E']
},
week: {
list: ['Week %W', 'W%W']
},
month: {
list: ['%B', '%b', '%o']
}
},
* ```
*
* @sample {gantt} gantt/demo/left-axis-table
* Gantt Chart with custom axis date format.
*
* @product gantt
* @apioption xAxis.dateTimeLabelFormats
*/
/**
* Set grid options for the axis labels. Requires Highcharts Gantt.
*
Expand Down Expand Up @@ -121,13 +157,11 @@ Axis.prototype.getMaxLabelDimensions = function (ticks, tickPositions) {
label = isObject(tick.label) ? tick.label : {};
// Find width and height of tick
tickHeight = label.getBBox ? label.getBBox().height : 0;
if (label.textStr && !isNumber(label.textPxLength)) {
label.textPxLength = label.getBBox().width;
if (label.textStr) {
// Set the tickWidth same as the label
// width after ellipsis applied #10281
tickWidth = label.getBBox().width;
}
tickWidth = isNumber(label.textPxLength) ?
// Math.round ensures crisp lines
Math.round(label.textPxLength) :
0;
// Update the result if width and/or height are larger
dimensions.height = Math.max(tickHeight, dimensions.height);
dimensions.width = Math.max(tickWidth, dimensions.width);
Expand Down Expand Up @@ -413,7 +447,11 @@ var GridAxis = /** @class */ (function () {
var columnOptions = merge(userOptions, gridOptions.columns[gridOptions.columns.length - columnIndex - 1], {
linkedTo: 0,
// Force to behave like category axis
type: 'category'
type: 'category',
// Disable by default the scrollbar on the grid axis
scrollbar: {
enabled: false
}
});
delete columnOptions.grid.columns; // Prevent recursion
var column = new Axis(axis.chart, columnOptions);
Expand Down
24 changes: 12 additions & 12 deletions js/Core/Axis/Tick.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ var Tick = /** @class */ (function () {
};
}
// Call only after first render
if (animateLabels && axis._addedPlotLB && axis.isXAxis) {
if (animateLabels && axis._addedPlotLB) {
tick.moveLabel(str, labelOptions);
}
// First call
Expand Down Expand Up @@ -437,14 +437,14 @@ var Tick = /** @class */ (function () {
* @return {void}
*/
Tick.prototype.moveLabel = function (str, labelOptions) {
var tick = this, label = tick.label, moved = false, xAxis = tick.axis, chart = xAxis.chart, labelPos, reversed = xAxis.reversed, inverted = chart.inverted, xPos, yPos;
var tick = this, label = tick.label, moved = false, axis = tick.axis, labelPos, reversed = axis.reversed, xPos, yPos;
if (label && label.textStr === str) {
tick.movedLabel = label;
moved = true;
delete tick.label;
}
else { // Find a label with the same string
objectEach(xAxis.ticks, function (currentTick) {
objectEach(axis.ticks, function (currentTick) {
if (!moved &&
!currentTick.isNew &&
currentTick !== tick &&
Expand All @@ -460,10 +460,10 @@ var Tick = /** @class */ (function () {
// Create new label if the actual one is moved
if (!moved && (tick.labelPos || label)) {
labelPos = tick.labelPos || label.xy;
xPos = inverted ?
labelPos.x : (reversed ? 0 : xAxis.width + xAxis.left);
yPos = inverted ?
(reversed ? (xAxis.width + xAxis.left) : 0) : labelPos.y;
xPos = axis.horiz ?
(reversed ? 0 : axis.width + axis.left) : labelPos.x;
yPos = axis.horiz ?
labelPos.y : (reversed ? (axis.width + axis.left) : 0);
tick.movedLabel = tick.createLabel({ x: xPos, y: yPos }, str, labelOptions);
if (tick.movedLabel) {
tick.movedLabel.attr({ opacity: 0 });
Expand Down Expand Up @@ -647,13 +647,13 @@ var Tick = /** @class */ (function () {
* @return {void}
*/
Tick.prototype.replaceMovedLabel = function () {
var tick = this, label = tick.label, axis = tick.axis, reversed = axis.reversed, chart = tick.axis.chart, inverted = chart.inverted, x, y;
var tick = this, label = tick.label, axis = tick.axis, reversed = axis.reversed, x, y;
// Animate and destroy
if (label && !tick.isNew) {
x = inverted ? label.xy.x : (reversed ? axis.left : axis.width + axis.left);
y = inverted ?
(reversed ? axis.width + axis.top : axis.top) :
label.xy.y;
x = axis.horiz ? (reversed ? axis.left : axis.width + axis.left) : label.xy.x;
y = axis.horiz ?
label.xy.y :
(reversed ? axis.width + axis.top : axis.top);
label.animate({ x: x, y: y, opacity: 0 }, void 0, label.destroy);
delete tick.label;
}
Expand Down
18 changes: 15 additions & 3 deletions js/Core/Axis/TreeGridAxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import Axis from './Axis.js';
import Tick from './Tick.js';
import Tree from '../../Gantt/Tree.js';
import TreeGridTick from './TreeGridTick.js';
import TreeSeriesMixin from '../../mixins/tree-series.js';
import mixinTreeSeries from '../../Mixins/TreeSeries.js';
var getLevelOptions = mixinTreeSeries.getLevelOptions;
import U from '../Utilities.js';
var addEvent = U.addEvent, find = U.find, fireEvent = U.fireEvent, isNumber = U.isNumber, isObject = U.isObject, isString = U.isString, merge = U.merge, pick = U.pick, wrap = U.wrap;
import './GridAxis.js';
Expand Down Expand Up @@ -218,7 +219,7 @@ var TreeGridAxis;
axes.filter(function (axis) {
return axis.options.type === 'treegrid';
}).forEach(function (axis) {
var options = axis.options || {}, labelOptions = options.labels, uniqueNames = options.uniqueNames, numberOfSeries = 0, isDirty, data, treeGrid;
var options = axis.options || {}, labelOptions = options.labels, uniqueNames = options.uniqueNames, numberOfSeries = 0, isDirty, data, treeGrid, max = options.max;
// Check whether any of series is rendering for the first time,
// visibility has changed, or its data is dirty,
// and only then update. #10570, #10580
Expand Down Expand Up @@ -249,6 +250,17 @@ var TreeGridAxis;
}
return arr;
}, []);
// If max is higher than set data - add a
// dummy data to render categories #10779
if (max && data.length < max) {
for (var i = data.length; i <= max; i++) {
data.push({
// Use the zero-width character
// to avoid conflict with uniqueNames
name: i + '\u200B'
});
}
}
// setScale is fired after all the series is initialized,
// which is an ideal time to update the axis.categories.
treeGrid = getTreeGridFromData(data, uniqueNames || false, (uniqueNames === true) ? numberOfSeries : 1);
Expand All @@ -269,7 +281,7 @@ var TreeGridAxis;
});
// Calculate the label options for each level in the tree.
axis.treeGrid.mapOptionsToLevel =
TreeSeriesMixin.getLevelOptions({
getLevelOptions({
defaults: labelOptions,
from: 1,
levels: labelOptions && labelOptions.levels,
Expand Down