package.modules.debugger.src.js Maven / Gradle / Ivy
Show all versions of highcharts Show documentation
/**
* @license Highcharts JS v11.4.8 (2024-08-29)
*
* Debugger module
*
* (c) 2012-2024 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function (factory) {
if (typeof module === 'object' && module.exports) {
factory['default'] = factory;
module.exports = factory;
} else if (typeof define === 'function' && define.amd) {
define('highcharts/modules/debugger', ['highcharts'], function (Highcharts) {
factory(Highcharts);
factory.Highcharts = Highcharts;
return factory;
});
} else {
factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
}
}(function (Highcharts) {
'use strict';
var _modules = Highcharts ? Highcharts._modules : {};
function _registerModule(obj, path, args, fn) {
if (!obj.hasOwnProperty(path)) {
obj[path] = fn.apply(null, args);
if (typeof CustomEvent === 'function') {
Highcharts.win.dispatchEvent(new CustomEvent(
'HighchartsModuleLoaded',
{ detail: { path: path, module: obj[path] } }
));
}
}
}
_registerModule(_modules, 'Extensions/Debugger/ErrorMessages.js', [], function () {
/* eslint-disable */
/* *
* Error information for the debugger module
* (c) 2010-2021 Torstein Honsi
* License: www.highcharts.com/license
*/
// DO NOT EDIT!
// Automatically generated by ./tools/error-messages.js
// Sources can be found in ./errors/*/*.md
const errorMessages = {
"10": {
"title": "Can't plot zero or subzero values on a logarithmic axis",
"text": "Can't plot zero or subzero values on a logarithmic axis
This error occurs in the following situations:
- If a zero or subzero data value is added to a logarithmic axis
- If the minimum of a logarithmic axis is set to 0 or less
- If the threshold is set to 0 or less
Note: As of Highcharts 5.0.8 it's possible to bypass this error message by setting Axis.prototype.allowNegativeLog
to true, and add custom conversion functions. View live demo. It is also possible to use a similar workaround for colorAxis. View live demo.
",
"enduser": "Can't plot zero or subzero values on a logarithmic axis
This error occurs in the following situations:
- If a zero or subzero data value is added to a logarithmic axis
- If the minimum of a logarithmic axis is set to 0 or less
- If the threshold is set to 0 or less
As of Highcharts 5.0.8 it's possible to bypass this error message by setting Axis.prototype.allowNegativeLog
to true
and add custom conversion functions. \">View Live Demo. It is also possible to use a similar workaround for colorAxis. View live demo.
"
},
"11": {
"title": "Can't link axes of different type",
"text": "Can't link axes of different type
This error occurs when using the linkedTo
option to link two axes of different types, for example a logarithmic axis to a linear axis. Highcharts can't link these because the calculation of ticks, extremes, padding etc. is different.
"
},
"12": {
"title": "Highcharts expects point configuration to be numbers or arrays in turbo mode",
"text": "Highcharts expects point configuration to be numbers or arrays in turbo mode
This error occurs if the series.data
option contains object configurations and the number of points exceeds the turboThreshold. It can be fixed by either setting turboThreshold
to a higher value, or changing the point configurations to numbers or arrays.
In boost mode, turbo mode is always on, which means only array of numbers or two dimensional arrays are allowed.
See plotOptions.series.turboThreshold
"
},
"13": {
"title": "Rendering div not found",
"text": "Rendering div not found
This error occurs if the chart.renderTo option is misconfigured so that Highcharts is unable to find the HTML element to render the chart in.
If using a DOM ID when creating the chart, make sure a node with the same ID exists somewhere in the DOM.
"
},
"14": {
"title": "String value sent to series.data, expected Number",
"text": "String value sent to series.data, expected Number
This happens if using a string as a data point, for example in a setup like this:
series: [{\n data: ["3", "5", "1", "6"]\n}]
Highcharts expects numerical data values.
The most common reason for this error this is that data is parsed from CSV or from a XML source, and the implementer forgot to run parseFloat
on the parsed value.
Note: For performance reasons internal type casting is not performed, and only the first value is checked (since 2.3).
"
},
"15": {
"title": "Highcharts expects data to be sorted",
"text": "Highcharts expects data to be sorted
This happens when creating a line series or a stock chart where the data is not sorted in ascending X order.
For performance reasons, Highcharts does not sort the data, instead it requires that the implementer pre-sorts the data.
"
},
"16": {
"title": "Highcharts already defined in the page",
"text": "Highcharts already defined in the page
This error happens if the Highcharts
namespace already exists when loading Highcharts or Highstock.
This is caused by including Highcharts or Highstock more than once.
Keep in mind that the Highcharts.Chart
constructor and all features of Highcharts are included in Highstock, so if using the Chart
and StockChart
constructors in combination, only the highstock.js
file is required.
"
},
"17": {
"title": "The requested series type does not exist",
"text": "The requested series type does not exist
This error happens when setting chart.type
or series.type
to a series type that isn't defined in Highcharts. A typical reason may be that the module or extension where the series type is defined isn't included.
For example in order to create an arearange
series, the highcharts-more.js
file must be loaded.
"
},
"18": {
"title": "The requested axis does not exist",
"text": "The requested axis does not exist
This error happens when setting a series' xAxis
or yAxis
property to point to an axis that does not exist.
"
},
"19": {
"title": "Too many ticks",
"text": "Too many ticks
This error happens when applying too many ticks to an axis, specifically when adding more ticks than the axis pixel length.
With default value this won't happen, but there are edge cases, for example when setting axis categories and xAxis.labels.step
in combination with a long data range, when the axis is instructed to create a great number of ticks.
"
},
"20": {
"title": "Can't add object point configuration to a long data series",
"text": "Can't add object point configuration to a long data series
In Highstock, when trying to add a point using the object literal configuration syntax, it will only work when the number of data points is below the series' turboThreshold. Instead of the object syntax, use the Array syntax.
"
},
"21": {
"title": "Can't find Proj4js library",
"text": "Can't find Proj4js library
Using latitude/longitude functionality with pre-projected GeoJSON in Highcharts Maps requires the Proj4js library to be loaded.
It is recommended to utilize TopoJSON for Highcharts v10 and above, as built-in projection support is included and no third-party library is required. For more information, see the Highcharts now prefers topojson maps.
"
},
"22": {
"title": "Map does not support latitude/longitude",
"text": "Map does not support latitude/longitude
The loaded map does not support latitude/longitude functionality. This is only supported with maps from the official Highmaps map collection from version 1.1.0 onwards. If you are using a custom map, consider using the Proj4js library to convert between projections.
"
},
"23": {
"title": "Unsupported color format used for color interpolation",
"text": "Unsupported color format used for color interpolation
Highcharts supports three color formats primarily: hex (#FFFFFF
), rgb (rgba(255,255,255)
) and rgba (rgba(255,255,255,1)
). If any other format, like 3-digit colors (#FFF
), named colors (white
) or gradient structures are used in for example a heatmap, Highcharts will fail to interpolate and will instead use the end-color with no interpolation applied.
We've chosen to preserve this limitation in order to keep the weight of the implementation at a minimum.
"
},
"24": {
"title": "Cannot run Point.update on a grouped point",
"text": "Cannot run Point.update on a grouped point
Running Point.update
in Highstock when a point is grouped by data grouping is not supported.
This is not supported because when data grouping is enabled, there won't be any references to the raw points, which is required by the Point.update
function.
"
},
"25": {
"title": "Can't find Moment.js library",
"text": "Can't find Moment.js library
Using the global.timezone option requires the Moment.js library to be loaded.
"
},
"26": {
"title": "WebGL not supported, and no fallback module included",
"text": "WebGL not supported, and no fallback module included
This happens when the browser doesn't support WebGL,and the canvas fallback module (boost-canvas.js
) hasn't been included OR if the fallback module was includedafter the boost module.
If a fallback is required, make sure to include boost-canvas.js
, and that it's included before boost.js
.
Please note that the fallback module is not intended as a fully-featured one. Rather, it's a minimal implementation of the WebGL counterpart.
"
},
"28": {
"title": "Fallback to export server disabled",
"text": "Fallback to export server disabled
This happens when the offline export module encounters a chart that it can't export successfully, and the fallback to the online export server is disabled. The offline exporting module will fail for certain browsers, and certain features (e.g. exporting.allowHTML ), depending on the type of image exporting to. For a compatibility overview, see Client Side Export.
For very complex charts, it's possible that exporting fail in browsers that don't support Blob objects, due to data URL length limits. It's always recommended to define the exporting.error callback when disabling the fallback, so that details can be provided to the end-user if offline export isn't working for them.
"
},
"29": {
"title": "Browser does not support WebAudio",
"text": "Browser does not support WebAudio
This happens when you attempt to use the sonification module on a chart in a browser or environment that does not support the WebAudio API. This API is supported on all modern browsers, including Microsoft Edge, Google Chrome and Mozilla Firefox.
"
},
"30": {
"title": "Invalid instrument",
"text": "Invalid instrument
This happens when you try to use a sonification instrument that is not valid. If you are using a predefined instrument, make sure your spelling is correct.
"
},
"31": {
"title": "Non-unique point or node id",
"text": "Non-unique point or node id
This error occurs when using the same id
for two or more points or nodes.
"
},
"32": {
"title": "Deprecated function or property",
"text": "Deprecated function or property
This error occurs when using a deprecated function or property. Consult the API documentation for alternatives, if no replacement is mentioned by the error itself.
"
},
"33": {
"title": "Invalid attribute or tagName",
"text": "Invalid attribute or tagName
This error occurs if HTML in the chart configuration contains unknown tag names or attributes. Unknown tag names or attributes are those not present in the _allow lists_.
To fix the error, consider
- Is your tag name or attribute spelled correctly? For example,
lineargradient
would be blocked as it is a misspelling for linearGradient
.
- Is it allowed in Highcharts? For example,
onclick
attributes are blocked as
they pose a real security threat.
This error occurs because attributes and tag names are sanitized of potentially harmful content from the chart configuration before being added to the DOM. Consult the security documentation for more information.
"
},
"34": {
"title": "Unknown time zone",
"text": "Unknown time zone
This error occurs if the browser doesn't recognize the timezone option. Possible workarounds are to use a time zone definition that all browsers recognize, or create your own getTimezoneOffset callback.
"
}
};
return errorMessages;
});
_registerModule(_modules, 'Extensions/Debugger/Debugger.js', [_modules['Core/Defaults.js'], _modules['Extensions/Debugger/ErrorMessages.js'], _modules['Core/Globals.js'], _modules['Core/Utilities.js']], function (D, ErrorMessages, H, U) {
/* *
*
* (c) 2010-2024 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
const { setOptions } = D;
const { composed } = H;
const { addEvent, find, isNumber, pushUnique } = U;
/* *
*
* Constants
*
* */
const defaultOptions = {
/**
* @optionparent chart
*/
chart: {
/**
* Whether to display errors on the chart. When `false`, the errors will
* be shown only in the console.
*
* @sample highcharts/chart/display-errors/
* Show errors on chart
*
* @since 7.0.0
* @requires modules/debugger
*/
displayErrors: true
}
};
/* *
*
* Functions
*
* */
/**
* @private
*/
function compose(ChartClass) {
if (pushUnique(composed, 'Debugger')) {
addEvent(ChartClass, 'beforeRedraw', onChartBeforeRedraw);
addEvent(H, 'displayError', onHighchartsDisplayError);
setOptions(defaultOptions);
}
}
/**
* @private
*/
function onChartBeforeRedraw() {
const errorElements = this.errorElements;
if (errorElements && errorElements.length) {
for (const el of errorElements) {
el.destroy();
}
}
delete this.errorElements;
}
/**
* @private
*/
function onHighchartsDisplayError(e) {
// Display error on the chart causing the error or the last created chart.
const chart = (e.chart ||
find(this.charts.slice().reverse(), (c) => !!c));
if (!chart) {
return;
}
const code = e.code, options = chart.options.chart, renderer = chart.renderer;
let msg, chartWidth, chartHeight;
if (chart.errorElements) {
for (const el of chart.errorElements) {
if (el) {
el.destroy();
}
}
}
if (options && options.displayErrors && renderer) {
chart.errorElements = [];
msg = isNumber(code) ?
('Highcharts error #' + code + ': ' +
ErrorMessages[code].text) :
code;
chartWidth = chart.chartWidth;
chartHeight = chart.chartHeight;
// Format msg so SVGRenderer can handle it
msg = msg
.replace(/(.*)<\/h1>/g, '
$1
')
.replace(/
/g, '')
.replace(/<\/p>/g, '
');
// Render red chart frame.
chart.errorElements[0] = renderer.rect(2, 2, chartWidth - 4, chartHeight - 4).attr({
'stroke-width': 4,
stroke: '#ff0000',
zIndex: 3
}).add();
// Render error message
chart.errorElements[1] = renderer.label(msg, 0, 0, 'rect', void 0, void 0, void 0, void 0, 'debugger').css({
color: '#ffffff',
fontSize: '0.8em',
width: (chartWidth - 16) + 'px',
padding: 0
}).attr({
fill: 'rgba(255, 0, 0, 0.9)',
width: chartWidth,
padding: 8,
zIndex: 10
}).add();
chart.errorElements[1].attr({
y: chartHeight - chart.errorElements[1].getBBox().height
});
}
}
/* *
*
* Default Export
*
* */
const Debugger = {
compose
};
return Debugger;
});
_registerModule(_modules, 'masters/modules/debugger.src.js', [_modules['Core/Globals.js'], _modules['Extensions/Debugger/Debugger.js'], _modules['Extensions/Debugger/ErrorMessages.js']], function (Highcharts, Debugger, ErrorMessages) {
const G = Highcharts;
G.errorMessages = G.errorMessages || ErrorMessages;
Debugger.compose(G.Chart);
return Highcharts;
});
}));