highcharts 9.1.1 → 9.2.2
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.
- package/bower.json +1 -1
- package/css/annotations/popup.css +29 -28
- package/css/annotations/popup.scss +29 -27
- package/css/highcharts.css +15 -0
- package/css/highcharts.scss +12 -0
- package/css/stocktools/gui.css +1 -0
- package/css/stocktools/gui.scss +1 -0
- package/css/themes/dark-unica.css +15 -0
- package/css/themes/grid-light.css +15 -0
- package/css/themes/sand-signika.css +15 -0
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +8 -2
- package/es-modules/Accessibility/Components/LegendComponent.js +19 -8
- package/es-modules/Accessibility/Components/MenuComponent.js +19 -13
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +4 -8
- package/es-modules/Accessibility/FocusBorder.js +1 -3
- package/es-modules/Accessibility/Options/LangOptions.js +3 -3
- package/es-modules/Accessibility/Utils/Announcer.js +22 -5
- package/es-modules/Accessibility/Utils/ChartUtilities.js +6 -1
- package/es-modules/Core/Animation/AnimationUtilities.js +12 -4
- package/es-modules/Core/Animation/Fx.js +15 -12
- package/es-modules/Core/Axis/Axis.js +25 -13
- package/es-modules/Core/Axis/AxisDefaults.js +0 -1
- package/es-modules/Core/Axis/BrokenAxis.js +32 -15
- package/es-modules/Core/Axis/Color/ColorAxis.js +665 -0
- package/es-modules/Core/Axis/Color/ColorAxisComposition.js +237 -0
- package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +434 -0
- package/es-modules/Core/Axis/DateTimeAxis.js +163 -133
- package/es-modules/Core/Axis/GridAxis.js +8 -3
- package/es-modules/Core/Axis/LogarithmicAxis.js +159 -117
- package/es-modules/Core/Axis/OrdinalAxis.js +666 -460
- package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +874 -0
- package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js +292 -0
- package/es-modules/Core/Axis/RadialAxis.js +858 -745
- package/es-modules/Core/Axis/ScrollbarAxis.js +7 -0
- package/es-modules/Core/Axis/StackingAxis.js +159 -140
- package/es-modules/Core/Axis/Tick.js +17 -27
- package/es-modules/Core/Chart/Chart.js +24 -38
- package/es-modules/Core/Chart/ChartDefaults.js +1 -1
- package/es-modules/Core/Chart/StockChart.js +12 -0
- package/es-modules/Core/Color/Color.js +96 -104
- package/es-modules/Core/DefaultOptions.js +269 -248
- package/es-modules/Core/Foundation.js +9 -8
- package/es-modules/Core/Geometry/CircleUtilities.js +385 -0
- package/es-modules/Core/Geometry/GeometryUtilities.js +83 -0
- package/es-modules/Core/Globals.js +23 -1
- package/es-modules/{Extensions/Ajax.js → Core/HttpUtilities.js} +86 -42
- package/es-modules/Core/{Legend.js → Legend/Legend.js} +142 -116
- package/es-modules/{Mixins → Core/Legend}/LegendSymbol.js +54 -38
- package/es-modules/Core/Navigator.js +3 -0
- package/es-modules/Core/Pointer.js +9 -0
- package/es-modules/Core/Renderer/HTML/AST.js +100 -82
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +17 -7
- package/es-modules/Core/Renderer/HTML/HTMLRenderer.js +26 -9
- package/es-modules/Core/Renderer/RendererRegistry.js +9 -4
- package/es-modules/Core/Renderer/RendererUtilities.js +159 -0
- package/es-modules/Core/Renderer/SVG/SVGElement.js +13 -7
- package/es-modules/Core/Renderer/SVG/SVGLabel.js +9 -29
- package/es-modules/Core/Renderer/SVG/SVGRenderer.js +2 -2
- package/es-modules/Core/Renderer/SVG/TextBuilder.js +18 -16
- package/es-modules/Core/Responsive.js +166 -148
- package/es-modules/Core/Series/DataLabel.js +564 -0
- package/es-modules/Core/Series/Point.js +233 -209
- package/es-modules/Core/Series/Series.js +174 -2339
- package/es-modules/Core/Series/SeriesDefaults.js +2293 -0
- package/es-modules/Core/Series/SeriesRegistry.js +3 -9
- package/es-modules/Core/Time.js +78 -2
- package/es-modules/Core/Tooltip.js +178 -236
- package/es-modules/Core/Utilities.js +409 -394
- package/es-modules/Extensions/Annotations/Annotations.js +102 -49
- package/es-modules/Extensions/Annotations/Mixins/EventEmitterMixin.js +9 -1
- package/es-modules/Extensions/Annotations/NavigationBindings.js +30 -25
- package/es-modules/Extensions/Annotations/Popup.js +16 -7
- package/es-modules/Extensions/Boost/BoostOverrides.js +5 -1
- package/es-modules/Extensions/Boost/WGLRenderer.js +5 -4
- package/es-modules/Extensions/Boost/WGLVBuffer.js +3 -0
- package/es-modules/Extensions/BoostCanvas.js +1 -1
- package/es-modules/Extensions/CurrentDateIndication.js +1 -1
- package/es-modules/Extensions/Data.js +82 -76
- package/es-modules/Extensions/DataGrouping.js +225 -184
- package/es-modules/Extensions/Debugger/ErrorMessages.js +2 -2
- package/es-modules/Extensions/DraggablePoints.js +13 -5
- package/es-modules/Extensions/Drilldown.js +41 -14
- package/es-modules/Extensions/ExportData.js +7 -4
- package/es-modules/Extensions/Exporting/Exporting.js +1273 -0
- package/es-modules/Extensions/Exporting/ExportingDefaults.js +803 -0
- package/es-modules/Extensions/Exporting/ExportingSymbols.js +73 -0
- package/es-modules/Extensions/FullScreen.js +7 -5
- package/es-modules/Extensions/NoDataToDisplay.js +1 -1
- package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +617 -0
- package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +58 -0
- package/es-modules/Extensions/Oldie/Oldie.js +1 -1
- package/es-modules/Extensions/Pane.js +0 -1
- package/es-modules/Extensions/PatternFill.js +23 -10
- package/es-modules/Extensions/Polar.js +2 -1
- package/es-modules/Extensions/RangeSelector.js +1 -1
- package/es-modules/Extensions/Themes/Avocado.js +49 -20
- package/es-modules/Extensions/Themes/DarkBlue.js +226 -203
- package/es-modules/Extensions/Themes/DarkGreen.js +231 -203
- package/es-modules/Extensions/Themes/DarkUnica.js +201 -172
- package/es-modules/Extensions/Themes/Gray.js +228 -205
- package/es-modules/Extensions/Themes/Grid.js +109 -81
- package/es-modules/Extensions/Themes/GridLight.js +83 -55
- package/es-modules/Extensions/Themes/HighContrastDark.js +192 -164
- package/es-modules/Extensions/Themes/HighContrastLight.js +49 -21
- package/es-modules/Extensions/Themes/SandSignika.js +115 -86
- package/es-modules/Extensions/Themes/Skies.js +102 -74
- package/es-modules/Extensions/Themes/Sunset.js +47 -19
- package/es-modules/Mixins/ColorSeries.js +0 -1
- package/es-modules/Mixins/MultipleLines.js +6 -0
- package/es-modules/Mixins/TreeSeries.js +1 -1
- package/es-modules/Series/Area/AreaSeries.js +2 -2
- package/es-modules/Series/AreaSpline/AreaSplineSeries.js +2 -2
- package/es-modules/Series/Bubble/BubbleLegendComposition.js +279 -0
- package/es-modules/Series/Bubble/BubbleLegendDefaults.js +267 -0
- package/es-modules/Series/Bubble/BubbleLegendItem.js +472 -0
- package/es-modules/Series/Bubble/BubbleSeries.js +6 -2
- package/es-modules/Series/Column/ColumnDataLabel.js +109 -0
- package/es-modules/Series/Column/ColumnSeries.js +39 -26
- package/es-modules/Series/Column3D/Column3DComposition.js +5 -2
- package/es-modules/Series/Flags/FlagsSeries.js +8 -1
- package/es-modules/Series/Gantt/GanttSeries.js +3 -3
- package/es-modules/Series/Heatmap/HeatmapSeries.js +9 -5
- package/es-modules/Series/HeikinAshi/HeikinAshiPoint.js +60 -0
- package/es-modules/Series/HeikinAshi/HeikinAshiSeries.js +277 -0
- package/es-modules/Series/HollowCandlestick/HollowCandlestickPoint.js +83 -0
- package/es-modules/Series/HollowCandlestick/HollowCandlestickSeries.js +370 -0
- package/es-modules/Series/Line/LineSeries.js +12 -8
- package/es-modules/Series/Map/MapSeries.js +5 -3
- package/es-modules/Series/MapBubble/MapBubbleSeries.js +6 -5
- package/es-modules/Series/OHLC/OHLCPoint.js +11 -0
- package/es-modules/Series/PackedBubble/PackedBubbleSeries.js +3 -1
- package/es-modules/Series/Pie/PieDataLabel.js +448 -0
- package/es-modules/Series/Pie/PiePoint.js +35 -34
- package/es-modules/Series/Pie/PieSeries.js +19 -16
- package/es-modules/Series/Polygon/PolygonSeries.js +3 -3
- package/es-modules/Series/Sankey/SankeySeries.js +9 -7
- package/es-modules/Series/SolidGauge/SolidGaugeSeries.js +2 -2
- package/es-modules/Series/Sunburst/SunburstSeries.js +1 -14
- package/es-modules/Series/Timeline/TimelinePoint.js +6 -0
- package/es-modules/Series/Timeline/TimelineSeries.js +14 -17
- package/es-modules/Series/Treemap/TreemapSeries.js +3 -3
- package/es-modules/Series/Venn/VennSeries.js +4 -4
- package/es-modules/Series/Venn/VennUtils.js +10 -16
- package/es-modules/Series/Waterfall/WaterfallSeries.js +40 -35
- package/es-modules/Series/Wordcloud/WordcloudSeries.js +1 -0
- package/es-modules/Series/XRange/XRangeSeries.js +4 -2
- package/es-modules/Stock/Indicators/SMA/SMAIndicator.js +92 -75
- package/es-modules/Stock/Indicators/Supertrend/SupertrendIndicator.js +20 -8
- package/es-modules/Stock/Indicators/VBP/VBPIndicator.js +17 -4
- package/es-modules/Stock/StockToolsBindings.js +77 -38
- package/es-modules/Stock/StockToolsGui.js +28 -3
- package/es-modules/masters/highcharts-3d.src.js +1 -1
- package/es-modules/masters/highcharts-gantt.src.js +1 -1
- package/es-modules/masters/highcharts-more.src.js +11 -7
- package/es-modules/masters/highcharts.src.js +25 -9
- package/es-modules/masters/highmaps.src.js +1 -1
- package/es-modules/masters/highstock.src.js +1 -1
- package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
- package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
- package/es-modules/masters/indicators/ao.src.js +1 -1
- package/es-modules/masters/indicators/apo.src.js +1 -1
- package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
- package/es-modules/masters/indicators/aroon.src.js +1 -1
- package/es-modules/masters/indicators/atr.src.js +1 -1
- package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
- package/es-modules/masters/indicators/cci.src.js +1 -1
- package/es-modules/masters/indicators/chaikin.src.js +1 -1
- package/es-modules/masters/indicators/cmf.src.js +1 -1
- package/es-modules/masters/indicators/cmo.src.js +1 -1
- package/es-modules/masters/indicators/dema.src.js +1 -1
- package/es-modules/masters/indicators/disparity-index.src.js +1 -1
- package/es-modules/masters/indicators/dmi.src.js +1 -1
- package/es-modules/masters/indicators/dpo.src.js +1 -1
- package/es-modules/masters/indicators/ema.src.js +1 -1
- package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/es-modules/masters/indicators/indicators-all.src.js +1 -1
- package/es-modules/masters/indicators/indicators.src.js +1 -1
- package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
- package/es-modules/masters/indicators/klinger.src.js +1 -1
- package/es-modules/masters/indicators/macd.src.js +1 -1
- package/es-modules/masters/indicators/mfi.src.js +1 -1
- package/es-modules/masters/indicators/momentum.src.js +1 -1
- package/es-modules/masters/indicators/natr.src.js +1 -1
- package/es-modules/masters/indicators/obv.src.js +1 -1
- package/es-modules/masters/indicators/pivot-points.src.js +1 -1
- package/es-modules/masters/indicators/ppo.src.js +1 -1
- package/es-modules/masters/indicators/price-channel.src.js +1 -1
- package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
- package/es-modules/masters/indicators/psar.src.js +1 -1
- package/es-modules/masters/indicators/regressions.src.js +1 -1
- package/es-modules/masters/indicators/roc.src.js +1 -1
- package/es-modules/masters/indicators/rsi.src.js +1 -1
- package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
- package/es-modules/masters/indicators/stochastic.src.js +1 -1
- package/es-modules/masters/indicators/supertrend.src.js +1 -1
- package/es-modules/masters/indicators/tema.src.js +1 -1
- package/es-modules/masters/indicators/trendline.src.js +1 -1
- package/es-modules/masters/indicators/trix.src.js +1 -1
- package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
- package/es-modules/masters/indicators/vwap.src.js +1 -1
- package/es-modules/masters/indicators/williams-r.src.js +1 -1
- package/es-modules/masters/indicators/wma.src.js +1 -1
- package/es-modules/masters/indicators/zigzag.src.js +1 -1
- package/es-modules/masters/modules/accessibility.src.js +1 -1
- package/es-modules/masters/modules/annotations-advanced.src.js +1 -1
- package/es-modules/masters/modules/annotations.src.js +1 -1
- package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
- package/es-modules/masters/modules/boost-canvas.src.js +1 -1
- package/es-modules/masters/modules/boost.src.js +1 -1
- package/es-modules/masters/modules/broken-axis.src.js +1 -1
- package/es-modules/masters/modules/bullet.src.js +1 -1
- package/es-modules/masters/modules/coloraxis.src.js +6 -2
- package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
- package/es-modules/masters/modules/cylinder.src.js +1 -1
- package/es-modules/masters/modules/data.src.js +8 -1
- package/es-modules/masters/modules/datagrouping.src.js +1 -1
- package/es-modules/masters/modules/debugger.src.js +1 -1
- package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
- package/es-modules/masters/modules/dotplot.src.js +1 -1
- package/es-modules/masters/modules/drag-panes.src.js +1 -1
- package/es-modules/masters/modules/draggable-points.src.js +1 -1
- package/es-modules/masters/modules/drilldown.src.js +1 -1
- package/es-modules/masters/modules/dumbbell.src.js +1 -1
- package/es-modules/masters/modules/export-data.src.js +1 -1
- package/es-modules/masters/modules/exporting.src.js +10 -2
- package/es-modules/masters/modules/full-screen.src.js +1 -1
- package/es-modules/masters/modules/funnel.src.js +1 -1
- package/es-modules/masters/modules/funnel3d.src.js +1 -1
- package/es-modules/masters/modules/gantt.src.js +9 -4
- package/es-modules/masters/modules/grid-axis.src.js +1 -1
- package/es-modules/masters/modules/heatmap.src.js +6 -2
- package/es-modules/masters/modules/heikinashi.src.js +14 -0
- package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
- package/es-modules/masters/modules/hollowcandlestick.src.js +14 -0
- package/es-modules/masters/modules/item-series.src.js +1 -1
- package/es-modules/masters/modules/lollipop.src.js +1 -1
- package/es-modules/masters/modules/map.src.js +10 -6
- package/es-modules/masters/modules/marker-clusters.src.js +1 -1
- package/es-modules/masters/modules/networkgraph.src.js +1 -1
- package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
- package/es-modules/masters/modules/offline-exporting.src.js +8 -2
- package/es-modules/masters/modules/oldie-polyfills.src.js +1 -1
- package/es-modules/masters/modules/oldie.src.js +1 -1
- package/es-modules/masters/modules/organization.src.js +1 -1
- package/es-modules/masters/modules/overlapping-datalabels.src.js +1 -1
- package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
- package/es-modules/masters/modules/pareto.src.js +1 -1
- package/es-modules/masters/modules/pathfinder.src.js +1 -1
- package/es-modules/masters/modules/pattern-fill.src.js +1 -1
- package/es-modules/masters/modules/price-indicator.src.js +1 -1
- package/es-modules/masters/modules/pyramid3d.src.js +1 -1
- package/es-modules/masters/modules/sankey.src.js +1 -1
- package/es-modules/masters/modules/series-label.src.js +1 -1
- package/es-modules/masters/modules/solid-gauge.src.js +1 -1
- package/es-modules/masters/modules/sonification.src.js +1 -1
- package/es-modules/masters/modules/static-scale.src.js +1 -1
- package/es-modules/masters/modules/stock-tools.src.js +1 -1
- package/es-modules/masters/modules/stock.src.js +3 -2
- package/es-modules/masters/modules/streamgraph.src.js +1 -1
- package/es-modules/masters/modules/sunburst.src.js +1 -1
- package/es-modules/masters/modules/tilemap.src.js +1 -1
- package/es-modules/masters/modules/timeline.src.js +1 -1
- package/es-modules/masters/modules/treegrid.src.js +1 -1
- package/es-modules/masters/modules/treemap.src.js +1 -1
- package/es-modules/masters/modules/variable-pie.src.js +1 -1
- package/es-modules/masters/modules/variwide.src.js +1 -1
- package/es-modules/masters/modules/vector.src.js +1 -1
- package/es-modules/masters/modules/venn.src.js +1 -1
- package/es-modules/masters/modules/windbarb.src.js +1 -1
- package/es-modules/masters/modules/wordcloud.src.js +1 -1
- package/es-modules/masters/modules/xrange.src.js +1 -1
- package/es-modules/masters/themes/avocado.src.js +5 -2
- package/es-modules/masters/themes/dark-blue.src.js +5 -2
- package/es-modules/masters/themes/dark-green.src.js +5 -2
- package/es-modules/masters/themes/dark-unica.src.js +5 -2
- package/es-modules/masters/themes/gray.src.js +5 -2
- package/es-modules/masters/themes/grid-light.src.js +5 -2
- package/es-modules/masters/themes/grid.src.js +5 -2
- package/es-modules/masters/themes/high-contrast-dark.src.js +5 -2
- package/es-modules/masters/themes/high-contrast-light.src.js +5 -2
- package/es-modules/masters/themes/sand-signika.src.js +5 -2
- package/es-modules/masters/themes/skies.src.js +5 -2
- package/es-modules/masters/themes/sunset.src.js +5 -2
- package/gfx/stock-icons/annotations-hidden.svg +1 -1
- package/gfx/stock-icons/annotations-visible.svg +2 -2
- package/gfx/stock-icons/arrow-bottom.svg +1 -1
- package/gfx/stock-icons/arrow-left.svg +1 -1
- package/gfx/stock-icons/arrow-line.svg +1 -1
- package/gfx/stock-icons/arrow-ray.svg +1 -1
- package/gfx/stock-icons/arrow-right.svg +1 -1
- package/gfx/stock-icons/arrow-segment.svg +1 -2
- package/gfx/stock-icons/circle.svg +1 -1
- package/gfx/stock-icons/close.svg +2 -2
- package/gfx/stock-icons/crooked-3.svg +1 -1
- package/gfx/stock-icons/crooked-5.svg +1 -1
- package/gfx/stock-icons/current-price-hide.svg +3 -3
- package/gfx/stock-icons/current-price-show.svg +2 -2
- package/gfx/stock-icons/destroy.svg +1 -1
- package/gfx/stock-icons/drawing.svg +18 -0
- package/gfx/stock-icons/edit.svg +1 -1
- package/gfx/stock-icons/elliott-3.svg +1 -1
- package/gfx/stock-icons/elliott-5.svg +1 -1
- package/gfx/stock-icons/ellipse.svg +11 -0
- package/gfx/stock-icons/fibonacci-timezone.svg +16 -0
- package/gfx/stock-icons/fibonacci.svg +1 -1
- package/gfx/stock-icons/flag-basic.svg +1 -1
- package/gfx/stock-icons/flag-diamond.svg +2 -2
- package/gfx/stock-icons/flag-elipse.svg +1 -1
- package/gfx/stock-icons/flag-trapeze.svg +2 -2
- package/gfx/stock-icons/fullscreen.svg +4 -4
- package/gfx/stock-icons/horizontal-line.svg +1 -1
- package/gfx/stock-icons/indicators.svg +3 -3
- package/gfx/stock-icons/label.svg +4 -4
- package/gfx/stock-icons/line.svg +1 -1
- package/gfx/stock-icons/linear.svg +11 -0
- package/gfx/stock-icons/logarithmic.svg +1 -0
- package/gfx/stock-icons/measure-x.svg +2 -2
- package/gfx/stock-icons/measure-xy.svg +1 -1
- package/gfx/stock-icons/measure-y.svg +1 -1
- package/gfx/stock-icons/panning.svg +17 -0
- package/gfx/stock-icons/parallel-channel.svg +1 -1
- package/gfx/stock-icons/pitchfork.svg +1 -1
- package/gfx/stock-icons/ray.svg +1 -1
- package/gfx/stock-icons/rectangle.svg +1 -1
- package/gfx/stock-icons/remove-annotations.svg +2 -2
- package/gfx/stock-icons/save-chart.svg +3 -3
- package/gfx/stock-icons/segment.svg +1 -1
- package/gfx/stock-icons/separator.svg +1 -1
- package/gfx/stock-icons/series-candlestick.svg +1 -1
- package/gfx/stock-icons/series-heikin-ashi.svg +1 -0
- package/gfx/stock-icons/series-hlc.svg +1 -0
- package/gfx/stock-icons/series-hollow-candlestick.svg +1 -0
- package/gfx/stock-icons/series-line.svg +1 -1
- package/gfx/stock-icons/series-ohlc.svg +4 -4
- package/gfx/stock-icons/time-cycles.svg +35 -0
- package/gfx/stock-icons/vertical-arrow.svg +1 -1
- package/gfx/stock-icons/vertical-counter.svg +1 -1
- package/gfx/stock-icons/vertical-double-arrow.svg +1 -1
- package/gfx/stock-icons/vertical-label.svg +3 -3
- package/gfx/stock-icons/vertical-line.svg +1 -1
- package/gfx/stock-icons/zoom-x.svg +2 -2
- package/gfx/stock-icons/zoom-xy.svg +2 -2
- package/gfx/stock-icons/zoom-y.svg +2 -2
- package/highcharts-3d.js +24 -24
- package/highcharts-3d.js.map +1 -1
- package/highcharts-3d.src.js +6 -3
- package/highcharts-gantt.js +800 -792
- package/highcharts-gantt.js.map +1 -1
- package/highcharts-gantt.src.js +16535 -15918
- package/highcharts-more.d.ts +73 -1
- package/highcharts-more.js +193 -192
- package/highcharts-more.js.map +1 -1
- package/highcharts-more.src.d.ts +73 -1
- package/highcharts-more.src.js +8044 -7839
- package/highcharts.d.ts +3850 -177
- package/highcharts.js +589 -581
- package/highcharts.js.map +1 -1
- package/highcharts.src.d.ts +3850 -177
- package/highcharts.src.js +16635 -16060
- package/highmaps.js +708 -698
- package/highmaps.js.map +1 -1
- package/highmaps.src.js +17419 -16521
- package/highstock.js +782 -769
- package/highstock.js.map +1 -1
- package/highstock.src.js +28867 -27975
- package/indicators/acceleration-bands.js +9 -9
- package/indicators/acceleration-bands.js.map +1 -1
- package/indicators/acceleration-bands.src.js +7 -1
- package/indicators/accumulation-distribution.js +1 -1
- package/indicators/accumulation-distribution.src.js +1 -1
- package/indicators/ao.js +1 -1
- package/indicators/ao.src.js +1 -1
- package/indicators/apo.js +1 -1
- package/indicators/apo.src.js +1 -1
- package/indicators/aroon-oscillator.js +9 -9
- package/indicators/aroon-oscillator.js.map +1 -1
- package/indicators/aroon-oscillator.src.js +7 -1
- package/indicators/aroon.js +9 -9
- package/indicators/aroon.js.map +1 -1
- package/indicators/aroon.src.js +7 -1
- package/indicators/atr.js +1 -1
- package/indicators/atr.src.js +1 -1
- package/indicators/bollinger-bands.js +9 -9
- package/indicators/bollinger-bands.js.map +1 -1
- package/indicators/bollinger-bands.src.js +7 -1
- package/indicators/cci.js +1 -1
- package/indicators/cci.src.js +1 -1
- package/indicators/chaikin.js +1 -1
- package/indicators/chaikin.src.js +1 -1
- package/indicators/cmf.js +1 -1
- package/indicators/cmf.src.js +1 -1
- package/indicators/cmo.js +1 -1
- package/indicators/cmo.src.js +1 -1
- package/indicators/dema.js +1 -1
- package/indicators/dema.src.js +1 -1
- package/indicators/disparity-index.js +1 -1
- package/indicators/disparity-index.src.js +1 -1
- package/indicators/dmi.js +11 -11
- package/indicators/dmi.js.map +1 -1
- package/indicators/dmi.src.js +7 -1
- package/indicators/dpo.js +1 -1
- package/indicators/dpo.src.js +1 -1
- package/indicators/ema.js +1 -1
- package/indicators/ema.src.js +1 -1
- package/indicators/ichimoku-kinko-hyo.js +1 -1
- package/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/indicators/indicators-all.js +203 -200
- package/indicators/indicators-all.js.map +1 -1
- package/indicators/indicators-all.src.js +206 -104
- package/indicators/indicators.js +12 -11
- package/indicators/indicators.js.map +1 -1
- package/indicators/indicators.src.js +108 -90
- package/indicators/keltner-channels.js +9 -9
- package/indicators/keltner-channels.js.map +1 -1
- package/indicators/keltner-channels.src.js +7 -1
- package/indicators/klinger.js +13 -13
- package/indicators/klinger.js.map +1 -1
- package/indicators/klinger.src.js +7 -1
- package/indicators/macd.js +1 -1
- package/indicators/macd.src.js +1 -1
- package/indicators/mfi.js +1 -1
- package/indicators/mfi.src.js +1 -1
- package/indicators/momentum.js +1 -1
- package/indicators/momentum.src.js +1 -1
- package/indicators/natr.js +1 -1
- package/indicators/natr.src.js +1 -1
- package/indicators/obv.js +1 -1
- package/indicators/obv.src.js +1 -1
- package/indicators/pivot-points.js +1 -1
- package/indicators/pivot-points.src.js +1 -1
- package/indicators/ppo.js +1 -1
- package/indicators/ppo.src.js +1 -1
- package/indicators/price-channel.js +9 -9
- package/indicators/price-channel.js.map +1 -1
- package/indicators/price-channel.src.js +7 -1
- package/indicators/price-envelopes.js +1 -1
- package/indicators/price-envelopes.src.js +1 -1
- package/indicators/psar.js +1 -1
- package/indicators/psar.src.js +1 -1
- package/indicators/regressions.js +1 -1
- package/indicators/regressions.src.js +1 -1
- package/indicators/roc.js +1 -1
- package/indicators/roc.src.js +1 -1
- package/indicators/rsi.js +1 -1
- package/indicators/rsi.src.js +1 -1
- package/indicators/slow-stochastic.js +1 -1
- package/indicators/slow-stochastic.src.js +1 -1
- package/indicators/stochastic.js +10 -10
- package/indicators/stochastic.js.map +1 -1
- package/indicators/stochastic.src.js +7 -1
- package/indicators/supertrend.js +10 -10
- package/indicators/supertrend.js.map +1 -1
- package/indicators/supertrend.src.js +23 -10
- package/indicators/tema.js +1 -1
- package/indicators/tema.src.js +1 -1
- package/indicators/trendline.js +1 -1
- package/indicators/trendline.src.js +1 -1
- package/indicators/trix.js +1 -1
- package/indicators/trix.src.js +1 -1
- package/indicators/volume-by-price.js +17 -15
- package/indicators/volume-by-price.js.map +1 -1
- package/indicators/volume-by-price.src.js +71 -6
- package/indicators/vwap.js +1 -1
- package/indicators/vwap.src.js +1 -1
- package/indicators/williams-r.js +1 -1
- package/indicators/williams-r.src.js +1 -1
- package/indicators/wma.js +1 -1
- package/indicators/wma.src.js +1 -1
- package/indicators/zigzag.js +1 -1
- package/indicators/zigzag.src.js +1 -1
- package/modules/accessibility.js +203 -202
- package/modules/accessibility.js.map +1 -1
- package/modules/accessibility.src.js +89 -49
- package/modules/annotations-advanced.js +164 -163
- package/modules/annotations-advanced.js.map +1 -1
- package/modules/annotations-advanced.src.js +162 -87
- package/modules/annotations.js +111 -111
- package/modules/annotations.js.map +1 -1
- package/modules/annotations.src.js +162 -87
- package/modules/arrow-symbols.js +1 -1
- package/modules/arrow-symbols.src.js +1 -1
- package/modules/boost-canvas.js +2 -2
- package/modules/boost-canvas.js.map +1 -1
- package/modules/boost-canvas.src.js +2 -2
- package/modules/boost.js +52 -52
- package/modules/boost.js.map +1 -1
- package/modules/boost.src.js +15 -7
- package/modules/broken-axis.js +13 -13
- package/modules/broken-axis.js.map +1 -1
- package/modules/broken-axis.src.js +34 -15
- package/modules/bullet.js +1 -1
- package/modules/bullet.src.js +1 -1
- package/modules/coloraxis.js +24 -22
- package/modules/coloraxis.js.map +1 -1
- package/modules/coloraxis.src.js +954 -774
- package/modules/current-date-indicator.js +2 -2
- package/modules/current-date-indicator.js.map +1 -1
- package/modules/current-date-indicator.src.js +2 -2
- package/modules/cylinder.js +1 -1
- package/modules/cylinder.src.js +1 -1
- package/modules/data.js +33 -32
- package/modules/data.js.map +1 -1
- package/modules/data.src.js +182 -134
- package/modules/datagrouping.d.ts +5 -0
- package/modules/datagrouping.js +20 -20
- package/modules/datagrouping.js.map +1 -1
- package/modules/datagrouping.src.d.ts +5 -0
- package/modules/datagrouping.src.js +270 -228
- package/modules/debugger.js +3 -3
- package/modules/debugger.js.map +1 -1
- package/modules/debugger.src.js +3 -3
- package/modules/dependency-wheel.js +1 -1
- package/modules/dependency-wheel.src.js +1 -1
- package/modules/dotplot.js +1 -1
- package/modules/dotplot.src.js +1 -1
- package/modules/drag-panes.js +1 -1
- package/modules/drag-panes.src.js +1 -1
- package/modules/draggable-points.js +34 -34
- package/modules/draggable-points.js.map +1 -1
- package/modules/draggable-points.src.js +14 -5
- package/modules/drilldown.d.ts +27 -0
- package/modules/drilldown.js +18 -18
- package/modules/drilldown.js.map +1 -1
- package/modules/drilldown.src.d.ts +27 -0
- package/modules/drilldown.src.js +42 -16
- package/modules/dumbbell.js +1 -1
- package/modules/dumbbell.src.js +1 -1
- package/modules/export-data.js +20 -20
- package/modules/export-data.js.map +1 -1
- package/modules/export-data.src.js +8 -5
- package/modules/exporting.d.ts +29 -0
- package/modules/exporting.js +38 -35
- package/modules/exporting.js.map +1 -1
- package/modules/exporting.src.d.ts +29 -0
- package/modules/exporting.src.js +1937 -1614
- package/modules/full-screen.js +2 -2
- package/modules/full-screen.js.map +1 -1
- package/modules/full-screen.src.js +8 -6
- package/modules/funnel.js +1 -1
- package/modules/funnel.src.js +1 -1
- package/modules/funnel3d.js +1 -1
- package/modules/funnel3d.src.js +1 -1
- package/modules/gantt.js +218 -217
- package/modules/gantt.js.map +1 -1
- package/modules/gantt.src.js +74 -32
- package/modules/grid-axis.js +23 -22
- package/modules/grid-axis.js.map +1 -1
- package/modules/grid-axis.src.js +9 -4
- package/modules/heatmap.js +39 -37
- package/modules/heatmap.js.map +1 -1
- package/modules/heatmap.src.js +963 -779
- package/modules/heikinashi.js +17 -0
- package/modules/heikinashi.js.map +1 -0
- package/modules/heikinashi.src.js +394 -0
- package/modules/histogram-bellcurve.js +1 -1
- package/modules/histogram-bellcurve.src.js +1 -1
- package/modules/hollowcandlestick.js +18 -0
- package/modules/hollowcandlestick.js.map +1 -0
- package/modules/hollowcandlestick.src.js +504 -0
- package/modules/item-series.js +1 -1
- package/modules/item-series.src.js +1 -1
- package/modules/lollipop.js +1 -1
- package/modules/lollipop.src.js +1 -1
- package/modules/map.d.ts +9 -0
- package/modules/map.js +122 -119
- package/modules/map.js.map +1 -1
- package/modules/map.src.d.ts +9 -0
- package/modules/map.src.js +1655 -1332
- package/modules/marker-clusters.js +1 -1
- package/modules/marker-clusters.src.js +1 -1
- package/modules/networkgraph.js +1 -1
- package/modules/networkgraph.src.js +1 -1
- package/modules/no-data-to-display.js +3 -3
- package/modules/no-data-to-display.js.map +1 -1
- package/modules/no-data-to-display.src.js +2 -2
- package/modules/offline-exporting.js +18 -16
- package/modules/offline-exporting.js.map +1 -1
- package/modules/offline-exporting.src.js +623 -562
- package/modules/oldie-polyfills.js +1 -1
- package/modules/oldie-polyfills.src.js +1 -1
- package/modules/oldie.js +2 -2
- package/modules/oldie.src.js +2 -2
- package/modules/organization.js +1 -1
- package/modules/organization.src.js +1 -1
- package/modules/overlapping-datalabels.js +1 -1
- package/modules/overlapping-datalabels.src.js +1 -1
- package/modules/parallel-coordinates.js +1 -1
- package/modules/parallel-coordinates.src.js +1 -1
- package/modules/pareto.js +1 -1
- package/modules/pareto.src.js +1 -1
- package/modules/pathfinder.js +1 -1
- package/modules/pathfinder.src.js +1 -1
- package/modules/pattern-fill.js +14 -14
- package/modules/pattern-fill.js.map +1 -1
- package/modules/pattern-fill.src.js +24 -12
- package/modules/price-indicator.js +1 -1
- package/modules/price-indicator.src.js +1 -1
- package/modules/pyramid3d.js +1 -1
- package/modules/pyramid3d.src.js +1 -1
- package/modules/sankey.js +28 -28
- package/modules/sankey.js.map +1 -1
- package/modules/sankey.src.js +11 -11
- package/modules/series-label.js +1 -1
- package/modules/series-label.src.js +1 -1
- package/modules/solid-gauge.js +2 -2
- package/modules/solid-gauge.js.map +1 -1
- package/modules/solid-gauge.src.js +3 -3
- package/modules/sonification.js +1 -1
- package/modules/sonification.src.js +1 -1
- package/modules/static-scale.js +1 -1
- package/modules/static-scale.src.js +1 -1
- package/modules/stock-tools.js +159 -157
- package/modules/stock-tools.js.map +1 -1
- package/modules/stock-tools.src.js +253 -123
- package/modules/stock.d.ts +5 -0
- package/modules/stock.js +196 -191
- package/modules/stock.js.map +1 -1
- package/modules/stock.src.d.ts +5 -0
- package/modules/stock.src.js +7749 -7432
- package/modules/streamgraph.js +1 -1
- package/modules/streamgraph.src.js +1 -1
- package/modules/sunburst.js +5 -5
- package/modules/sunburst.js.map +1 -1
- package/modules/sunburst.src.js +6 -19
- package/modules/tilemap.js +1 -1
- package/modules/tilemap.src.js +1 -1
- package/modules/timeline.js +18 -17
- package/modules/timeline.js.map +1 -1
- package/modules/timeline.src.js +21 -24
- package/modules/treegrid.js +57 -57
- package/modules/treegrid.js.map +1 -1
- package/modules/treegrid.src.js +43 -19
- package/modules/treemap.js +5 -5
- package/modules/treemap.js.map +1 -1
- package/modules/treemap.src.js +5 -5
- package/modules/variable-pie.js +1 -1
- package/modules/variable-pie.src.js +1 -1
- package/modules/variwide.js +1 -1
- package/modules/variwide.src.js +1 -1
- package/modules/vector.js +1 -1
- package/modules/vector.src.js +1 -1
- package/modules/venn.js +31 -30
- package/modules/venn.js.map +1 -1
- package/modules/venn.src.js +508 -424
- package/modules/windbarb.js +1 -1
- package/modules/windbarb.src.js +1 -1
- package/modules/wordcloud.js +4 -4
- package/modules/wordcloud.js.map +1 -1
- package/modules/wordcloud.src.js +2 -1
- package/modules/xrange.js +17 -17
- package/modules/xrange.js.map +1 -1
- package/modules/xrange.src.js +7 -4
- package/package.json +1 -1
- package/themes/avocado.d.ts +6 -1
- package/themes/avocado.js +3 -3
- package/themes/avocado.js.map +1 -1
- package/themes/avocado.src.d.ts +6 -1
- package/themes/avocado.src.js +53 -22
- package/themes/dark-blue.d.ts +6 -1
- package/themes/dark-blue.js +3 -3
- package/themes/dark-blue.js.map +1 -1
- package/themes/dark-blue.src.d.ts +6 -1
- package/themes/dark-blue.src.js +231 -205
- package/themes/dark-green.d.ts +6 -1
- package/themes/dark-green.js +4 -4
- package/themes/dark-green.js.map +1 -1
- package/themes/dark-green.src.d.ts +6 -1
- package/themes/dark-green.src.js +236 -205
- package/themes/dark-unica.d.ts +6 -1
- package/themes/dark-unica.js +7 -7
- package/themes/dark-unica.js.map +1 -1
- package/themes/dark-unica.src.d.ts +6 -1
- package/themes/dark-unica.src.js +206 -174
- package/themes/gray.d.ts +6 -1
- package/themes/gray.js +3 -3
- package/themes/gray.js.map +1 -1
- package/themes/gray.src.d.ts +6 -1
- package/themes/gray.src.js +233 -207
- package/themes/grid-light.d.ts +6 -1
- package/themes/grid-light.js +4 -4
- package/themes/grid-light.js.map +1 -1
- package/themes/grid-light.src.d.ts +6 -1
- package/themes/grid-light.src.js +88 -57
- package/themes/grid.d.ts +6 -1
- package/themes/grid.js +3 -3
- package/themes/grid.js.map +1 -1
- package/themes/grid.src.d.ts +6 -1
- package/themes/grid.src.js +114 -83
- package/themes/high-contrast-dark.js +5 -4
- package/themes/high-contrast-dark.js.map +1 -1
- package/themes/high-contrast-dark.src.js +197 -166
- package/themes/high-contrast-light.js +3 -3
- package/themes/high-contrast-light.js.map +1 -1
- package/themes/high-contrast-light.src.js +54 -23
- package/themes/sand-signika.d.ts +6 -1
- package/themes/sand-signika.js +5 -5
- package/themes/sand-signika.js.map +1 -1
- package/themes/sand-signika.src.d.ts +6 -1
- package/themes/sand-signika.src.js +119 -88
- package/themes/skies.d.ts +6 -1
- package/themes/skies.js +5 -5
- package/themes/skies.js.map +1 -1
- package/themes/skies.src.d.ts +6 -1
- package/themes/skies.src.js +107 -76
- package/themes/sunset.d.ts +6 -1
- package/themes/sunset.js +3 -3
- package/themes/sunset.js.map +1 -1
- package/themes/sunset.src.d.ts +6 -1
- package/themes/sunset.src.js +52 -21
- package/es-modules/Core/Axis/ColorAxis.js +0 -1164
- package/es-modules/Core/Axis/HiddenAxis.js +0 -46
- package/es-modules/Core/Axis/PlotLineOrBand.js +0 -1051
- package/es-modules/Core/Series/DataLabels.js +0 -1173
- package/es-modules/Extensions/Exporting.js +0 -2024
- package/es-modules/Extensions/OfflineExporting.js +0 -621
- package/es-modules/Mixins/Geometry.js +0 -56
- package/es-modules/Mixins/GeometryCircles.js +0 -320
- package/es-modules/Series/Bubble/BubbleLegend.js +0 -893
package/modules/exporting.src.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Highcharts JS v9.
|
|
2
|
+
* @license Highcharts JS v9.2.2 (2021-08-24)
|
|
3
3
|
*
|
|
4
4
|
* Exporting module
|
|
5
5
|
*
|
|
@@ -228,11 +228,13 @@
|
|
|
228
228
|
lang.exitFullscreen &&
|
|
229
229
|
lang.viewFullscreen &&
|
|
230
230
|
menuItems &&
|
|
231
|
-
exportDivElements
|
|
232
|
-
exportDivElements.
|
|
233
|
-
|
|
234
|
-
(
|
|
235
|
-
|
|
231
|
+
exportDivElements) {
|
|
232
|
+
var exportDivElement = exportDivElements[menuItems.indexOf('viewFullscreen')];
|
|
233
|
+
if (exportDivElement) {
|
|
234
|
+
AST.setElementHTML(exportDivElement, !this.isOpen ?
|
|
235
|
+
(exportingOptions.menuItemDefinitions.viewFullscreen.text ||
|
|
236
|
+
lang.viewFullscreen) : lang.exitFullscreen);
|
|
237
|
+
}
|
|
236
238
|
}
|
|
237
239
|
};
|
|
238
240
|
/**
|
|
@@ -332,10 +334,8 @@
|
|
|
332
334
|
|
|
333
335
|
return chartNavigation;
|
|
334
336
|
});
|
|
335
|
-
_registerModule(_modules, 'Extensions/Exporting
|
|
337
|
+
_registerModule(_modules, 'Extensions/Exporting/ExportingDefaults.js', [_modules['Core/Globals.js'], _modules['Core/Color/Palette.js']], function (H, Palette) {
|
|
336
338
|
/* *
|
|
337
|
-
*
|
|
338
|
-
* Exporting module
|
|
339
339
|
*
|
|
340
340
|
* (c) 2010-2021 Torstein Honsi
|
|
341
341
|
*
|
|
@@ -344,763 +344,379 @@
|
|
|
344
344
|
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
345
345
|
*
|
|
346
346
|
* */
|
|
347
|
-
var
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
createElement = U.createElement,
|
|
355
|
-
discardElement = U.discardElement,
|
|
356
|
-
extend = U.extend,
|
|
357
|
-
find = U.find,
|
|
358
|
-
fireEvent = U.fireEvent,
|
|
359
|
-
isObject = U.isObject,
|
|
360
|
-
merge = U.merge,
|
|
361
|
-
objectEach = U.objectEach,
|
|
362
|
-
pick = U.pick,
|
|
363
|
-
removeEvent = U.removeEvent,
|
|
364
|
-
uniqueKey = U.uniqueKey;
|
|
365
|
-
// Add language
|
|
366
|
-
extend(defaultOptions.lang
|
|
347
|
+
var isTouchDevice = H.isTouchDevice;
|
|
348
|
+
/* *
|
|
349
|
+
*
|
|
350
|
+
* API Options
|
|
351
|
+
*
|
|
352
|
+
* */
|
|
353
|
+
// Add the export related options
|
|
367
354
|
/**
|
|
368
|
-
*
|
|
355
|
+
* Options for the exporting module. For an overview on the matter, see
|
|
356
|
+
* [the docs](https://www.highcharts.com/docs/export-module/export-module-overview).
|
|
357
|
+
*
|
|
358
|
+
* @requires modules/exporting
|
|
359
|
+
* @optionparent exporting
|
|
369
360
|
*/
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Exporting module only. The text for the menu item to view the chart
|
|
373
|
-
* in full screen.
|
|
374
|
-
*
|
|
375
|
-
* @since 8.0.1
|
|
376
|
-
*
|
|
377
|
-
* @private
|
|
378
|
-
*/
|
|
379
|
-
viewFullscreen: 'View in full screen',
|
|
380
|
-
/**
|
|
381
|
-
* Exporting module only. The text for the menu item to exit the chart
|
|
382
|
-
* from full screen.
|
|
383
|
-
*
|
|
384
|
-
* @since 8.0.1
|
|
385
|
-
*
|
|
386
|
-
* @private
|
|
387
|
-
*/
|
|
388
|
-
exitFullscreen: 'Exit from full screen',
|
|
389
|
-
/**
|
|
390
|
-
* Exporting module only. The text for the menu item to print the chart.
|
|
391
|
-
*
|
|
392
|
-
* @since 3.0.1
|
|
393
|
-
* @requires modules/exporting
|
|
394
|
-
*
|
|
395
|
-
* @private
|
|
396
|
-
*/
|
|
397
|
-
printChart: 'Print chart',
|
|
398
|
-
/**
|
|
399
|
-
* Exporting module only. The text for the PNG download menu item.
|
|
400
|
-
*
|
|
401
|
-
* @since 2.0
|
|
402
|
-
* @requires modules/exporting
|
|
403
|
-
*
|
|
404
|
-
* @private
|
|
405
|
-
*/
|
|
406
|
-
downloadPNG: 'Download PNG image',
|
|
407
|
-
/**
|
|
408
|
-
* Exporting module only. The text for the JPEG download menu item.
|
|
409
|
-
*
|
|
410
|
-
* @since 2.0
|
|
411
|
-
* @requires modules/exporting
|
|
412
|
-
*
|
|
413
|
-
* @private
|
|
414
|
-
*/
|
|
415
|
-
downloadJPEG: 'Download JPEG image',
|
|
416
|
-
/**
|
|
417
|
-
* Exporting module only. The text for the PDF download menu item.
|
|
418
|
-
*
|
|
419
|
-
* @since 2.0
|
|
420
|
-
* @requires modules/exporting
|
|
421
|
-
*
|
|
422
|
-
* @private
|
|
423
|
-
*/
|
|
424
|
-
downloadPDF: 'Download PDF document',
|
|
425
|
-
/**
|
|
426
|
-
* Exporting module only. The text for the SVG download menu item.
|
|
427
|
-
*
|
|
428
|
-
* @since 2.0
|
|
429
|
-
* @requires modules/exporting
|
|
430
|
-
*
|
|
431
|
-
* @private
|
|
432
|
-
*/
|
|
433
|
-
downloadSVG: 'Download SVG vector image',
|
|
434
|
-
/**
|
|
435
|
-
* Exporting module menu. The tooltip title for the context menu holding
|
|
436
|
-
* print and export menu items.
|
|
437
|
-
*
|
|
438
|
-
* @since 3.0
|
|
439
|
-
* @requires modules/exporting
|
|
440
|
-
*
|
|
441
|
-
* @private
|
|
442
|
-
*/
|
|
443
|
-
contextButtonTitle: 'Chart context menu'
|
|
444
|
-
});
|
|
445
|
-
if (!defaultOptions.navigation) {
|
|
446
|
-
// Buttons and menus are collected in a separate config option set called
|
|
447
|
-
// 'navigation'. This can be extended later to add control buttons like
|
|
448
|
-
// zoom and pan right click menus.
|
|
449
|
-
/**
|
|
450
|
-
* A collection of options for buttons and menus appearing in the exporting
|
|
451
|
-
* module.
|
|
452
|
-
*
|
|
453
|
-
* @requires modules/exporting
|
|
454
|
-
* @optionparent navigation
|
|
455
|
-
*/
|
|
456
|
-
defaultOptions.navigation = {};
|
|
457
|
-
}
|
|
458
|
-
merge(true, defaultOptions.navigation, {
|
|
459
|
-
/**
|
|
460
|
-
* @optionparent navigation.buttonOptions
|
|
461
|
-
*
|
|
462
|
-
* @private
|
|
463
|
-
*/
|
|
464
|
-
buttonOptions: {
|
|
465
|
-
theme: {},
|
|
361
|
+
var exporting = {
|
|
466
362
|
/**
|
|
467
|
-
*
|
|
363
|
+
* Experimental setting to allow HTML inside the chart (added through
|
|
364
|
+
* the `useHTML` options), directly in the exported image. This allows
|
|
365
|
+
* you to preserve complicated HTML structures like tables or bi-directional
|
|
366
|
+
* text in exported charts.
|
|
468
367
|
*
|
|
469
|
-
*
|
|
470
|
-
*
|
|
368
|
+
* Disclaimer: The HTML is rendered in a `foreignObject` tag in the
|
|
369
|
+
* generated SVG. The official export server is based on PhantomJS,
|
|
370
|
+
* which supports this, but other SVG clients, like Batik, does not
|
|
371
|
+
* support it. This also applies to downloaded SVG that you want to
|
|
372
|
+
* open in a desktop client.
|
|
471
373
|
*
|
|
472
374
|
* @type {boolean}
|
|
473
|
-
* @default
|
|
474
|
-
* @since
|
|
475
|
-
* @apioption
|
|
375
|
+
* @default false
|
|
376
|
+
* @since 4.1.8
|
|
377
|
+
* @apioption exporting.allowHTML
|
|
476
378
|
*/
|
|
477
379
|
/**
|
|
478
|
-
*
|
|
380
|
+
* Additional chart options to be merged into the chart before exporting to
|
|
381
|
+
* an image format. This does not apply to printing the chart via the export
|
|
382
|
+
* menu.
|
|
479
383
|
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
384
|
+
* For example, a common use case is to add data labels to improve
|
|
385
|
+
* readability of the exported chart, or to add a printer-friendly color
|
|
386
|
+
* scheme to exported PDFs.
|
|
482
387
|
*
|
|
483
|
-
* @
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
* The x position of the center of the symbol inside the button.
|
|
488
|
-
*
|
|
489
|
-
* @sample highcharts/navigation/buttonoptions-height/
|
|
490
|
-
* Bigger buttons
|
|
388
|
+
* @sample {highcharts} highcharts/exporting/chartoptions-data-labels/
|
|
389
|
+
* Added data labels
|
|
390
|
+
* @sample {highstock} highcharts/exporting/chartoptions-data-labels/
|
|
391
|
+
* Added data labels
|
|
491
392
|
*
|
|
492
|
-
* @
|
|
393
|
+
* @type {Highcharts.Options}
|
|
394
|
+
* @apioption exporting.chartOptions
|
|
493
395
|
*/
|
|
494
|
-
symbolX: 12.5,
|
|
495
396
|
/**
|
|
496
|
-
*
|
|
397
|
+
* Whether to enable the exporting module. Disabling the module will
|
|
398
|
+
* hide the context button, but API methods will still be available.
|
|
497
399
|
*
|
|
498
|
-
* @sample highcharts/
|
|
499
|
-
*
|
|
400
|
+
* @sample {highcharts} highcharts/exporting/enabled-false/
|
|
401
|
+
* Exporting module is loaded but disabled
|
|
402
|
+
* @sample {highstock} highcharts/exporting/enabled-false/
|
|
403
|
+
* Exporting module is loaded but disabled
|
|
500
404
|
*
|
|
501
|
-
* @
|
|
405
|
+
* @type {boolean}
|
|
406
|
+
* @default true
|
|
407
|
+
* @since 2.0
|
|
408
|
+
* @apioption exporting.enabled
|
|
502
409
|
*/
|
|
503
|
-
symbolY: 10.5,
|
|
504
410
|
/**
|
|
505
|
-
*
|
|
411
|
+
* Function to call if the offline-exporting module fails to export
|
|
412
|
+
* a chart on the client side, and [fallbackToExportServer](
|
|
413
|
+
* #exporting.fallbackToExportServer) is disabled. If left undefined, an
|
|
414
|
+
* exception is thrown instead. Receives two parameters, the exporting
|
|
415
|
+
* options, and the error from the module.
|
|
506
416
|
*
|
|
507
|
-
* @
|
|
508
|
-
* Center aligned
|
|
417
|
+
* @see [fallbackToExportServer](#exporting.fallbackToExportServer)
|
|
509
418
|
*
|
|
510
|
-
* @type
|
|
511
|
-
* @since
|
|
419
|
+
* @type {Highcharts.ExportingErrorCallbackFunction}
|
|
420
|
+
* @since 5.0.0
|
|
421
|
+
* @requires modules/exporting
|
|
422
|
+
* @requires modules/offline-exporting
|
|
423
|
+
* @apioption exporting.error
|
|
512
424
|
*/
|
|
513
|
-
align: 'right',
|
|
514
425
|
/**
|
|
515
|
-
*
|
|
426
|
+
* Whether or not to fall back to the export server if the offline-exporting
|
|
427
|
+
* module is unable to export the chart on the client side. This happens for
|
|
428
|
+
* certain browsers, and certain features (e.g.
|
|
429
|
+
* [allowHTML](#exporting.allowHTML)), depending on the image type exporting
|
|
430
|
+
* to. For very complex charts, it is possible that export can fail in
|
|
431
|
+
* browsers that don't support Blob objects, due to data URL length limits.
|
|
432
|
+
* It is recommended to define the [exporting.error](#exporting.error)
|
|
433
|
+
* handler if disabling fallback, in order to notify users in case export
|
|
434
|
+
* fails.
|
|
516
435
|
*
|
|
517
|
-
* @
|
|
436
|
+
* @type {boolean}
|
|
437
|
+
* @default true
|
|
438
|
+
* @since 4.1.8
|
|
439
|
+
* @requires modules/exporting
|
|
440
|
+
* @requires modules/offline-exporting
|
|
441
|
+
* @apioption exporting.fallbackToExportServer
|
|
518
442
|
*/
|
|
519
|
-
buttonSpacing: 3,
|
|
520
443
|
/**
|
|
521
|
-
*
|
|
444
|
+
* The filename, without extension, to use for the exported chart.
|
|
522
445
|
*
|
|
523
|
-
* @sample highcharts/
|
|
524
|
-
*
|
|
446
|
+
* @sample {highcharts} highcharts/exporting/filename/
|
|
447
|
+
* Custom file name
|
|
448
|
+
* @sample {highstock} highcharts/exporting/filename/
|
|
449
|
+
* Custom file name
|
|
525
450
|
*
|
|
526
|
-
* @
|
|
451
|
+
* @type {string}
|
|
452
|
+
* @default chart
|
|
453
|
+
* @since 2.0
|
|
454
|
+
* @apioption exporting.filename
|
|
527
455
|
*/
|
|
528
|
-
height: 22,
|
|
529
456
|
/**
|
|
530
|
-
*
|
|
457
|
+
* An object containing additional key value data for the POST form that
|
|
458
|
+
* sends the SVG to the export server. For example, a `target` can be set to
|
|
459
|
+
* make sure the generated image is received in another frame, or a custom
|
|
460
|
+
* `enctype` or `encoding` can be set.
|
|
531
461
|
*
|
|
532
|
-
* @
|
|
533
|
-
*
|
|
534
|
-
* @
|
|
535
|
-
|
|
462
|
+
* @type {Highcharts.HTMLAttributes}
|
|
463
|
+
* @since 3.0.8
|
|
464
|
+
* @apioption exporting.formAttributes
|
|
465
|
+
*/
|
|
466
|
+
/**
|
|
467
|
+
* Path where Highcharts will look for export module dependencies to
|
|
468
|
+
* load on demand if they don't already exist on `window`. Should currently
|
|
469
|
+
* point to location of [CanVG](https://github.com/canvg/canvg) library,
|
|
470
|
+
* [jsPDF](https://github.com/yWorks/jsPDF) and
|
|
471
|
+
* [svg2pdf.js](https://github.com/yWorks/svg2pdf.js), required for client
|
|
472
|
+
* side export in certain browsers.
|
|
536
473
|
*
|
|
537
474
|
* @type {string}
|
|
538
|
-
* @default
|
|
539
|
-
* @since
|
|
540
|
-
* @apioption
|
|
475
|
+
* @default https://code.highcharts.com/{version}/lib
|
|
476
|
+
* @since 5.0.0
|
|
477
|
+
* @apioption exporting.libURL
|
|
541
478
|
*/
|
|
542
479
|
/**
|
|
543
|
-
*
|
|
544
|
-
* `verticalAlign`.
|
|
545
|
-
*
|
|
546
|
-
* @sample highcharts/navigation/buttonoptions-verticalalign/
|
|
547
|
-
* Buttons at lower right
|
|
480
|
+
* Analogous to [sourceWidth](#exporting.sourceWidth).
|
|
548
481
|
*
|
|
549
482
|
* @type {number}
|
|
550
|
-
* @
|
|
551
|
-
* @
|
|
552
|
-
* @apioption navigation.buttonOptions.y
|
|
483
|
+
* @since 3.0
|
|
484
|
+
* @apioption exporting.sourceHeight
|
|
553
485
|
*/
|
|
554
486
|
/**
|
|
555
|
-
* The
|
|
556
|
-
*
|
|
487
|
+
* The width of the original chart when exported, unless an explicit
|
|
488
|
+
* [chart.width](#chart.width) is set, or a pixel width is set on the
|
|
489
|
+
* container. The width exported raster image is then multiplied by
|
|
490
|
+
* [scale](#exporting.scale).
|
|
557
491
|
*
|
|
558
|
-
* @sample highcharts/
|
|
559
|
-
*
|
|
492
|
+
* @sample {highcharts} highcharts/exporting/sourcewidth/
|
|
493
|
+
* Source size demo
|
|
494
|
+
* @sample {highstock} highcharts/exporting/sourcewidth/
|
|
495
|
+
* Source size demo
|
|
496
|
+
* @sample {highmaps} maps/exporting/sourcewidth/
|
|
497
|
+
* Source size demo
|
|
560
498
|
*
|
|
561
|
-
* @type
|
|
562
|
-
* @since
|
|
499
|
+
* @type {number}
|
|
500
|
+
* @since 3.0
|
|
501
|
+
* @apioption exporting.sourceWidth
|
|
563
502
|
*/
|
|
564
|
-
verticalAlign: 'top',
|
|
565
503
|
/**
|
|
566
|
-
* The pixel width of
|
|
504
|
+
* The pixel width of charts exported to PNG or JPG. As of Highcharts
|
|
505
|
+
* 3.0, the default pixel width is a function of the [chart.width](
|
|
506
|
+
* #chart.width) or [exporting.sourceWidth](#exporting.sourceWidth) and the
|
|
507
|
+
* [exporting.scale](#exporting.scale).
|
|
567
508
|
*
|
|
568
|
-
* @sample highcharts/
|
|
569
|
-
*
|
|
509
|
+
* @sample {highcharts} highcharts/exporting/width/
|
|
510
|
+
* Export to 200px wide images
|
|
511
|
+
* @sample {highstock} highcharts/exporting/width/
|
|
512
|
+
* Export to 200px wide images
|
|
570
513
|
*
|
|
571
|
-
* @
|
|
514
|
+
* @type {number}
|
|
515
|
+
* @since 2.0
|
|
516
|
+
* @apioption exporting.width
|
|
572
517
|
*/
|
|
573
|
-
width: 24
|
|
574
|
-
}
|
|
575
|
-
});
|
|
576
|
-
// Presentational attributes
|
|
577
|
-
merge(true, defaultOptions.navigation,
|
|
578
|
-
/**
|
|
579
|
-
* A collection of options for buttons and menus appearing in the exporting
|
|
580
|
-
* module.
|
|
581
|
-
*
|
|
582
|
-
* @optionparent navigation
|
|
583
|
-
*/
|
|
584
|
-
{
|
|
585
|
-
/**
|
|
586
|
-
* CSS styles for the popup menu appearing by default when the export
|
|
587
|
-
* icon is clicked. This menu is rendered in HTML.
|
|
588
|
-
*
|
|
589
|
-
* @see In styled mode, the menu is styled with the `.highcharts-menu`
|
|
590
|
-
* class.
|
|
591
|
-
*
|
|
592
|
-
* @sample highcharts/navigation/menustyle/
|
|
593
|
-
* Light gray menu background
|
|
594
|
-
*
|
|
595
|
-
* @type {Highcharts.CSSObject}
|
|
596
|
-
* @default {"border": "1px solid #999999", "background": "#ffffff", "padding": "5px 0"}
|
|
597
|
-
* @since 2.0
|
|
598
|
-
*
|
|
599
|
-
* @private
|
|
600
|
-
*/
|
|
601
|
-
menuStyle: {
|
|
602
|
-
/** @ignore-option */
|
|
603
|
-
border: "1px solid " + palette.neutralColor40,
|
|
604
|
-
/** @ignore-option */
|
|
605
|
-
background: palette.backgroundColor,
|
|
606
|
-
/** @ignore-option */
|
|
607
|
-
padding: '5px 0'
|
|
608
|
-
},
|
|
609
|
-
/**
|
|
610
|
-
* CSS styles for the individual items within the popup menu appearing
|
|
611
|
-
* by default when the export icon is clicked. The menu items are
|
|
612
|
-
* rendered in HTML. Font size defaults to `11px` on desktop and `14px`
|
|
613
|
-
* on touch devices.
|
|
614
|
-
*
|
|
615
|
-
* @see In styled mode, the menu items are styled with the
|
|
616
|
-
* `.highcharts-menu-item` class.
|
|
617
|
-
*
|
|
618
|
-
* @sample {highcharts} highcharts/navigation/menuitemstyle/
|
|
619
|
-
* Add a grey stripe to the left
|
|
620
|
-
*
|
|
621
|
-
* @type {Highcharts.CSSObject}
|
|
622
|
-
* @default {"padding": "0.5em 1em", "color": "#333333", "background": "none", "fontSize": "11px/14px", "transition": "background 250ms, color 250ms"}
|
|
623
|
-
* @since 2.0
|
|
624
|
-
*
|
|
625
|
-
* @private
|
|
626
|
-
*/
|
|
627
|
-
menuItemStyle: {
|
|
628
|
-
/** @ignore-option */
|
|
629
|
-
padding: '0.5em 1em',
|
|
630
|
-
/** @ignore-option */
|
|
631
|
-
color: palette.neutralColor80,
|
|
632
|
-
/** @ignore-option */
|
|
633
|
-
background: 'none',
|
|
634
|
-
/** @ignore-option */
|
|
635
|
-
fontSize: isTouchDevice ? '14px' : '11px',
|
|
636
|
-
/** @ignore-option */
|
|
637
|
-
transition: 'background 250ms, color 250ms'
|
|
638
|
-
},
|
|
639
|
-
/**
|
|
640
|
-
* CSS styles for the hover state of the individual items within the
|
|
641
|
-
* popup menu appearing by default when the export icon is clicked. The
|
|
642
|
-
* menu items are rendered in HTML.
|
|
643
|
-
*
|
|
644
|
-
* @see In styled mode, the menu items are styled with the
|
|
645
|
-
* `.highcharts-menu-item` class.
|
|
646
|
-
*
|
|
647
|
-
* @sample highcharts/navigation/menuitemhoverstyle/
|
|
648
|
-
* Bold text on hover
|
|
649
|
-
*
|
|
650
|
-
* @type {Highcharts.CSSObject}
|
|
651
|
-
* @default {"background": "#335cad", "color": "#ffffff"}
|
|
652
|
-
* @since 2.0
|
|
653
|
-
*
|
|
654
|
-
* @private
|
|
655
|
-
*/
|
|
656
|
-
menuItemHoverStyle: {
|
|
657
|
-
/** @ignore-option */
|
|
658
|
-
background: palette.highlightColor80,
|
|
659
|
-
/** @ignore-option */
|
|
660
|
-
color: palette.backgroundColor
|
|
661
|
-
},
|
|
662
|
-
/**
|
|
663
|
-
* A collection of options for buttons appearing in the exporting
|
|
664
|
-
* module.
|
|
665
|
-
*
|
|
666
|
-
* In styled mode, the buttons are styled with the
|
|
667
|
-
* `.highcharts-contextbutton` and `.highcharts-button-symbol` classes.
|
|
668
|
-
*
|
|
669
|
-
* @requires modules/exporting
|
|
670
|
-
*
|
|
671
|
-
* @private
|
|
672
|
-
*/
|
|
673
|
-
buttonOptions: {
|
|
674
518
|
/**
|
|
675
|
-
*
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
* Blue symbol stroke for one of the buttons
|
|
519
|
+
* Default MIME type for exporting if `chart.exportChart()` is called
|
|
520
|
+
* without specifying a `type` option. Possible values are `image/png`,
|
|
521
|
+
* `image/jpeg`, `application/pdf` and `image/svg+xml`.
|
|
679
522
|
*
|
|
680
|
-
* @type {Highcharts.
|
|
523
|
+
* @type {Highcharts.ExportingMimeTypeValue}
|
|
681
524
|
* @since 2.0
|
|
682
525
|
*/
|
|
683
|
-
|
|
526
|
+
type: 'image/png',
|
|
684
527
|
/**
|
|
685
|
-
* The
|
|
528
|
+
* The URL for the server module converting the SVG string to an image
|
|
529
|
+
* format. By default this points to Highchart's free web service.
|
|
686
530
|
*
|
|
687
|
-
* @sample highcharts/navigation/buttonoptions-symbolstroke/
|
|
688
|
-
* Blue symbol stroke
|
|
689
|
-
*
|
|
690
|
-
* @type {Highcharts.ColorString}
|
|
691
531
|
* @since 2.0
|
|
692
532
|
*/
|
|
693
|
-
|
|
533
|
+
url: 'https://export.highcharts.com/',
|
|
694
534
|
/**
|
|
695
|
-
*
|
|
696
|
-
*
|
|
697
|
-
*
|
|
698
|
-
*
|
|
535
|
+
* When printing the chart from the menu item in the burger menu, if
|
|
536
|
+
* the on-screen chart exceeds this width, it is resized. After printing
|
|
537
|
+
* or cancelled, it is restored. The default width makes the chart
|
|
538
|
+
* fit into typical paper format. Note that this does not affect the
|
|
539
|
+
* chart when printing the web page as a whole.
|
|
699
540
|
*
|
|
700
|
-
* @since 2.
|
|
541
|
+
* @since 4.2.5
|
|
701
542
|
*/
|
|
702
|
-
|
|
543
|
+
printMaxWidth: 780,
|
|
703
544
|
/**
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
*
|
|
707
|
-
*
|
|
545
|
+
* Defines the scale or zoom factor for the exported image compared
|
|
546
|
+
* to the on-screen display. While for instance a 600px wide chart
|
|
547
|
+
* may look good on a website, it will look bad in print. The default
|
|
548
|
+
* scale of 2 makes this chart export to a 1200px PNG or JPG.
|
|
708
549
|
*
|
|
709
|
-
* @
|
|
710
|
-
*
|
|
550
|
+
* @see [chart.width](#chart.width)
|
|
551
|
+
* @see [exporting.sourceWidth](#exporting.sourceWidth)
|
|
711
552
|
*
|
|
712
|
-
* @
|
|
553
|
+
* @sample {highcharts} highcharts/exporting/scale/
|
|
554
|
+
* Scale demonstrated
|
|
555
|
+
* @sample {highstock} highcharts/exporting/scale/
|
|
556
|
+
* Scale demonstrated
|
|
557
|
+
* @sample {highmaps} maps/exporting/scale/
|
|
558
|
+
* Scale demonstrated
|
|
713
559
|
*
|
|
714
560
|
* @since 3.0
|
|
715
561
|
*/
|
|
716
|
-
|
|
717
|
-
/**
|
|
718
|
-
* The default fill exists only to capture hover events.
|
|
719
|
-
*
|
|
720
|
-
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
721
|
-
* @default ${palette.backgroundColor}
|
|
722
|
-
* @apioption navigation.buttonOptions.theme.fill
|
|
723
|
-
*/
|
|
724
|
-
/**
|
|
725
|
-
* Default stroke for the buttons.
|
|
726
|
-
* @type {Highcharts.ColorString}
|
|
727
|
-
* @default none
|
|
728
|
-
* @apioption navigation.buttonOptions.theme.stroke
|
|
729
|
-
*/
|
|
730
|
-
/**
|
|
731
|
-
* Padding for the button.
|
|
732
|
-
*/
|
|
733
|
-
padding: 5
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
});
|
|
737
|
-
// Add the export related options
|
|
738
|
-
/**
|
|
739
|
-
* Options for the exporting module. For an overview on the matter, see
|
|
740
|
-
* [the docs](https://www.highcharts.com/docs/export-module/export-module-overview).
|
|
741
|
-
*
|
|
742
|
-
* @requires modules/exporting
|
|
743
|
-
* @optionparent exporting
|
|
744
|
-
*/
|
|
745
|
-
defaultOptions.exporting = {
|
|
746
|
-
/**
|
|
747
|
-
* Experimental setting to allow HTML inside the chart (added through
|
|
748
|
-
* the `useHTML` options), directly in the exported image. This allows
|
|
749
|
-
* you to preserve complicated HTML structures like tables or bi-directional
|
|
750
|
-
* text in exported charts.
|
|
751
|
-
*
|
|
752
|
-
* Disclaimer: The HTML is rendered in a `foreignObject` tag in the
|
|
753
|
-
* generated SVG. The official export server is based on PhantomJS,
|
|
754
|
-
* which supports this, but other SVG clients, like Batik, does not
|
|
755
|
-
* support it. This also applies to downloaded SVG that you want to
|
|
756
|
-
* open in a desktop client.
|
|
757
|
-
*
|
|
758
|
-
* @type {boolean}
|
|
759
|
-
* @default false
|
|
760
|
-
* @since 4.1.8
|
|
761
|
-
* @apioption exporting.allowHTML
|
|
762
|
-
*/
|
|
763
|
-
/**
|
|
764
|
-
* Additional chart options to be merged into the chart before exporting to
|
|
765
|
-
* an image format. This does not apply to printing the chart via the export
|
|
766
|
-
* menu.
|
|
767
|
-
*
|
|
768
|
-
* For example, a common use case is to add data labels to improve
|
|
769
|
-
* readability of the exported chart, or to add a printer-friendly color
|
|
770
|
-
* scheme to exported PDFs.
|
|
771
|
-
*
|
|
772
|
-
* @sample {highcharts} highcharts/exporting/chartoptions-data-labels/
|
|
773
|
-
* Added data labels
|
|
774
|
-
* @sample {highstock} highcharts/exporting/chartoptions-data-labels/
|
|
775
|
-
* Added data labels
|
|
776
|
-
*
|
|
777
|
-
* @type {Highcharts.Options}
|
|
778
|
-
* @apioption exporting.chartOptions
|
|
779
|
-
*/
|
|
780
|
-
/**
|
|
781
|
-
* Whether to enable the exporting module. Disabling the module will
|
|
782
|
-
* hide the context button, but API methods will still be available.
|
|
783
|
-
*
|
|
784
|
-
* @sample {highcharts} highcharts/exporting/enabled-false/
|
|
785
|
-
* Exporting module is loaded but disabled
|
|
786
|
-
* @sample {highstock} highcharts/exporting/enabled-false/
|
|
787
|
-
* Exporting module is loaded but disabled
|
|
788
|
-
*
|
|
789
|
-
* @type {boolean}
|
|
790
|
-
* @default true
|
|
791
|
-
* @since 2.0
|
|
792
|
-
* @apioption exporting.enabled
|
|
793
|
-
*/
|
|
794
|
-
/**
|
|
795
|
-
* Function to call if the offline-exporting module fails to export
|
|
796
|
-
* a chart on the client side, and [fallbackToExportServer](
|
|
797
|
-
* #exporting.fallbackToExportServer) is disabled. If left undefined, an
|
|
798
|
-
* exception is thrown instead. Receives two parameters, the exporting
|
|
799
|
-
* options, and the error from the module.
|
|
800
|
-
*
|
|
801
|
-
* @see [fallbackToExportServer](#exporting.fallbackToExportServer)
|
|
802
|
-
*
|
|
803
|
-
* @type {Highcharts.ExportingErrorCallbackFunction}
|
|
804
|
-
* @since 5.0.0
|
|
805
|
-
* @requires modules/exporting
|
|
806
|
-
* @requires modules/offline-exporting
|
|
807
|
-
* @apioption exporting.error
|
|
808
|
-
*/
|
|
809
|
-
/**
|
|
810
|
-
* Whether or not to fall back to the export server if the offline-exporting
|
|
811
|
-
* module is unable to export the chart on the client side. This happens for
|
|
812
|
-
* certain browsers, and certain features (e.g.
|
|
813
|
-
* [allowHTML](#exporting.allowHTML)), depending on the image type exporting
|
|
814
|
-
* to. For very complex charts, it is possible that export can fail in
|
|
815
|
-
* browsers that don't support Blob objects, due to data URL length limits.
|
|
816
|
-
* It is recommended to define the [exporting.error](#exporting.error)
|
|
817
|
-
* handler if disabling fallback, in order to notify users in case export
|
|
818
|
-
* fails.
|
|
819
|
-
*
|
|
820
|
-
* @type {boolean}
|
|
821
|
-
* @default true
|
|
822
|
-
* @since 4.1.8
|
|
823
|
-
* @requires modules/exporting
|
|
824
|
-
* @requires modules/offline-exporting
|
|
825
|
-
* @apioption exporting.fallbackToExportServer
|
|
826
|
-
*/
|
|
827
|
-
/**
|
|
828
|
-
* The filename, without extension, to use for the exported chart.
|
|
829
|
-
*
|
|
830
|
-
* @sample {highcharts} highcharts/exporting/filename/
|
|
831
|
-
* Custom file name
|
|
832
|
-
* @sample {highstock} highcharts/exporting/filename/
|
|
833
|
-
* Custom file name
|
|
834
|
-
*
|
|
835
|
-
* @type {string}
|
|
836
|
-
* @default chart
|
|
837
|
-
* @since 2.0
|
|
838
|
-
* @apioption exporting.filename
|
|
839
|
-
*/
|
|
840
|
-
/**
|
|
841
|
-
* An object containing additional key value data for the POST form that
|
|
842
|
-
* sends the SVG to the export server. For example, a `target` can be set to
|
|
843
|
-
* make sure the generated image is received in another frame, or a custom
|
|
844
|
-
* `enctype` or `encoding` can be set.
|
|
845
|
-
*
|
|
846
|
-
* @type {Highcharts.HTMLAttributes}
|
|
847
|
-
* @since 3.0.8
|
|
848
|
-
* @apioption exporting.formAttributes
|
|
849
|
-
*/
|
|
850
|
-
/**
|
|
851
|
-
* Path where Highcharts will look for export module dependencies to
|
|
852
|
-
* load on demand if they don't already exist on `window`. Should currently
|
|
853
|
-
* point to location of [CanVG](https://github.com/canvg/canvg) library,
|
|
854
|
-
* [jsPDF](https://github.com/yWorks/jsPDF) and
|
|
855
|
-
* [svg2pdf.js](https://github.com/yWorks/svg2pdf.js), required for client
|
|
856
|
-
* side export in certain browsers.
|
|
857
|
-
*
|
|
858
|
-
* @type {string}
|
|
859
|
-
* @default https://code.highcharts.com/{version}/lib
|
|
860
|
-
* @since 5.0.0
|
|
861
|
-
* @apioption exporting.libURL
|
|
862
|
-
*/
|
|
863
|
-
/**
|
|
864
|
-
* Analogous to [sourceWidth](#exporting.sourceWidth).
|
|
865
|
-
*
|
|
866
|
-
* @type {number}
|
|
867
|
-
* @since 3.0
|
|
868
|
-
* @apioption exporting.sourceHeight
|
|
869
|
-
*/
|
|
870
|
-
/**
|
|
871
|
-
* The width of the original chart when exported, unless an explicit
|
|
872
|
-
* [chart.width](#chart.width) is set, or a pixel width is set on the
|
|
873
|
-
* container. The width exported raster image is then multiplied by
|
|
874
|
-
* [scale](#exporting.scale).
|
|
875
|
-
*
|
|
876
|
-
* @sample {highcharts} highcharts/exporting/sourcewidth/
|
|
877
|
-
* Source size demo
|
|
878
|
-
* @sample {highstock} highcharts/exporting/sourcewidth/
|
|
879
|
-
* Source size demo
|
|
880
|
-
* @sample {highmaps} maps/exporting/sourcewidth/
|
|
881
|
-
* Source size demo
|
|
882
|
-
*
|
|
883
|
-
* @type {number}
|
|
884
|
-
* @since 3.0
|
|
885
|
-
* @apioption exporting.sourceWidth
|
|
886
|
-
*/
|
|
887
|
-
/**
|
|
888
|
-
* The pixel width of charts exported to PNG or JPG. As of Highcharts
|
|
889
|
-
* 3.0, the default pixel width is a function of the [chart.width](
|
|
890
|
-
* #chart.width) or [exporting.sourceWidth](#exporting.sourceWidth) and the
|
|
891
|
-
* [exporting.scale](#exporting.scale).
|
|
892
|
-
*
|
|
893
|
-
* @sample {highcharts} highcharts/exporting/width/
|
|
894
|
-
* Export to 200px wide images
|
|
895
|
-
* @sample {highstock} highcharts/exporting/width/
|
|
896
|
-
* Export to 200px wide images
|
|
897
|
-
*
|
|
898
|
-
* @type {number}
|
|
899
|
-
* @since 2.0
|
|
900
|
-
* @apioption exporting.width
|
|
901
|
-
*/
|
|
902
|
-
/**
|
|
903
|
-
* Default MIME type for exporting if `chart.exportChart()` is called
|
|
904
|
-
* without specifying a `type` option. Possible values are `image/png`,
|
|
905
|
-
* `image/jpeg`, `application/pdf` and `image/svg+xml`.
|
|
906
|
-
*
|
|
907
|
-
* @type {Highcharts.ExportingMimeTypeValue}
|
|
908
|
-
* @since 2.0
|
|
909
|
-
*/
|
|
910
|
-
type: 'image/png',
|
|
911
|
-
/**
|
|
912
|
-
* The URL for the server module converting the SVG string to an image
|
|
913
|
-
* format. By default this points to Highchart's free web service.
|
|
914
|
-
*
|
|
915
|
-
* @since 2.0
|
|
916
|
-
*/
|
|
917
|
-
url: 'https://export.highcharts.com/',
|
|
918
|
-
/**
|
|
919
|
-
* When printing the chart from the menu item in the burger menu, if
|
|
920
|
-
* the on-screen chart exceeds this width, it is resized. After printing
|
|
921
|
-
* or cancelled, it is restored. The default width makes the chart
|
|
922
|
-
* fit into typical paper format. Note that this does not affect the
|
|
923
|
-
* chart when printing the web page as a whole.
|
|
924
|
-
*
|
|
925
|
-
* @since 4.2.5
|
|
926
|
-
*/
|
|
927
|
-
printMaxWidth: 780,
|
|
928
|
-
/**
|
|
929
|
-
* Defines the scale or zoom factor for the exported image compared
|
|
930
|
-
* to the on-screen display. While for instance a 600px wide chart
|
|
931
|
-
* may look good on a website, it will look bad in print. The default
|
|
932
|
-
* scale of 2 makes this chart export to a 1200px PNG or JPG.
|
|
933
|
-
*
|
|
934
|
-
* @see [chart.width](#chart.width)
|
|
935
|
-
* @see [exporting.sourceWidth](#exporting.sourceWidth)
|
|
936
|
-
*
|
|
937
|
-
* @sample {highcharts} highcharts/exporting/scale/
|
|
938
|
-
* Scale demonstrated
|
|
939
|
-
* @sample {highstock} highcharts/exporting/scale/
|
|
940
|
-
* Scale demonstrated
|
|
941
|
-
* @sample {highmaps} maps/exporting/scale/
|
|
942
|
-
* Scale demonstrated
|
|
943
|
-
*
|
|
944
|
-
* @since 3.0
|
|
945
|
-
*/
|
|
946
|
-
scale: 2,
|
|
947
|
-
/**
|
|
948
|
-
* Options for the export related buttons, print and export. In addition
|
|
949
|
-
* to the default buttons listed here, custom buttons can be added.
|
|
950
|
-
* See [navigation.buttonOptions](#navigation.buttonOptions) for general
|
|
951
|
-
* options.
|
|
952
|
-
*
|
|
953
|
-
* @type {Highcharts.Dictionary<*>}
|
|
954
|
-
* @requires modules/exporting
|
|
955
|
-
*/
|
|
956
|
-
buttons: {
|
|
562
|
+
scale: 2,
|
|
957
563
|
/**
|
|
958
|
-
* Options for the export
|
|
959
|
-
*
|
|
960
|
-
*
|
|
961
|
-
*
|
|
564
|
+
* Options for the export related buttons, print and export. In addition
|
|
565
|
+
* to the default buttons listed here, custom buttons can be added.
|
|
566
|
+
* See [navigation.buttonOptions](#navigation.buttonOptions) for general
|
|
567
|
+
* options.
|
|
962
568
|
*
|
|
963
|
-
* @
|
|
964
|
-
* @extends navigation.buttonOptions
|
|
569
|
+
* @type {Highcharts.Dictionary<*>}
|
|
965
570
|
* @requires modules/exporting
|
|
966
571
|
*/
|
|
967
|
-
|
|
968
|
-
/**
|
|
969
|
-
* A click handler callback to use on the button directly instead of
|
|
970
|
-
* the popup menu.
|
|
971
|
-
*
|
|
972
|
-
* @sample highcharts/exporting/buttons-contextbutton-onclick/
|
|
973
|
-
* Skip the menu and export the chart directly
|
|
974
|
-
*
|
|
975
|
-
* @type {Function}
|
|
976
|
-
* @since 2.0
|
|
977
|
-
* @apioption exporting.buttons.contextButton.onclick
|
|
978
|
-
*/
|
|
979
|
-
/**
|
|
980
|
-
* See [navigation.buttonOptions.symbolFill](
|
|
981
|
-
* #navigation.buttonOptions.symbolFill).
|
|
982
|
-
*
|
|
983
|
-
* @type {Highcharts.ColorString}
|
|
984
|
-
* @default #666666
|
|
985
|
-
* @since 2.0
|
|
986
|
-
* @apioption exporting.buttons.contextButton.symbolFill
|
|
987
|
-
*/
|
|
988
|
-
/**
|
|
989
|
-
* The horizontal position of the button relative to the `align`
|
|
990
|
-
* option.
|
|
991
|
-
*
|
|
992
|
-
* @type {number}
|
|
993
|
-
* @default -10
|
|
994
|
-
* @since 2.0
|
|
995
|
-
* @apioption exporting.buttons.contextButton.x
|
|
996
|
-
*/
|
|
997
|
-
/**
|
|
998
|
-
* The class name of the context button.
|
|
999
|
-
*/
|
|
1000
|
-
className: 'highcharts-contextbutton',
|
|
1001
|
-
/**
|
|
1002
|
-
* The class name of the menu appearing from the button.
|
|
1003
|
-
*/
|
|
1004
|
-
menuClassName: 'highcharts-contextmenu',
|
|
572
|
+
buttons: {
|
|
1005
573
|
/**
|
|
1006
|
-
*
|
|
1007
|
-
* the `Highcharts.Renderer.symbols` collection. The default
|
|
1008
|
-
* `menu` function is part of the exporting module. Possible
|
|
1009
|
-
* values are "circle", "square", "diamond", "triangle",
|
|
1010
|
-
* "triangle-down", "menu", "menuball" or custom shape.
|
|
574
|
+
* Options for the export button.
|
|
1011
575
|
*
|
|
1012
|
-
*
|
|
1013
|
-
*
|
|
1014
|
-
* @sample highcharts/exporting/buttons-contextbutton-symbol-custom/
|
|
1015
|
-
* Custom shape as symbol
|
|
576
|
+
* In styled mode, export button styles can be applied with the
|
|
577
|
+
* `.highcharts-contextbutton` class.
|
|
1016
578
|
*
|
|
1017
|
-
* @
|
|
1018
|
-
* @
|
|
579
|
+
* @declare Highcharts.ExportingButtonsOptionsObject
|
|
580
|
+
* @extends navigation.buttonOptions
|
|
581
|
+
* @requires modules/exporting
|
|
1019
582
|
*/
|
|
1020
|
-
|
|
583
|
+
contextButton: {
|
|
584
|
+
/**
|
|
585
|
+
* A click handler callback to use on the button directly instead of
|
|
586
|
+
* the popup menu.
|
|
587
|
+
*
|
|
588
|
+
* @sample highcharts/exporting/buttons-contextbutton-onclick/
|
|
589
|
+
* Skip the menu and export the chart directly
|
|
590
|
+
*
|
|
591
|
+
* @type {Function}
|
|
592
|
+
* @since 2.0
|
|
593
|
+
* @apioption exporting.buttons.contextButton.onclick
|
|
594
|
+
*/
|
|
595
|
+
/**
|
|
596
|
+
* See [navigation.buttonOptions.symbolFill](
|
|
597
|
+
* #navigation.buttonOptions.symbolFill).
|
|
598
|
+
*
|
|
599
|
+
* @type {Highcharts.ColorString}
|
|
600
|
+
* @default #666666
|
|
601
|
+
* @since 2.0
|
|
602
|
+
* @apioption exporting.buttons.contextButton.symbolFill
|
|
603
|
+
*/
|
|
604
|
+
/**
|
|
605
|
+
* The horizontal position of the button relative to the `align`
|
|
606
|
+
* option.
|
|
607
|
+
*
|
|
608
|
+
* @type {number}
|
|
609
|
+
* @default -10
|
|
610
|
+
* @since 2.0
|
|
611
|
+
* @apioption exporting.buttons.contextButton.x
|
|
612
|
+
*/
|
|
613
|
+
/**
|
|
614
|
+
* The class name of the context button.
|
|
615
|
+
*/
|
|
616
|
+
className: 'highcharts-contextbutton',
|
|
617
|
+
/**
|
|
618
|
+
* The class name of the menu appearing from the button.
|
|
619
|
+
*/
|
|
620
|
+
menuClassName: 'highcharts-contextmenu',
|
|
621
|
+
/**
|
|
622
|
+
* The symbol for the button. Points to a definition function in
|
|
623
|
+
* the `Highcharts.Renderer.symbols` collection. The default
|
|
624
|
+
* `menu` function is part of the exporting module. Possible
|
|
625
|
+
* values are "circle", "square", "diamond", "triangle",
|
|
626
|
+
* "triangle-down", "menu", "menuball" or custom shape.
|
|
627
|
+
*
|
|
628
|
+
* @sample highcharts/exporting/buttons-contextbutton-symbol/
|
|
629
|
+
* Use a circle for symbol
|
|
630
|
+
* @sample highcharts/exporting/buttons-contextbutton-symbol-custom/
|
|
631
|
+
* Custom shape as symbol
|
|
632
|
+
*
|
|
633
|
+
* @type {Highcharts.SymbolKeyValue|"menu"|"menuball"|string}
|
|
634
|
+
* @since 2.0
|
|
635
|
+
*/
|
|
636
|
+
symbol: 'menu',
|
|
637
|
+
/**
|
|
638
|
+
* The key to a [lang](#lang) option setting that is used for the
|
|
639
|
+
* button's title tooltip. When the key is `contextButtonTitle`, it
|
|
640
|
+
* refers to [lang.contextButtonTitle](#lang.contextButtonTitle)
|
|
641
|
+
* that defaults to "Chart context menu".
|
|
642
|
+
*
|
|
643
|
+
* @since 6.1.4
|
|
644
|
+
*/
|
|
645
|
+
titleKey: 'contextButtonTitle',
|
|
646
|
+
/**
|
|
647
|
+
* This option is deprecated, use
|
|
648
|
+
* [titleKey](#exporting.buttons.contextButton.titleKey) instead.
|
|
649
|
+
*
|
|
650
|
+
* @deprecated
|
|
651
|
+
* @type {string}
|
|
652
|
+
* @apioption exporting.buttons.contextButton._titleKey
|
|
653
|
+
*/
|
|
654
|
+
/**
|
|
655
|
+
* A collection of strings pointing to config options for the menu
|
|
656
|
+
* items. The config options are defined in the
|
|
657
|
+
* `menuItemDefinitions` option.
|
|
658
|
+
*
|
|
659
|
+
* By default, there is the "View in full screen" and "Print" menu
|
|
660
|
+
* items, plus one menu item for each of the available export types.
|
|
661
|
+
*
|
|
662
|
+
* @sample {highcharts} highcharts/exporting/menuitemdefinitions/
|
|
663
|
+
* Menu item definitions
|
|
664
|
+
* @sample {highstock} highcharts/exporting/menuitemdefinitions/
|
|
665
|
+
* Menu item definitions
|
|
666
|
+
* @sample {highmaps} highcharts/exporting/menuitemdefinitions/
|
|
667
|
+
* Menu item definitions
|
|
668
|
+
*
|
|
669
|
+
* @type {Array<string>}
|
|
670
|
+
* @default ["viewFullscreen", "printChart", "separator", "downloadPNG", "downloadJPEG", "downloadPDF", "downloadSVG"]
|
|
671
|
+
* @since 2.0
|
|
672
|
+
*/
|
|
673
|
+
menuItems: [
|
|
674
|
+
'viewFullscreen',
|
|
675
|
+
'printChart',
|
|
676
|
+
'separator',
|
|
677
|
+
'downloadPNG',
|
|
678
|
+
'downloadJPEG',
|
|
679
|
+
'downloadPDF',
|
|
680
|
+
'downloadSVG'
|
|
681
|
+
]
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
/**
|
|
685
|
+
* An object consisting of definitions for the menu items in the context
|
|
686
|
+
* menu. Each key value pair has a `key` that is referenced in the
|
|
687
|
+
* [menuItems](#exporting.buttons.contextButton.menuItems) setting,
|
|
688
|
+
* and a `value`, which is an object with the following properties:
|
|
689
|
+
*
|
|
690
|
+
* - **onclick:** The click handler for the menu item
|
|
691
|
+
*
|
|
692
|
+
* - **text:** The text for the menu item
|
|
693
|
+
*
|
|
694
|
+
* - **textKey:** If internationalization is required, the key to a language
|
|
695
|
+
* string
|
|
696
|
+
*
|
|
697
|
+
* Custom text for the "exitFullScreen" can be set only in lang options
|
|
698
|
+
* (it is not a separate button).
|
|
699
|
+
*
|
|
700
|
+
* @sample {highcharts} highcharts/exporting/menuitemdefinitions/
|
|
701
|
+
* Menu item definitions
|
|
702
|
+
* @sample {highstock} highcharts/exporting/menuitemdefinitions/
|
|
703
|
+
* Menu item definitions
|
|
704
|
+
* @sample {highmaps} highcharts/exporting/menuitemdefinitions/
|
|
705
|
+
* Menu item definitions
|
|
706
|
+
*
|
|
707
|
+
*
|
|
708
|
+
* @type {Highcharts.Dictionary<Highcharts.ExportingMenuObject>}
|
|
709
|
+
* @default {"viewFullscreen": {}, "printChart": {}, "separator": {}, "downloadPNG": {}, "downloadJPEG": {}, "downloadPDF": {}, "downloadSVG": {}}
|
|
710
|
+
* @since 5.0.13
|
|
711
|
+
*/
|
|
712
|
+
menuItemDefinitions: {
|
|
1021
713
|
/**
|
|
1022
|
-
*
|
|
1023
|
-
* button's title tooltip. When the key is `contextButtonTitle`, it
|
|
1024
|
-
* refers to [lang.contextButtonTitle](#lang.contextButtonTitle)
|
|
1025
|
-
* that defaults to "Chart context menu".
|
|
1026
|
-
*
|
|
1027
|
-
* @since 6.1.4
|
|
714
|
+
* @ignore
|
|
1028
715
|
*/
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
*
|
|
1034
|
-
* @deprecated
|
|
1035
|
-
* @type {string}
|
|
1036
|
-
* @apioption exporting.buttons.contextButton._titleKey
|
|
1037
|
-
*/
|
|
1038
|
-
/**
|
|
1039
|
-
* A collection of strings pointing to config options for the menu
|
|
1040
|
-
* items. The config options are defined in the
|
|
1041
|
-
* `menuItemDefinitions` option.
|
|
1042
|
-
*
|
|
1043
|
-
* By default, there is the "View in full screen" and "Print" menu
|
|
1044
|
-
* items, plus one menu item for each of the available export types.
|
|
1045
|
-
*
|
|
1046
|
-
* @sample {highcharts} highcharts/exporting/menuitemdefinitions/
|
|
1047
|
-
* Menu item definitions
|
|
1048
|
-
* @sample {highstock} highcharts/exporting/menuitemdefinitions/
|
|
1049
|
-
* Menu item definitions
|
|
1050
|
-
* @sample {highmaps} highcharts/exporting/menuitemdefinitions/
|
|
1051
|
-
* Menu item definitions
|
|
1052
|
-
*
|
|
1053
|
-
* @type {Array<string>}
|
|
1054
|
-
* @default ["viewFullscreen", "printChart", "separator", "downloadPNG", "downloadJPEG", "downloadPDF", "downloadSVG"]
|
|
1055
|
-
* @since 2.0
|
|
1056
|
-
*/
|
|
1057
|
-
menuItems: [
|
|
1058
|
-
'viewFullscreen',
|
|
1059
|
-
'printChart',
|
|
1060
|
-
'separator',
|
|
1061
|
-
'downloadPNG',
|
|
1062
|
-
'downloadJPEG',
|
|
1063
|
-
'downloadPDF',
|
|
1064
|
-
'downloadSVG'
|
|
1065
|
-
]
|
|
1066
|
-
}
|
|
1067
|
-
},
|
|
1068
|
-
/**
|
|
1069
|
-
* An object consisting of definitions for the menu items in the context
|
|
1070
|
-
* menu. Each key value pair has a `key` that is referenced in the
|
|
1071
|
-
* [menuItems](#exporting.buttons.contextButton.menuItems) setting,
|
|
1072
|
-
* and a `value`, which is an object with the following properties:
|
|
1073
|
-
*
|
|
1074
|
-
* - **onclick:** The click handler for the menu item
|
|
1075
|
-
*
|
|
1076
|
-
* - **text:** The text for the menu item
|
|
1077
|
-
*
|
|
1078
|
-
* - **textKey:** If internationalization is required, the key to a language
|
|
1079
|
-
* string
|
|
1080
|
-
*
|
|
1081
|
-
* Custom text for the "exitFullScreen" can be set only in lang options
|
|
1082
|
-
* (it is not a separate button).
|
|
1083
|
-
*
|
|
1084
|
-
* @sample {highcharts} highcharts/exporting/menuitemdefinitions/
|
|
1085
|
-
* Menu item definitions
|
|
1086
|
-
* @sample {highstock} highcharts/exporting/menuitemdefinitions/
|
|
1087
|
-
* Menu item definitions
|
|
1088
|
-
* @sample {highmaps} highcharts/exporting/menuitemdefinitions/
|
|
1089
|
-
* Menu item definitions
|
|
1090
|
-
*
|
|
1091
|
-
*
|
|
1092
|
-
* @type {Highcharts.Dictionary<Highcharts.ExportingMenuObject>}
|
|
1093
|
-
* @default {"viewFullscreen": {}, "printChart": {}, "separator": {}, "downloadPNG": {}, "downloadJPEG": {}, "downloadPDF": {}, "downloadSVG": {}}
|
|
1094
|
-
* @since 5.0.13
|
|
1095
|
-
*/
|
|
1096
|
-
menuItemDefinitions: {
|
|
1097
|
-
/**
|
|
1098
|
-
* @ignore
|
|
1099
|
-
*/
|
|
1100
|
-
viewFullscreen: {
|
|
1101
|
-
textKey: 'viewFullscreen',
|
|
1102
|
-
onclick: function () {
|
|
1103
|
-
this.fullscreen.toggle();
|
|
716
|
+
viewFullscreen: {
|
|
717
|
+
textKey: 'viewFullscreen',
|
|
718
|
+
onclick: function () {
|
|
719
|
+
this.fullscreen.toggle();
|
|
1104
720
|
}
|
|
1105
721
|
},
|
|
1106
722
|
/**
|
|
@@ -1162,418 +778,908 @@
|
|
|
1162
778
|
}
|
|
1163
779
|
}
|
|
1164
780
|
};
|
|
781
|
+
// Add language
|
|
1165
782
|
/**
|
|
1166
|
-
*
|
|
1167
|
-
* `Chart.print` method.
|
|
1168
|
-
*
|
|
1169
|
-
* @sample highcharts/chart/events-beforeprint-afterprint/
|
|
1170
|
-
* Rescale the chart to print
|
|
1171
|
-
*
|
|
1172
|
-
* @type {Highcharts.ExportingAfterPrintCallbackFunction}
|
|
1173
|
-
* @since 4.1.0
|
|
1174
|
-
* @context Highcharts.Chart
|
|
1175
|
-
* @requires modules/exporting
|
|
1176
|
-
* @apioption chart.events.afterPrint
|
|
1177
|
-
*/
|
|
1178
|
-
/**
|
|
1179
|
-
* Fires before a chart is printed through the context menu item or
|
|
1180
|
-
* the `Chart.print` method.
|
|
1181
|
-
*
|
|
1182
|
-
* @sample highcharts/chart/events-beforeprint-afterprint/
|
|
1183
|
-
* Rescale the chart to print
|
|
1184
|
-
*
|
|
1185
|
-
* @type {Highcharts.ExportingBeforePrintCallbackFunction}
|
|
1186
|
-
* @since 4.1.0
|
|
1187
|
-
* @context Highcharts.Chart
|
|
1188
|
-
* @requires modules/exporting
|
|
1189
|
-
* @apioption chart.events.beforePrint
|
|
783
|
+
* @optionparent lang
|
|
1190
784
|
*/
|
|
785
|
+
var lang = {
|
|
786
|
+
/**
|
|
787
|
+
* Exporting module only. The text for the menu item to view the chart
|
|
788
|
+
* in full screen.
|
|
789
|
+
*
|
|
790
|
+
* @since 8.0.1
|
|
791
|
+
*
|
|
792
|
+
* @private
|
|
793
|
+
*/
|
|
794
|
+
viewFullscreen: 'View in full screen',
|
|
795
|
+
/**
|
|
796
|
+
* Exporting module only. The text for the menu item to exit the chart
|
|
797
|
+
* from full screen.
|
|
798
|
+
*
|
|
799
|
+
* @since 8.0.1
|
|
800
|
+
*
|
|
801
|
+
* @private
|
|
802
|
+
*/
|
|
803
|
+
exitFullscreen: 'Exit from full screen',
|
|
804
|
+
/**
|
|
805
|
+
* Exporting module only. The text for the menu item to print the chart.
|
|
806
|
+
*
|
|
807
|
+
* @since 3.0.1
|
|
808
|
+
* @requires modules/exporting
|
|
809
|
+
*
|
|
810
|
+
* @private
|
|
811
|
+
*/
|
|
812
|
+
printChart: 'Print chart',
|
|
813
|
+
/**
|
|
814
|
+
* Exporting module only. The text for the PNG download menu item.
|
|
815
|
+
*
|
|
816
|
+
* @since 2.0
|
|
817
|
+
* @requires modules/exporting
|
|
818
|
+
*
|
|
819
|
+
* @private
|
|
820
|
+
*/
|
|
821
|
+
downloadPNG: 'Download PNG image',
|
|
822
|
+
/**
|
|
823
|
+
* Exporting module only. The text for the JPEG download menu item.
|
|
824
|
+
*
|
|
825
|
+
* @since 2.0
|
|
826
|
+
* @requires modules/exporting
|
|
827
|
+
*
|
|
828
|
+
* @private
|
|
829
|
+
*/
|
|
830
|
+
downloadJPEG: 'Download JPEG image',
|
|
831
|
+
/**
|
|
832
|
+
* Exporting module only. The text for the PDF download menu item.
|
|
833
|
+
*
|
|
834
|
+
* @since 2.0
|
|
835
|
+
* @requires modules/exporting
|
|
836
|
+
*
|
|
837
|
+
* @private
|
|
838
|
+
*/
|
|
839
|
+
downloadPDF: 'Download PDF document',
|
|
840
|
+
/**
|
|
841
|
+
* Exporting module only. The text for the SVG download menu item.
|
|
842
|
+
*
|
|
843
|
+
* @since 2.0
|
|
844
|
+
* @requires modules/exporting
|
|
845
|
+
*
|
|
846
|
+
* @private
|
|
847
|
+
*/
|
|
848
|
+
downloadSVG: 'Download SVG vector image',
|
|
849
|
+
/**
|
|
850
|
+
* Exporting module menu. The tooltip title for the context menu holding
|
|
851
|
+
* print and export menu items.
|
|
852
|
+
*
|
|
853
|
+
* @since 3.0
|
|
854
|
+
* @requires modules/exporting
|
|
855
|
+
*
|
|
856
|
+
* @private
|
|
857
|
+
*/
|
|
858
|
+
contextButtonTitle: 'Chart context menu'
|
|
859
|
+
};
|
|
1191
860
|
/**
|
|
1192
|
-
*
|
|
861
|
+
* A collection of options for buttons and menus appearing in the exporting
|
|
862
|
+
* module.
|
|
1193
863
|
*
|
|
1194
|
-
* @
|
|
1195
|
-
* @function Highcharts.post
|
|
1196
|
-
* @param {string} url
|
|
1197
|
-
* Post URL
|
|
1198
|
-
* @param {object} data
|
|
1199
|
-
* Post data
|
|
1200
|
-
* @param {Highcharts.Dictionary<string>} [formAttributes]
|
|
1201
|
-
* Additional attributes for the post request
|
|
1202
|
-
* @return {void}
|
|
864
|
+
* @optionparent navigation
|
|
1203
865
|
*/
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
866
|
+
var navigation = {
|
|
867
|
+
/**
|
|
868
|
+
* A collection of options for buttons appearing in the exporting
|
|
869
|
+
* module.
|
|
870
|
+
*
|
|
871
|
+
* In styled mode, the buttons are styled with the
|
|
872
|
+
* `.highcharts-contextbutton` and `.highcharts-button-symbol` classes.
|
|
873
|
+
*
|
|
874
|
+
* @requires modules/exporting
|
|
875
|
+
*
|
|
876
|
+
* @private
|
|
877
|
+
*/
|
|
878
|
+
buttonOptions: {
|
|
879
|
+
/**
|
|
880
|
+
* Whether to enable buttons.
|
|
881
|
+
*
|
|
882
|
+
* @sample highcharts/navigation/buttonoptions-enabled/
|
|
883
|
+
* Exporting module loaded but buttons disabled
|
|
884
|
+
*
|
|
885
|
+
* @type {boolean}
|
|
886
|
+
* @default true
|
|
887
|
+
* @since 2.0
|
|
888
|
+
* @apioption navigation.buttonOptions.enabled
|
|
889
|
+
*/
|
|
890
|
+
/**
|
|
891
|
+
* The pixel size of the symbol on the button.
|
|
892
|
+
*
|
|
893
|
+
* @sample highcharts/navigation/buttonoptions-height/
|
|
894
|
+
* Bigger buttons
|
|
895
|
+
*
|
|
896
|
+
* @since 2.0
|
|
897
|
+
*/
|
|
898
|
+
symbolSize: 14,
|
|
899
|
+
/**
|
|
900
|
+
* The x position of the center of the symbol inside the button.
|
|
901
|
+
*
|
|
902
|
+
* @sample highcharts/navigation/buttonoptions-height/
|
|
903
|
+
* Bigger buttons
|
|
904
|
+
*
|
|
905
|
+
* @since 2.0
|
|
906
|
+
*/
|
|
907
|
+
symbolX: 12.5,
|
|
908
|
+
/**
|
|
909
|
+
* The y position of the center of the symbol inside the button.
|
|
910
|
+
*
|
|
911
|
+
* @sample highcharts/navigation/buttonoptions-height/
|
|
912
|
+
* Bigger buttons
|
|
913
|
+
*
|
|
914
|
+
* @since 2.0
|
|
915
|
+
*/
|
|
916
|
+
symbolY: 10.5,
|
|
917
|
+
/**
|
|
918
|
+
* Alignment for the buttons.
|
|
919
|
+
*
|
|
920
|
+
* @sample highcharts/navigation/buttonoptions-align/
|
|
921
|
+
* Center aligned
|
|
922
|
+
*
|
|
923
|
+
* @type {Highcharts.AlignValue}
|
|
924
|
+
* @since 2.0
|
|
925
|
+
*/
|
|
926
|
+
align: 'right',
|
|
927
|
+
/**
|
|
928
|
+
* The pixel spacing between buttons.
|
|
929
|
+
*
|
|
930
|
+
* @since 2.0
|
|
931
|
+
*/
|
|
932
|
+
buttonSpacing: 3,
|
|
933
|
+
/**
|
|
934
|
+
* Pixel height of the buttons.
|
|
935
|
+
*
|
|
936
|
+
* @sample highcharts/navigation/buttonoptions-height/
|
|
937
|
+
* Bigger buttons
|
|
938
|
+
*
|
|
939
|
+
* @since 2.0
|
|
940
|
+
*/
|
|
941
|
+
height: 22,
|
|
942
|
+
/**
|
|
943
|
+
* A text string to add to the individual button.
|
|
944
|
+
*
|
|
945
|
+
* @sample highcharts/exporting/buttons-text/
|
|
946
|
+
* Full text button
|
|
947
|
+
* @sample highcharts/exporting/buttons-text-symbol/
|
|
948
|
+
* Combined symbol and text
|
|
949
|
+
*
|
|
950
|
+
* @type {string}
|
|
951
|
+
* @default null
|
|
952
|
+
* @since 3.0
|
|
953
|
+
* @apioption navigation.buttonOptions.text
|
|
954
|
+
*/
|
|
955
|
+
/**
|
|
956
|
+
* The vertical offset of the button's position relative to its
|
|
957
|
+
* `verticalAlign`.
|
|
958
|
+
*
|
|
959
|
+
* @sample highcharts/navigation/buttonoptions-verticalalign/
|
|
960
|
+
* Buttons at lower right
|
|
961
|
+
*
|
|
962
|
+
* @type {number}
|
|
963
|
+
* @default 0
|
|
964
|
+
* @since 2.0
|
|
965
|
+
* @apioption navigation.buttonOptions.y
|
|
966
|
+
*/
|
|
967
|
+
/**
|
|
968
|
+
* The vertical alignment of the buttons. Can be one of `"top"`,
|
|
969
|
+
* `"middle"` or `"bottom"`.
|
|
970
|
+
*
|
|
971
|
+
* @sample highcharts/navigation/buttonoptions-verticalalign/
|
|
972
|
+
* Buttons at lower right
|
|
973
|
+
*
|
|
974
|
+
* @type {Highcharts.VerticalAlignValue}
|
|
975
|
+
* @since 2.0
|
|
976
|
+
*/
|
|
977
|
+
verticalAlign: 'top',
|
|
978
|
+
/**
|
|
979
|
+
* The pixel width of the button.
|
|
980
|
+
*
|
|
981
|
+
* @sample highcharts/navigation/buttonoptions-height/
|
|
982
|
+
* Bigger buttons
|
|
983
|
+
*
|
|
984
|
+
* @since 2.0
|
|
985
|
+
*/
|
|
986
|
+
width: 24,
|
|
987
|
+
/**
|
|
988
|
+
* Fill color for the symbol within the button.
|
|
989
|
+
*
|
|
990
|
+
* @sample highcharts/navigation/buttonoptions-symbolfill/
|
|
991
|
+
* Blue symbol stroke for one of the buttons
|
|
992
|
+
*
|
|
993
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
994
|
+
* @since 2.0
|
|
995
|
+
*/
|
|
996
|
+
symbolFill: Palette.neutralColor60,
|
|
997
|
+
/**
|
|
998
|
+
* The color of the symbol's stroke or line.
|
|
999
|
+
*
|
|
1000
|
+
* @sample highcharts/navigation/buttonoptions-symbolstroke/
|
|
1001
|
+
* Blue symbol stroke
|
|
1002
|
+
*
|
|
1003
|
+
* @type {Highcharts.ColorString}
|
|
1004
|
+
* @since 2.0
|
|
1005
|
+
*/
|
|
1006
|
+
symbolStroke: Palette.neutralColor60,
|
|
1007
|
+
/**
|
|
1008
|
+
* The pixel stroke width of the symbol on the button.
|
|
1009
|
+
*
|
|
1010
|
+
* @sample highcharts/navigation/buttonoptions-height/
|
|
1011
|
+
* Bigger buttons
|
|
1012
|
+
*
|
|
1013
|
+
* @since 2.0
|
|
1014
|
+
*/
|
|
1015
|
+
symbolStrokeWidth: 3,
|
|
1016
|
+
/**
|
|
1017
|
+
* A configuration object for the button theme. The object accepts
|
|
1018
|
+
* SVG properties like `stroke-width`, `stroke` and `fill`.
|
|
1019
|
+
* Tri-state button styles are supported by the `states.hover` and
|
|
1020
|
+
* `states.select` objects.
|
|
1021
|
+
*
|
|
1022
|
+
* @sample highcharts/navigation/buttonoptions-theme/
|
|
1023
|
+
* Theming the buttons
|
|
1024
|
+
*
|
|
1025
|
+
* @requires modules/exporting
|
|
1026
|
+
*
|
|
1027
|
+
* @since 3.0
|
|
1028
|
+
*/
|
|
1029
|
+
theme: {
|
|
1030
|
+
/**
|
|
1031
|
+
* The default fill exists only to capture hover events.
|
|
1032
|
+
*
|
|
1033
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
|
1034
|
+
* @default ${palette.backgroundColor}
|
|
1035
|
+
* @apioption navigation.buttonOptions.theme.fill
|
|
1036
|
+
*/
|
|
1037
|
+
/**
|
|
1038
|
+
* Default stroke for the buttons.
|
|
1039
|
+
* @type {Highcharts.ColorString}
|
|
1040
|
+
* @default none
|
|
1041
|
+
* @apioption navigation.buttonOptions.theme.stroke
|
|
1042
|
+
*/
|
|
1043
|
+
/**
|
|
1044
|
+
* Padding for the button.
|
|
1045
|
+
*/
|
|
1046
|
+
padding: 5
|
|
1047
|
+
}
|
|
1211
1048
|
},
|
|
1212
|
-
|
|
1213
|
-
|
|
1049
|
+
/**
|
|
1050
|
+
* CSS styles for the popup menu appearing by default when the export
|
|
1051
|
+
* icon is clicked. This menu is rendered in HTML.
|
|
1052
|
+
*
|
|
1053
|
+
* @see In styled mode, the menu is styled with the `.highcharts-menu`
|
|
1054
|
+
* class.
|
|
1055
|
+
*
|
|
1056
|
+
* @sample highcharts/navigation/menustyle/
|
|
1057
|
+
* Light gray menu background
|
|
1058
|
+
*
|
|
1059
|
+
* @type {Highcharts.CSSObject}
|
|
1060
|
+
* @default {"border": "1px solid #999999", "background": "#ffffff", "padding": "5px 0"}
|
|
1061
|
+
* @since 2.0
|
|
1062
|
+
*
|
|
1063
|
+
* @private
|
|
1064
|
+
*/
|
|
1065
|
+
menuStyle: {
|
|
1066
|
+
/** @ignore-option */
|
|
1067
|
+
border: "1px solid " + Palette.neutralColor40,
|
|
1068
|
+
/** @ignore-option */
|
|
1069
|
+
background: Palette.backgroundColor,
|
|
1070
|
+
/** @ignore-option */
|
|
1071
|
+
padding: '5px 0'
|
|
1214
1072
|
},
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1073
|
+
/**
|
|
1074
|
+
* CSS styles for the individual items within the popup menu appearing
|
|
1075
|
+
* by default when the export icon is clicked. The menu items are
|
|
1076
|
+
* rendered in HTML. Font size defaults to `11px` on desktop and `14px`
|
|
1077
|
+
* on touch devices.
|
|
1078
|
+
*
|
|
1079
|
+
* @see In styled mode, the menu items are styled with the
|
|
1080
|
+
* `.highcharts-menu-item` class.
|
|
1081
|
+
*
|
|
1082
|
+
* @sample {highcharts} highcharts/navigation/menuitemstyle/
|
|
1083
|
+
* Add a grey stripe to the left
|
|
1084
|
+
*
|
|
1085
|
+
* @type {Highcharts.CSSObject}
|
|
1086
|
+
* @default {"padding": "0.5em 1em", "color": "#333333", "background": "none", "fontSize": "11px/14px", "transition": "background 250ms, color 250ms"}
|
|
1087
|
+
* @since 2.0
|
|
1088
|
+
*
|
|
1089
|
+
* @private
|
|
1090
|
+
*/
|
|
1091
|
+
menuItemStyle: {
|
|
1092
|
+
/** @ignore-option */
|
|
1093
|
+
padding: '0.5em 1em',
|
|
1094
|
+
/** @ignore-option */
|
|
1095
|
+
color: Palette.neutralColor80,
|
|
1096
|
+
/** @ignore-option */
|
|
1097
|
+
background: 'none',
|
|
1098
|
+
/** @ignore-option */
|
|
1099
|
+
fontSize: isTouchDevice ? '14px' : '11px',
|
|
1100
|
+
/** @ignore-option */
|
|
1101
|
+
transition: 'background 250ms, color 250ms'
|
|
1102
|
+
},
|
|
1103
|
+
/**
|
|
1104
|
+
* CSS styles for the hover state of the individual items within the
|
|
1105
|
+
* popup menu appearing by default when the export icon is clicked. The
|
|
1106
|
+
* menu items are rendered in HTML.
|
|
1107
|
+
*
|
|
1108
|
+
* @see In styled mode, the menu items are styled with the
|
|
1109
|
+
* `.highcharts-menu-item` class.
|
|
1110
|
+
*
|
|
1111
|
+
* @sample highcharts/navigation/menuitemhoverstyle/
|
|
1112
|
+
* Bold text on hover
|
|
1113
|
+
*
|
|
1114
|
+
* @type {Highcharts.CSSObject}
|
|
1115
|
+
* @default {"background": "#335cad", "color": "#ffffff"}
|
|
1116
|
+
* @since 2.0
|
|
1117
|
+
*
|
|
1118
|
+
* @private
|
|
1119
|
+
*/
|
|
1120
|
+
menuItemHoverStyle: {
|
|
1121
|
+
/** @ignore-option */
|
|
1122
|
+
background: Palette.highlightColor80,
|
|
1123
|
+
/** @ignore-option */
|
|
1124
|
+
color: Palette.backgroundColor
|
|
1239
1125
|
}
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
'</foreignObject>';
|
|
1275
|
-
svg = svg.replace('</svg>', html + '</svg>');
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
svg = svg
|
|
1279
|
-
.replace(/zIndex="[^"]+"/g, '')
|
|
1280
|
-
.replace(/symbolName="[^"]+"/g, '')
|
|
1281
|
-
.replace(/jQuery[0-9]+="[^"]+"/g, '')
|
|
1282
|
-
.replace(/url\(("|")(.*?)("|")\;?\)/g, 'url($2)')
|
|
1283
|
-
.replace(/url\([^#]+#/g, 'url(#')
|
|
1284
|
-
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
|
|
1285
|
-
.replace(/ (|NS[0-9]+\:)href=/g, ' xlink:href=') // #3567
|
|
1286
|
-
.replace(/\n/, ' ')
|
|
1287
|
-
// Batik doesn't support rgba fills and strokes (#3095)
|
|
1288
|
-
.replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, // eslint-disable-line max-len
|
|
1289
|
-
'$1="rgb($2)" $1-opacity="$3"')
|
|
1290
|
-
// Replace HTML entities, issue #347
|
|
1291
|
-
.replace(/ /g, '\u00A0') // no-break space
|
|
1292
|
-
.replace(/­/g, '\u00AD'); // soft hyphen
|
|
1293
|
-
// Further sanitize for oldIE
|
|
1294
|
-
if (this.ieSanitizeSVG) {
|
|
1295
|
-
svg = this.ieSanitizeSVG(svg);
|
|
1296
|
-
}
|
|
1297
|
-
return svg;
|
|
1298
|
-
},
|
|
1299
|
-
/**
|
|
1300
|
-
* Return the unfiltered innerHTML of the chart container. Used as hook for
|
|
1301
|
-
* plugins. In styled mode, it also takes care of inlining CSS style rules.
|
|
1126
|
+
};
|
|
1127
|
+
/* *
|
|
1128
|
+
*
|
|
1129
|
+
* Default Export
|
|
1130
|
+
*
|
|
1131
|
+
* */
|
|
1132
|
+
var ExportingDefaults = {
|
|
1133
|
+
exporting: exporting,
|
|
1134
|
+
lang: lang,
|
|
1135
|
+
navigation: navigation
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
return ExportingDefaults;
|
|
1139
|
+
});
|
|
1140
|
+
_registerModule(_modules, 'Extensions/Exporting/ExportingSymbols.js', [], function () {
|
|
1141
|
+
/* *
|
|
1142
|
+
*
|
|
1143
|
+
* Exporting module
|
|
1144
|
+
*
|
|
1145
|
+
* (c) 2010-2021 Torstein Honsi
|
|
1146
|
+
*
|
|
1147
|
+
* License: www.highcharts.com/license
|
|
1148
|
+
*
|
|
1149
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
1150
|
+
*
|
|
1151
|
+
* */
|
|
1152
|
+
/* *
|
|
1153
|
+
*
|
|
1154
|
+
* Composition
|
|
1155
|
+
*
|
|
1156
|
+
* */
|
|
1157
|
+
var ExportingSymbols;
|
|
1158
|
+
(function (ExportingSymbols) {
|
|
1159
|
+
/* *
|
|
1302
1160
|
*
|
|
1303
|
-
*
|
|
1161
|
+
* Constants
|
|
1304
1162
|
*
|
|
1305
|
-
*
|
|
1163
|
+
* */
|
|
1164
|
+
var modifiedClasses = [];
|
|
1165
|
+
/* *
|
|
1306
1166
|
*
|
|
1307
|
-
*
|
|
1308
|
-
* The unfiltered SVG of the chart.
|
|
1167
|
+
* Functions
|
|
1309
1168
|
*
|
|
1310
|
-
*
|
|
1169
|
+
* */
|
|
1170
|
+
/* eslint-disable valid-jsdoc */
|
|
1171
|
+
/**
|
|
1172
|
+
* @private
|
|
1311
1173
|
*/
|
|
1312
|
-
|
|
1313
|
-
if (
|
|
1314
|
-
|
|
1174
|
+
function compose(SVGRendererClass) {
|
|
1175
|
+
if (modifiedClasses.indexOf(SVGRendererClass) === -1) {
|
|
1176
|
+
modifiedClasses.push(SVGRendererClass);
|
|
1177
|
+
var symbols = SVGRendererClass.prototype.symbols;
|
|
1178
|
+
symbols.menu = menu;
|
|
1179
|
+
symbols.menuball = menuball.bind(symbols);
|
|
1315
1180
|
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1181
|
+
}
|
|
1182
|
+
ExportingSymbols.compose = compose;
|
|
1318
1183
|
/**
|
|
1319
|
-
*
|
|
1184
|
+
* @private
|
|
1185
|
+
*/
|
|
1186
|
+
function menu(x, y, width, height) {
|
|
1187
|
+
var arr = [
|
|
1188
|
+
['M',
|
|
1189
|
+
x,
|
|
1190
|
+
y + 2.5],
|
|
1191
|
+
['L',
|
|
1192
|
+
x + width,
|
|
1193
|
+
y + 2.5],
|
|
1194
|
+
['M',
|
|
1195
|
+
x,
|
|
1196
|
+
y + height / 2 + 0.5],
|
|
1197
|
+
['L',
|
|
1198
|
+
x + width,
|
|
1199
|
+
y + height / 2 + 0.5],
|
|
1200
|
+
['M',
|
|
1201
|
+
x,
|
|
1202
|
+
y + height - 1.5],
|
|
1203
|
+
['L',
|
|
1204
|
+
x + width,
|
|
1205
|
+
y + height - 1.5]
|
|
1206
|
+
];
|
|
1207
|
+
return arr;
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* @private
|
|
1211
|
+
*/
|
|
1212
|
+
function menuball(x, y, width, height) {
|
|
1213
|
+
var h = (height / 3) - 2;
|
|
1214
|
+
var path = [];
|
|
1215
|
+
path = path.concat(this.circle(width - h, y, h, h), this.circle(width - h, y + h + 4, h, h), this.circle(width - h, y + 2 * (h + 4), h, h));
|
|
1216
|
+
return path;
|
|
1217
|
+
}
|
|
1218
|
+
})(ExportingSymbols || (ExportingSymbols = {}));
|
|
1219
|
+
/* *
|
|
1220
|
+
*
|
|
1221
|
+
* Default Export
|
|
1222
|
+
*
|
|
1223
|
+
* */
|
|
1224
|
+
|
|
1225
|
+
return ExportingSymbols;
|
|
1226
|
+
});
|
|
1227
|
+
_registerModule(_modules, 'Core/HttpUtilities.js', [_modules['Core/Globals.js'], _modules['Core/Utilities.js']], function (G, U) {
|
|
1228
|
+
/* *
|
|
1229
|
+
*
|
|
1230
|
+
* (c) 2010-2021 Christer Vasseng, Torstein Honsi
|
|
1231
|
+
*
|
|
1232
|
+
* License: www.highcharts.com/license
|
|
1233
|
+
*
|
|
1234
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
1235
|
+
*
|
|
1236
|
+
* */
|
|
1237
|
+
var doc = G.doc;
|
|
1238
|
+
var createElement = U.createElement,
|
|
1239
|
+
discardElement = U.discardElement,
|
|
1240
|
+
merge = U.merge,
|
|
1241
|
+
objectEach = U.objectEach;
|
|
1242
|
+
/**
|
|
1243
|
+
* Perform an Ajax call.
|
|
1244
|
+
*
|
|
1245
|
+
* @function Highcharts.ajax
|
|
1246
|
+
*
|
|
1247
|
+
* @param {Partial<Highcharts.AjaxSettingsObject>} attr
|
|
1248
|
+
* The Ajax settings to use.
|
|
1249
|
+
*
|
|
1250
|
+
* @return {false|undefined}
|
|
1251
|
+
* Returns false, if error occured.
|
|
1252
|
+
*/
|
|
1253
|
+
function ajax(attr) {
|
|
1254
|
+
var options = merge(true, {
|
|
1255
|
+
url: false,
|
|
1256
|
+
type: 'get',
|
|
1257
|
+
dataType: 'json',
|
|
1258
|
+
success: false,
|
|
1259
|
+
error: false,
|
|
1260
|
+
data: false,
|
|
1261
|
+
headers: {}
|
|
1262
|
+
},
|
|
1263
|
+
attr),
|
|
1264
|
+
headers = {
|
|
1265
|
+
json: 'application/json',
|
|
1266
|
+
xml: 'application/xml',
|
|
1267
|
+
text: 'text/plain',
|
|
1268
|
+
octet: 'application/octet-stream'
|
|
1269
|
+
},
|
|
1270
|
+
r = new XMLHttpRequest();
|
|
1271
|
+
/**
|
|
1272
|
+
* @private
|
|
1273
|
+
* @param {XMLHttpRequest} xhr - Internal request object.
|
|
1274
|
+
* @param {string|Error} err - Occured error.
|
|
1275
|
+
* @return {void}
|
|
1276
|
+
*/
|
|
1277
|
+
function handleError(xhr, err) {
|
|
1278
|
+
if (options.error) {
|
|
1279
|
+
options.error(xhr, err);
|
|
1280
|
+
}
|
|
1281
|
+
else {
|
|
1282
|
+
// @todo Maybe emit a highcharts error event here
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
if (!options.url) {
|
|
1286
|
+
return false;
|
|
1287
|
+
}
|
|
1288
|
+
r.open(options.type.toUpperCase(), options.url, true);
|
|
1289
|
+
if (!options.headers['Content-Type']) {
|
|
1290
|
+
r.setRequestHeader('Content-Type', headers[options.dataType] || headers.text);
|
|
1291
|
+
}
|
|
1292
|
+
objectEach(options.headers, function (val, key) {
|
|
1293
|
+
r.setRequestHeader(key, val);
|
|
1294
|
+
});
|
|
1295
|
+
// @todo lacking timeout handling
|
|
1296
|
+
r.onreadystatechange = function () {
|
|
1297
|
+
var res;
|
|
1298
|
+
if (r.readyState === 4) {
|
|
1299
|
+
if (r.status === 200) {
|
|
1300
|
+
res = r.responseText;
|
|
1301
|
+
if (options.dataType === 'json') {
|
|
1302
|
+
try {
|
|
1303
|
+
res = JSON.parse(res);
|
|
1304
|
+
}
|
|
1305
|
+
catch (e) {
|
|
1306
|
+
return handleError(r, e);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
return options.success && options.success(res);
|
|
1310
|
+
}
|
|
1311
|
+
handleError(r, r.responseText);
|
|
1312
|
+
}
|
|
1313
|
+
};
|
|
1314
|
+
try {
|
|
1315
|
+
options.data = JSON.stringify(options.data);
|
|
1316
|
+
}
|
|
1317
|
+
catch (e) {
|
|
1318
|
+
// empty
|
|
1319
|
+
}
|
|
1320
|
+
r.send(options.data || true);
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Get a JSON resource over XHR, also supporting CORS without preflight.
|
|
1324
|
+
*
|
|
1325
|
+
* @function Highcharts.getJSON
|
|
1326
|
+
* @param {string} url
|
|
1327
|
+
* The URL to load.
|
|
1328
|
+
* @param {Function} success
|
|
1329
|
+
* The success callback. For error handling, use the `Highcharts.ajax`
|
|
1330
|
+
* function instead.
|
|
1331
|
+
*/
|
|
1332
|
+
function getJSON(url, success) {
|
|
1333
|
+
exports.ajax({
|
|
1334
|
+
url: url,
|
|
1335
|
+
success: success,
|
|
1336
|
+
dataType: 'json',
|
|
1337
|
+
headers: {
|
|
1338
|
+
// Override the Content-Type to avoid preflight problems with CORS
|
|
1339
|
+
// in the Highcharts demos
|
|
1340
|
+
'Content-Type': 'text/plain'
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
/**
|
|
1345
|
+
* The post utility
|
|
1346
|
+
*
|
|
1347
|
+
* @private
|
|
1348
|
+
* @function Highcharts.post
|
|
1349
|
+
*
|
|
1350
|
+
* @param {string} url
|
|
1351
|
+
* Post URL
|
|
1352
|
+
*
|
|
1353
|
+
* @param {object} data
|
|
1354
|
+
* Post data
|
|
1355
|
+
*
|
|
1356
|
+
* @param {Highcharts.Dictionary<string>} [formAttributes]
|
|
1357
|
+
* Additional attributes for the post request
|
|
1358
|
+
*/
|
|
1359
|
+
function post(url, data, formAttributes) {
|
|
1360
|
+
// create the form
|
|
1361
|
+
var form = createElement('form',
|
|
1362
|
+
merge({
|
|
1363
|
+
method: 'post',
|
|
1364
|
+
action: url,
|
|
1365
|
+
enctype: 'multipart/form-data'
|
|
1366
|
+
},
|
|
1367
|
+
formAttributes), {
|
|
1368
|
+
display: 'none'
|
|
1369
|
+
},
|
|
1370
|
+
doc.body);
|
|
1371
|
+
// add the data
|
|
1372
|
+
objectEach(data, function (val, name) {
|
|
1373
|
+
createElement('input', {
|
|
1374
|
+
type: 'hidden',
|
|
1375
|
+
name: name,
|
|
1376
|
+
value: val
|
|
1377
|
+
}, null, form);
|
|
1378
|
+
});
|
|
1379
|
+
// submit
|
|
1380
|
+
form.submit();
|
|
1381
|
+
// clean up
|
|
1382
|
+
discardElement(form);
|
|
1383
|
+
}
|
|
1384
|
+
/* *
|
|
1385
|
+
*
|
|
1386
|
+
* Default Export
|
|
1387
|
+
*
|
|
1388
|
+
* */
|
|
1389
|
+
var exports = {
|
|
1390
|
+
ajax: ajax,
|
|
1391
|
+
getJSON: getJSON,
|
|
1392
|
+
post: post
|
|
1393
|
+
};
|
|
1394
|
+
/**
|
|
1395
|
+
* @interface Highcharts.AjaxSettingsObject
|
|
1396
|
+
*/ /**
|
|
1397
|
+
* The payload to send.
|
|
1398
|
+
*
|
|
1399
|
+
* @name Highcharts.AjaxSettingsObject#data
|
|
1400
|
+
* @type {string|Highcharts.Dictionary<any>}
|
|
1401
|
+
*/ /**
|
|
1402
|
+
* The data type expected.
|
|
1403
|
+
* @name Highcharts.AjaxSettingsObject#dataType
|
|
1404
|
+
* @type {"json"|"xml"|"text"|"octet"}
|
|
1405
|
+
*/ /**
|
|
1406
|
+
* Function to call on error.
|
|
1407
|
+
* @name Highcharts.AjaxSettingsObject#error
|
|
1408
|
+
* @type {Function}
|
|
1409
|
+
*/ /**
|
|
1410
|
+
* The headers; keyed on header name.
|
|
1411
|
+
* @name Highcharts.AjaxSettingsObject#headers
|
|
1412
|
+
* @type {Highcharts.Dictionary<string>}
|
|
1413
|
+
*/ /**
|
|
1414
|
+
* Function to call on success.
|
|
1415
|
+
* @name Highcharts.AjaxSettingsObject#success
|
|
1416
|
+
* @type {Function}
|
|
1417
|
+
*/ /**
|
|
1418
|
+
* The HTTP method to use. For example GET or POST.
|
|
1419
|
+
* @name Highcharts.AjaxSettingsObject#type
|
|
1420
|
+
* @type {string}
|
|
1421
|
+
*/ /**
|
|
1422
|
+
* The URL to call.
|
|
1423
|
+
* @name Highcharts.AjaxSettingsObject#url
|
|
1424
|
+
* @type {string}
|
|
1425
|
+
*/
|
|
1426
|
+
(''); // keeps doclets above in JS file
|
|
1427
|
+
|
|
1428
|
+
return exports;
|
|
1429
|
+
});
|
|
1430
|
+
_registerModule(_modules, 'Extensions/Exporting/Exporting.js', [_modules['Core/Renderer/HTML/AST.js'], _modules['Core/Chart/Chart.js'], _modules['Mixins/Navigation.js'], _modules['Core/DefaultOptions.js'], _modules['Extensions/Exporting/ExportingDefaults.js'], _modules['Extensions/Exporting/ExportingSymbols.js'], _modules['Core/Globals.js'], _modules['Core/HttpUtilities.js'], _modules['Core/Color/Palette.js'], _modules['Core/Utilities.js']], function (AST, Chart, chartNavigationMixin, D, ExportingDefaults, ExportingSymbols, G, HU, Palette, U) {
|
|
1431
|
+
/* *
|
|
1432
|
+
*
|
|
1433
|
+
* Exporting module
|
|
1434
|
+
*
|
|
1435
|
+
* (c) 2010-2021 Torstein Honsi
|
|
1436
|
+
*
|
|
1437
|
+
* License: www.highcharts.com/license
|
|
1438
|
+
*
|
|
1439
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
1440
|
+
*
|
|
1441
|
+
* */
|
|
1442
|
+
var defaultOptions = D.defaultOptions;
|
|
1443
|
+
var doc = G.doc,
|
|
1444
|
+
win = G.win;
|
|
1445
|
+
var addEvent = U.addEvent,
|
|
1446
|
+
css = U.css,
|
|
1447
|
+
createElement = U.createElement,
|
|
1448
|
+
discardElement = U.discardElement,
|
|
1449
|
+
extend = U.extend,
|
|
1450
|
+
find = U.find,
|
|
1451
|
+
fireEvent = U.fireEvent,
|
|
1452
|
+
isObject = U.isObject,
|
|
1453
|
+
merge = U.merge,
|
|
1454
|
+
objectEach = U.objectEach,
|
|
1455
|
+
pick = U.pick,
|
|
1456
|
+
removeEvent = U.removeEvent,
|
|
1457
|
+
uniqueKey = U.uniqueKey;
|
|
1458
|
+
/* *
|
|
1459
|
+
*
|
|
1460
|
+
* Composition
|
|
1461
|
+
*
|
|
1462
|
+
* */
|
|
1463
|
+
var Exporting;
|
|
1464
|
+
(function (Exporting) {
|
|
1465
|
+
/* *
|
|
1320
1466
|
*
|
|
1321
|
-
*
|
|
1322
|
-
* View the SVG from a button
|
|
1467
|
+
* Declarations
|
|
1323
1468
|
*
|
|
1324
|
-
*
|
|
1469
|
+
* */
|
|
1470
|
+
/* *
|
|
1325
1471
|
*
|
|
1326
|
-
*
|
|
1327
|
-
* Additional chart options for the generated SVG representation. For
|
|
1328
|
-
* collections like `xAxis`, `yAxis` or `series`, the additional
|
|
1329
|
-
* options is either merged in to the original item of the same
|
|
1330
|
-
* `id`, or to the first item if a common id is not found.
|
|
1472
|
+
* Constants
|
|
1331
1473
|
*
|
|
1332
|
-
*
|
|
1333
|
-
|
|
1474
|
+
* */
|
|
1475
|
+
var composedClasses = [];
|
|
1476
|
+
// These CSS properties are not inlined. Remember camelCase.
|
|
1477
|
+
var inlineBlacklist = [
|
|
1478
|
+
/-/,
|
|
1479
|
+
/^(clipPath|cssText|d|height|width)$/,
|
|
1480
|
+
/^font$/,
|
|
1481
|
+
/[lL]ogical(Width|Height)$/,
|
|
1482
|
+
/perspective/,
|
|
1483
|
+
/TapHighlightColor/,
|
|
1484
|
+
/^transition/,
|
|
1485
|
+
/^length$/ // #7700
|
|
1486
|
+
// /^text (border|color|cursor|height|webkitBorder)/
|
|
1487
|
+
];
|
|
1488
|
+
// These ones are translated to attributes rather than styles
|
|
1489
|
+
var inlineToAttributes = [
|
|
1490
|
+
'fill',
|
|
1491
|
+
'stroke',
|
|
1492
|
+
'strokeLinecap',
|
|
1493
|
+
'strokeLinejoin',
|
|
1494
|
+
'strokeWidth',
|
|
1495
|
+
'textAnchor',
|
|
1496
|
+
'x',
|
|
1497
|
+
'y'
|
|
1498
|
+
];
|
|
1499
|
+
Exporting.inlineWhitelist = [];
|
|
1500
|
+
var unstyledElements = [
|
|
1501
|
+
'clipPath',
|
|
1502
|
+
'defs',
|
|
1503
|
+
'desc'
|
|
1504
|
+
];
|
|
1505
|
+
/* *
|
|
1334
1506
|
*
|
|
1335
|
-
*
|
|
1507
|
+
* Variables
|
|
1508
|
+
*
|
|
1509
|
+
* */
|
|
1510
|
+
var printingChart;
|
|
1511
|
+
/* *
|
|
1512
|
+
*
|
|
1513
|
+
* Functions
|
|
1336
1514
|
*
|
|
1515
|
+
* */
|
|
1516
|
+
/* eslint-disable valid-jsdoc */
|
|
1517
|
+
/**
|
|
1518
|
+
* Add the export button to the chart, with options.
|
|
1519
|
+
*
|
|
1520
|
+
* @private
|
|
1521
|
+
* @function Highcharts.Chart#addButton
|
|
1522
|
+
* @param {Highcharts.NavigationButtonOptions} options
|
|
1523
|
+
* @return {void}
|
|
1337
1524
|
* @requires modules/exporting
|
|
1338
1525
|
*/
|
|
1339
|
-
|
|
1526
|
+
function addButton(options) {
|
|
1340
1527
|
var chart = this,
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
(/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
|
|
1374
|
-
400;
|
|
1375
|
-
// override some options
|
|
1376
|
-
extend(options.chart, {
|
|
1377
|
-
animation: false,
|
|
1378
|
-
renderTo: sandbox,
|
|
1379
|
-
forExport: true,
|
|
1380
|
-
renderer: 'SVGRenderer',
|
|
1381
|
-
width: sourceWidth,
|
|
1382
|
-
height: sourceHeight
|
|
1383
|
-
});
|
|
1384
|
-
options.exporting.enabled = false; // hide buttons in print
|
|
1385
|
-
delete options.data; // #3004
|
|
1386
|
-
// prepare for replicating the chart
|
|
1387
|
-
options.series = [];
|
|
1388
|
-
chart.series.forEach(function (serie) {
|
|
1389
|
-
seriesOptions = merge(serie.userOptions, {
|
|
1390
|
-
animation: false,
|
|
1391
|
-
enableMouseTracking: false,
|
|
1392
|
-
showCheckbox: false,
|
|
1393
|
-
visible: serie.visible
|
|
1394
|
-
});
|
|
1395
|
-
// Used for the navigator series that has its own option set
|
|
1396
|
-
if (!seriesOptions.isInternal) {
|
|
1397
|
-
options.series.push(seriesOptions);
|
|
1398
|
-
}
|
|
1399
|
-
});
|
|
1400
|
-
var colls = {};
|
|
1401
|
-
chart.axes.forEach(function (axis) {
|
|
1402
|
-
// Assign an internal key to ensure a one-to-one mapping (#5924)
|
|
1403
|
-
if (!axis.userOptions.internalKey) { // #6444
|
|
1404
|
-
axis.userOptions.internalKey = uniqueKey();
|
|
1405
|
-
}
|
|
1406
|
-
if (!axis.options.isInternal) {
|
|
1407
|
-
if (!colls[axis.coll]) {
|
|
1408
|
-
colls[axis.coll] = true;
|
|
1409
|
-
options[axis.coll] = [];
|
|
1528
|
+
renderer = chart.renderer,
|
|
1529
|
+
btnOptions = merge(chart.options.navigation.buttonOptions,
|
|
1530
|
+
options),
|
|
1531
|
+
onclick = btnOptions.onclick,
|
|
1532
|
+
menuItems = btnOptions.menuItems,
|
|
1533
|
+
symbolSize = btnOptions.symbolSize || 12;
|
|
1534
|
+
var symbol;
|
|
1535
|
+
if (!chart.btnCount) {
|
|
1536
|
+
chart.btnCount = 0;
|
|
1537
|
+
}
|
|
1538
|
+
// Keeps references to the button elements
|
|
1539
|
+
if (!chart.exportDivElements) {
|
|
1540
|
+
chart.exportDivElements = [];
|
|
1541
|
+
chart.exportSVGElements = [];
|
|
1542
|
+
}
|
|
1543
|
+
if (btnOptions.enabled === false || !btnOptions.theme) {
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1546
|
+
var attr = btnOptions.theme,
|
|
1547
|
+
states = attr.states,
|
|
1548
|
+
hover = states && states.hover,
|
|
1549
|
+
select = states && states.select;
|
|
1550
|
+
var callback;
|
|
1551
|
+
if (!chart.styledMode) {
|
|
1552
|
+
attr.fill = pick(attr.fill, Palette.backgroundColor);
|
|
1553
|
+
attr.stroke = pick(attr.stroke, 'none');
|
|
1554
|
+
}
|
|
1555
|
+
delete attr.states;
|
|
1556
|
+
if (onclick) {
|
|
1557
|
+
callback = function (e) {
|
|
1558
|
+
if (e) {
|
|
1559
|
+
e.stopPropagation();
|
|
1410
1560
|
}
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
if (chartOptions) {
|
|
1420
|
-
['xAxis', 'yAxis', 'series'].forEach(function (coll) {
|
|
1421
|
-
var collOptions = {};
|
|
1422
|
-
if (chartOptions[coll]) {
|
|
1423
|
-
collOptions[coll] = chartOptions[coll];
|
|
1424
|
-
chartCopy.update(collOptions);
|
|
1561
|
+
onclick.call(chart, e);
|
|
1562
|
+
};
|
|
1563
|
+
}
|
|
1564
|
+
else if (menuItems) {
|
|
1565
|
+
callback = function (e) {
|
|
1566
|
+
// consistent with onclick call (#3495)
|
|
1567
|
+
if (e) {
|
|
1568
|
+
e.stopPropagation();
|
|
1425
1569
|
}
|
|
1570
|
+
chart.contextMenu(button.menuClassName, menuItems, button.translateX, button.translateY, button.width, button.height, button);
|
|
1571
|
+
button.setState(2);
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
if (btnOptions.text && btnOptions.symbol) {
|
|
1575
|
+
attr.paddingLeft = pick(attr.paddingLeft, 30);
|
|
1576
|
+
}
|
|
1577
|
+
else if (!btnOptions.text) {
|
|
1578
|
+
extend(attr, {
|
|
1579
|
+
width: btnOptions.width,
|
|
1580
|
+
height: btnOptions.height,
|
|
1581
|
+
padding: 0
|
|
1426
1582
|
});
|
|
1427
1583
|
}
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
sourceWidth: ((options && options.sourceWidth) ||
|
|
1465
|
-
chartExportingOptions.sourceWidth),
|
|
1466
|
-
sourceHeight: ((options && options.sourceHeight) ||
|
|
1467
|
-
chartExportingOptions.sourceHeight)
|
|
1584
|
+
if (!chart.styledMode) {
|
|
1585
|
+
attr['stroke-linecap'] = 'round';
|
|
1586
|
+
attr.fill = pick(attr.fill, Palette.backgroundColor);
|
|
1587
|
+
attr.stroke = pick(attr.stroke, 'none');
|
|
1588
|
+
}
|
|
1589
|
+
var button = renderer
|
|
1590
|
+
.button(btnOptions.text, 0, 0,
|
|
1591
|
+
callback,
|
|
1592
|
+
attr,
|
|
1593
|
+
hover,
|
|
1594
|
+
select)
|
|
1595
|
+
.addClass(options.className)
|
|
1596
|
+
.attr({
|
|
1597
|
+
title: pick(chart.options.lang[btnOptions._titleKey || btnOptions.titleKey], '')
|
|
1598
|
+
});
|
|
1599
|
+
button.menuClassName = (options.menuClassName ||
|
|
1600
|
+
'highcharts-menu-' + chart.btnCount++);
|
|
1601
|
+
if (btnOptions.symbol) {
|
|
1602
|
+
symbol = renderer
|
|
1603
|
+
.symbol(btnOptions.symbol, btnOptions.symbolX - (symbolSize / 2), btnOptions.symbolY - (symbolSize / 2), symbolSize, symbolSize
|
|
1604
|
+
// If symbol is an image, scale it (#7957)
|
|
1605
|
+
, {
|
|
1606
|
+
width: symbolSize,
|
|
1607
|
+
height: symbolSize
|
|
1608
|
+
})
|
|
1609
|
+
.addClass('highcharts-button-symbol')
|
|
1610
|
+
.attr({
|
|
1611
|
+
zIndex: 1
|
|
1612
|
+
})
|
|
1613
|
+
.add(button);
|
|
1614
|
+
if (!chart.styledMode) {
|
|
1615
|
+
symbol.attr({
|
|
1616
|
+
stroke: btnOptions.symbolStroke,
|
|
1617
|
+
fill: btnOptions.symbolFill,
|
|
1618
|
+
'stroke-width': btnOptions.symbolStrokeWidth || 1
|
|
1619
|
+
});
|
|
1468
1620
|
}
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1621
|
+
}
|
|
1622
|
+
button
|
|
1623
|
+
.add(chart.exportingGroup)
|
|
1624
|
+
.align(extend(btnOptions, {
|
|
1625
|
+
width: button.width,
|
|
1626
|
+
x: pick(btnOptions.x, chart.buttonOffset) // #1654
|
|
1627
|
+
}), true, 'spacingBox');
|
|
1628
|
+
chart.buttonOffset += ((button.width + btnOptions.buttonSpacing) *
|
|
1629
|
+
(btnOptions.align === 'right' ? -1 : 1));
|
|
1630
|
+
chart.exportSVGElements.push(button, symbol);
|
|
1631
|
+
}
|
|
1471
1632
|
/**
|
|
1472
|
-
*
|
|
1473
|
-
* a file name based on the chart title.
|
|
1633
|
+
* Clena up after printing a chart.
|
|
1474
1634
|
*
|
|
1475
|
-
* @function Highcharts
|
|
1635
|
+
* @function Highcharts#afterPrint
|
|
1476
1636
|
*
|
|
1477
|
-
* @
|
|
1637
|
+
* @private
|
|
1478
1638
|
*
|
|
1479
|
-
* @
|
|
1639
|
+
* @param {Highcharts.Chart} chart
|
|
1640
|
+
* Chart that was (or suppose to be) printed
|
|
1641
|
+
* @return {void}
|
|
1642
|
+
*
|
|
1643
|
+
* @fires Highcharts.Chart#event:afterPrint
|
|
1480
1644
|
*/
|
|
1481
|
-
|
|
1482
|
-
var
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
return filename.replace(/\//g, '-');
|
|
1486
|
-
}
|
|
1487
|
-
if (typeof s === 'string') {
|
|
1488
|
-
filename = s
|
|
1489
|
-
.toLowerCase()
|
|
1490
|
-
.replace(/<\/?[^>]+(>|$)/g, '') // strip HTML tags
|
|
1491
|
-
.replace(/[\s_]+/g, '-')
|
|
1492
|
-
.replace(/[^a-z0-9\-]/g, '') // preserve only latin
|
|
1493
|
-
.replace(/^[\-]+/g, '') // dashes in the start
|
|
1494
|
-
.replace(/[\-]+/g, '-') // dashes in a row
|
|
1495
|
-
.substr(0, 24)
|
|
1496
|
-
.replace(/[\-]+$/g, ''); // dashes in the end;
|
|
1645
|
+
function afterPrint() {
|
|
1646
|
+
var chart = this;
|
|
1647
|
+
if (!chart.printReverseInfo) {
|
|
1648
|
+
return void 0;
|
|
1497
1649
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1650
|
+
var _a = chart.printReverseInfo,
|
|
1651
|
+
childNodes = _a.childNodes,
|
|
1652
|
+
origDisplay = _a.origDisplay,
|
|
1653
|
+
resetParams = _a.resetParams;
|
|
1654
|
+
// put the chart back in
|
|
1655
|
+
chart.moveContainers(chart.renderTo);
|
|
1656
|
+
// restore all body content
|
|
1657
|
+
[].forEach.call(childNodes, function (node, i) {
|
|
1658
|
+
if (node.nodeType === 1) {
|
|
1659
|
+
node.style.display = (origDisplay[i] || '');
|
|
1660
|
+
}
|
|
1661
|
+
});
|
|
1662
|
+
chart.isPrinting = false;
|
|
1663
|
+
// Reset printMaxWidth
|
|
1664
|
+
if (resetParams) {
|
|
1665
|
+
chart.setSize.apply(chart, resetParams);
|
|
1500
1666
|
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1667
|
+
delete chart.printReverseInfo;
|
|
1668
|
+
printingChart = void 0;
|
|
1669
|
+
fireEvent(chart, 'afterPrint');
|
|
1670
|
+
}
|
|
1503
1671
|
/**
|
|
1504
|
-
*
|
|
1505
|
-
* along with some parameters for conversion.
|
|
1506
|
-
*
|
|
1507
|
-
* @sample highcharts/members/chart-exportchart/
|
|
1508
|
-
* Export with no options
|
|
1509
|
-
* @sample highcharts/members/chart-exportchart-filename/
|
|
1510
|
-
* PDF type and custom filename
|
|
1511
|
-
* @sample highcharts/members/chart-exportchart-custom-background/
|
|
1512
|
-
* Different chart background in export
|
|
1513
|
-
* @sample stock/members/chart-exportchart/
|
|
1514
|
-
* Export with Highcharts Stock
|
|
1515
|
-
*
|
|
1516
|
-
* @function Highcharts.Chart#exportChart
|
|
1672
|
+
* Prepare chart and document before printing a chart.
|
|
1517
1673
|
*
|
|
1518
|
-
* @
|
|
1519
|
-
* Exporting options in addition to those defined in
|
|
1520
|
-
* [exporting](https://api.highcharts.com/highcharts/exporting).
|
|
1674
|
+
* @function Highcharts#beforePrint
|
|
1521
1675
|
*
|
|
1522
|
-
* @
|
|
1523
|
-
* Additional chart options for the exported chart. For example a
|
|
1524
|
-
* different background color can be added here, or `dataLabels` for
|
|
1525
|
-
* export only.
|
|
1676
|
+
* @private
|
|
1526
1677
|
*
|
|
1527
1678
|
* @return {void}
|
|
1528
1679
|
*
|
|
1529
|
-
* @
|
|
1680
|
+
* @fires Highcharts.Chart#event:beforePrint
|
|
1530
1681
|
*/
|
|
1531
|
-
|
|
1532
|
-
var svg = this.getSVGForExport(exportingOptions,
|
|
1533
|
-
chartOptions);
|
|
1534
|
-
// merge the options
|
|
1535
|
-
exportingOptions = merge(this.options.exporting, exportingOptions);
|
|
1536
|
-
// do the post
|
|
1537
|
-
H.post(exportingOptions.url, {
|
|
1538
|
-
filename: exportingOptions.filename ? exportingOptions.filename.replace(/\//g, '-') : this.getFilename(),
|
|
1539
|
-
type: exportingOptions.type,
|
|
1540
|
-
// IE8 fails to post undefined correctly, so use 0
|
|
1541
|
-
width: exportingOptions.width || 0,
|
|
1542
|
-
scale: exportingOptions.scale,
|
|
1543
|
-
svg: svg
|
|
1544
|
-
}, exportingOptions.formAttributes);
|
|
1545
|
-
},
|
|
1546
|
-
/**
|
|
1547
|
-
* Move the chart container(s) to another div.
|
|
1548
|
-
*
|
|
1549
|
-
* @function Highcharts#moveContainers
|
|
1550
|
-
*
|
|
1551
|
-
* @private
|
|
1552
|
-
*
|
|
1553
|
-
* @param {Highcharts.HTMLDOMElement} moveTo
|
|
1554
|
-
* Move target
|
|
1555
|
-
* @return {void}
|
|
1556
|
-
*/
|
|
1557
|
-
moveContainers: function (moveTo) {
|
|
1558
|
-
var chart = this;
|
|
1559
|
-
(chart.fixedDiv ? // When scrollablePlotArea is active (#9533)
|
|
1560
|
-
[chart.fixedDiv, chart.scrollingContainer] :
|
|
1561
|
-
[chart.container]).forEach(function (div) {
|
|
1562
|
-
moveTo.appendChild(div);
|
|
1563
|
-
});
|
|
1564
|
-
},
|
|
1565
|
-
/**
|
|
1566
|
-
* Prepare chart and document before printing a chart.
|
|
1567
|
-
*
|
|
1568
|
-
* @function Highcharts#beforePrint
|
|
1569
|
-
*
|
|
1570
|
-
* @private
|
|
1571
|
-
*
|
|
1572
|
-
* @return {void}
|
|
1573
|
-
*
|
|
1574
|
-
* @fires Highcharts.Chart#event:beforePrint
|
|
1575
|
-
*/
|
|
1576
|
-
beforePrint: function () {
|
|
1682
|
+
function beforePrint() {
|
|
1577
1683
|
var chart = this,
|
|
1578
1684
|
body = doc.body,
|
|
1579
1685
|
printMaxWidth = chart.options.exporting.printMaxWidth,
|
|
@@ -1582,12 +1688,11 @@
|
|
|
1582
1688
|
origDisplay: [],
|
|
1583
1689
|
resetParams: void 0
|
|
1584
1690
|
};
|
|
1585
|
-
var handleMaxWidth;
|
|
1586
1691
|
chart.isPrinting = true;
|
|
1587
1692
|
chart.pointer.reset(null, 0);
|
|
1588
1693
|
fireEvent(chart, 'beforePrint');
|
|
1589
1694
|
// Handle printMaxWidth
|
|
1590
|
-
handleMaxWidth = printMaxWidth && chart.chartWidth > printMaxWidth;
|
|
1695
|
+
var handleMaxWidth = printMaxWidth && chart.chartWidth > printMaxWidth;
|
|
1591
1696
|
if (handleMaxWidth) {
|
|
1592
1697
|
printReverseInfo.resetParams = [
|
|
1593
1698
|
chart.options.chart.width,
|
|
@@ -1607,85 +1712,92 @@
|
|
|
1607
1712
|
chart.moveContainers(body);
|
|
1608
1713
|
// Storage details for undo action after printing
|
|
1609
1714
|
chart.printReverseInfo = printReverseInfo;
|
|
1610
|
-
}
|
|
1715
|
+
}
|
|
1611
1716
|
/**
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1717
|
+
* @private
|
|
1718
|
+
*/
|
|
1719
|
+
function chartCallback(chart) {
|
|
1720
|
+
var composition = chart;
|
|
1721
|
+
composition.renderExporting();
|
|
1722
|
+
addEvent(chart, 'redraw', composition.renderExporting);
|
|
1723
|
+
// Destroy the export elements at chart destroy
|
|
1724
|
+
addEvent(chart, 'destroy', composition.destroyExport);
|
|
1725
|
+
// Uncomment this to see a button directly below the chart, for quick
|
|
1726
|
+
// testing of export
|
|
1727
|
+
/*
|
|
1728
|
+
let button, viewImage, viewSource;
|
|
1729
|
+
if (!chart.renderer.forExport) {
|
|
1730
|
+
viewImage = function () {
|
|
1731
|
+
let div = doc.createElement('div');
|
|
1732
|
+
div.innerHTML = chart.getSVGForExport();
|
|
1733
|
+
chart.renderTo.parentNode.appendChild(div);
|
|
1734
|
+
};
|
|
1735
|
+
|
|
1736
|
+
viewSource = function () {
|
|
1737
|
+
let pre = doc.createElement('pre');
|
|
1738
|
+
pre.innerHTML = chart.getSVGForExport()
|
|
1739
|
+
.replace(/</g, '\n<')
|
|
1740
|
+
.replace(/>/g, '>');
|
|
1741
|
+
chart.renderTo.parentNode.appendChild(pre);
|
|
1742
|
+
};
|
|
1743
|
+
|
|
1744
|
+
viewImage();
|
|
1745
|
+
|
|
1746
|
+
// View SVG Image
|
|
1747
|
+
button = doc.createElement('button');
|
|
1748
|
+
button.innerHTML = 'View SVG Image';
|
|
1749
|
+
chart.renderTo.parentNode.appendChild(button);
|
|
1750
|
+
button.onclick = viewImage;
|
|
1751
|
+
|
|
1752
|
+
// View SVG Source
|
|
1753
|
+
button = doc.createElement('button');
|
|
1754
|
+
button.innerHTML = 'View SVG Source';
|
|
1755
|
+
chart.renderTo.parentNode.appendChild(button);
|
|
1756
|
+
button.onclick = viewSource;
|
|
1644
1757
|
}
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
fireEvent(chart, 'afterPrint');
|
|
1648
|
-
},
|
|
1758
|
+
//*/
|
|
1759
|
+
}
|
|
1649
1760
|
/**
|
|
1650
|
-
*
|
|
1651
|
-
* prints the chart as it is displayed. By default, when the exporting
|
|
1652
|
-
* module is enabled, a context button with a drop down menu in the upper
|
|
1653
|
-
* right corner accesses this function.
|
|
1654
|
-
*
|
|
1655
|
-
* @sample highcharts/members/chart-print/
|
|
1656
|
-
* Print from a HTML button
|
|
1657
|
-
*
|
|
1658
|
-
* @function Highcharts.Chart#print
|
|
1659
|
-
*
|
|
1660
|
-
* @return {void}
|
|
1661
|
-
*
|
|
1662
|
-
* @fires Highcharts.Chart#event:beforePrint
|
|
1663
|
-
* @fires Highcharts.Chart#event:afterPrint
|
|
1664
|
-
*
|
|
1665
|
-
* @requires modules/exporting
|
|
1761
|
+
* @private
|
|
1666
1762
|
*/
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
if (
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1763
|
+
function compose(ChartClass, SVGRendererClass) {
|
|
1764
|
+
ExportingSymbols.compose(SVGRendererClass);
|
|
1765
|
+
if (composedClasses.indexOf(ChartClass) === -1) {
|
|
1766
|
+
composedClasses.push(ChartClass);
|
|
1767
|
+
var chartProto = ChartClass.prototype;
|
|
1768
|
+
chartProto.afterPrint = afterPrint;
|
|
1769
|
+
chartProto.exportChart = exportChart;
|
|
1770
|
+
chartProto.inlineStyles = inlineStyles;
|
|
1771
|
+
chartProto.print = print;
|
|
1772
|
+
chartProto.sanitizeSVG = sanitizeSVG;
|
|
1773
|
+
chartProto.getChartHTML = getChartHTML;
|
|
1774
|
+
chartProto.getSVG = getSVG;
|
|
1775
|
+
chartProto.getSVGForExport = getSVGForExport;
|
|
1776
|
+
chartProto.getFilename = getFilename;
|
|
1777
|
+
chartProto.moveContainers = moveContainers;
|
|
1778
|
+
chartProto.beforePrint = beforePrint;
|
|
1779
|
+
chartProto.contextMenu = contextMenu;
|
|
1780
|
+
chartProto.addButton = addButton;
|
|
1781
|
+
chartProto.destroyExport = destroyExport;
|
|
1782
|
+
chartProto.renderExporting = renderExporting;
|
|
1783
|
+
chartProto.callbacks.push(chartCallback);
|
|
1784
|
+
addEvent(ChartClass, 'init', onChartInit);
|
|
1785
|
+
if (G.isSafari) {
|
|
1786
|
+
G.win.matchMedia('print').addListener(function (mqlEvent) {
|
|
1787
|
+
if (!printingChart) {
|
|
1788
|
+
return void 0;
|
|
1789
|
+
}
|
|
1790
|
+
if (mqlEvent.matches) {
|
|
1791
|
+
printingChart.beforePrint();
|
|
1792
|
+
}
|
|
1793
|
+
else {
|
|
1794
|
+
printingChart.afterPrint();
|
|
1795
|
+
}
|
|
1796
|
+
});
|
|
1686
1797
|
}
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
Exporting.compose = compose;
|
|
1689
1801
|
/**
|
|
1690
1802
|
* Display a popup menu for choosing the export type.
|
|
1691
1803
|
*
|
|
@@ -1706,17 +1818,16 @@
|
|
|
1706
1818
|
* @return {void}
|
|
1707
1819
|
* @requires modules/exporting
|
|
1708
1820
|
*/
|
|
1709
|
-
|
|
1821
|
+
function contextMenu(className, items, x, y, width, height, button) {
|
|
1710
1822
|
var chart = this,
|
|
1711
1823
|
navOptions = chart.options.navigation,
|
|
1712
1824
|
chartWidth = chart.chartWidth,
|
|
1713
1825
|
chartHeight = chart.chartHeight,
|
|
1714
1826
|
cacheName = 'cache-' + className,
|
|
1715
|
-
menu = chart[cacheName],
|
|
1716
1827
|
menuPadding = Math.max(width,
|
|
1717
|
-
height)
|
|
1718
|
-
innerMenu,
|
|
1719
|
-
|
|
1828
|
+
height); // for mouse leave detection
|
|
1829
|
+
var innerMenu,
|
|
1830
|
+
menu = chart[cacheName];
|
|
1720
1831
|
// create the menu only the first time
|
|
1721
1832
|
if (!menu) {
|
|
1722
1833
|
// create a HTML element above the SVG
|
|
@@ -1781,7 +1892,7 @@
|
|
|
1781
1892
|
if (isObject(item, true)) {
|
|
1782
1893
|
var element = void 0;
|
|
1783
1894
|
if (item.separator) {
|
|
1784
|
-
element = createElement('hr',
|
|
1895
|
+
element = createElement('hr', void 0, void 0, innerMenu);
|
|
1785
1896
|
}
|
|
1786
1897
|
else {
|
|
1787
1898
|
// When chart initialized with the table,
|
|
@@ -1801,166 +1912,54 @@
|
|
|
1801
1912
|
.apply(chart, arguments);
|
|
1802
1913
|
}
|
|
1803
1914
|
}
|
|
1804
|
-
},
|
|
1805
|
-
|
|
1806
|
-
chart.options.lang[item.textKey])
|
|
1915
|
+
}, void 0, innerMenu);
|
|
1916
|
+
AST.setElementHTML(element, item.text ||
|
|
1917
|
+
chart.options.lang[item.textKey]);
|
|
1807
1918
|
if (!chart.styledMode) {
|
|
1808
1919
|
element.onmouseover = function () {
|
|
1809
|
-
css(this, navOptions.menuItemHoverStyle);
|
|
1810
|
-
};
|
|
1811
|
-
element.onmouseout = function () {
|
|
1812
|
-
css(this, navOptions.menuItemStyle);
|
|
1813
|
-
};
|
|
1814
|
-
css(element, extend({
|
|
1815
|
-
cursor: 'pointer'
|
|
1816
|
-
}, navOptions.menuItemStyle));
|
|
1817
|
-
}
|
|
1818
|
-
}
|
|
1819
|
-
// Keep references to menu divs to be able to destroy them
|
|
1820
|
-
chart.exportDivElements.push(element);
|
|
1821
|
-
}
|
|
1822
|
-
});
|
|
1823
|
-
// Keep references to menu and innerMenu div to be able to destroy
|
|
1824
|
-
// them
|
|
1825
|
-
chart.exportDivElements.push(innerMenu, menu);
|
|
1826
|
-
chart.exportMenuWidth = menu.offsetWidth;
|
|
1827
|
-
chart.exportMenuHeight = menu.offsetHeight;
|
|
1828
|
-
}
|
|
1829
|
-
menuStyle = { display: 'block' };
|
|
1830
|
-
// if outside right, right align it
|
|
1831
|
-
if (x + chart.exportMenuWidth > chartWidth) {
|
|
1832
|
-
menuStyle.right = (chartWidth - x - width - menuPadding) + 'px';
|
|
1833
|
-
}
|
|
1834
|
-
else {
|
|
1835
|
-
menuStyle.left = (x - menuPadding) + 'px';
|
|
1836
|
-
}
|
|
1837
|
-
// if outside bottom, bottom align it
|
|
1838
|
-
if (y + height + chart.exportMenuHeight > chartHeight &&
|
|
1839
|
-
button.alignOptions.verticalAlign !== 'top') {
|
|
1840
|
-
menuStyle.bottom = (chartHeight - y - menuPadding) + 'px';
|
|
1841
|
-
}
|
|
1842
|
-
else {
|
|
1843
|
-
menuStyle.top = (y + height - menuPadding) + 'px';
|
|
1844
|
-
}
|
|
1845
|
-
css(menu, menuStyle);
|
|
1846
|
-
// #10361, #9998
|
|
1847
|
-
css(chart.renderTo, { overflow: '' });
|
|
1848
|
-
css(chart.container, { overflow: '' });
|
|
1849
|
-
chart.openMenu = true;
|
|
1850
|
-
fireEvent(chart, 'exportMenuShown');
|
|
1851
|
-
},
|
|
1852
|
-
/**
|
|
1853
|
-
* Add the export button to the chart, with options.
|
|
1854
|
-
*
|
|
1855
|
-
* @private
|
|
1856
|
-
* @function Highcharts.Chart#addButton
|
|
1857
|
-
* @param {Highcharts.NavigationButtonOptions} options
|
|
1858
|
-
* @return {void}
|
|
1859
|
-
* @requires modules/exporting
|
|
1860
|
-
*/
|
|
1861
|
-
addButton: function (options) {
|
|
1862
|
-
var chart = this,
|
|
1863
|
-
renderer = chart.renderer,
|
|
1864
|
-
btnOptions = merge(chart.options.navigation.buttonOptions,
|
|
1865
|
-
options),
|
|
1866
|
-
onclick = btnOptions.onclick,
|
|
1867
|
-
menuItems = btnOptions.menuItems,
|
|
1868
|
-
symbol,
|
|
1869
|
-
button,
|
|
1870
|
-
symbolSize = btnOptions.symbolSize || 12;
|
|
1871
|
-
if (!chart.btnCount) {
|
|
1872
|
-
chart.btnCount = 0;
|
|
1873
|
-
}
|
|
1874
|
-
// Keeps references to the button elements
|
|
1875
|
-
if (!chart.exportDivElements) {
|
|
1876
|
-
chart.exportDivElements = [];
|
|
1877
|
-
chart.exportSVGElements = [];
|
|
1878
|
-
}
|
|
1879
|
-
if (btnOptions.enabled === false || !btnOptions.theme) {
|
|
1880
|
-
return;
|
|
1881
|
-
}
|
|
1882
|
-
var attr = btnOptions.theme,
|
|
1883
|
-
states = attr.states,
|
|
1884
|
-
hover = states && states.hover,
|
|
1885
|
-
select = states && states.select,
|
|
1886
|
-
callback;
|
|
1887
|
-
if (!chart.styledMode) {
|
|
1888
|
-
attr.fill = pick(attr.fill, palette.backgroundColor);
|
|
1889
|
-
attr.stroke = pick(attr.stroke, 'none');
|
|
1890
|
-
}
|
|
1891
|
-
delete attr.states;
|
|
1892
|
-
if (onclick) {
|
|
1893
|
-
callback = function (e) {
|
|
1894
|
-
if (e) {
|
|
1895
|
-
e.stopPropagation();
|
|
1896
|
-
}
|
|
1897
|
-
onclick.call(chart, e);
|
|
1898
|
-
};
|
|
1899
|
-
}
|
|
1900
|
-
else if (menuItems) {
|
|
1901
|
-
callback = function (e) {
|
|
1902
|
-
// consistent with onclick call (#3495)
|
|
1903
|
-
if (e) {
|
|
1904
|
-
e.stopPropagation();
|
|
1920
|
+
css(this, navOptions.menuItemHoverStyle);
|
|
1921
|
+
};
|
|
1922
|
+
element.onmouseout = function () {
|
|
1923
|
+
css(this, navOptions.menuItemStyle);
|
|
1924
|
+
};
|
|
1925
|
+
css(element, extend({
|
|
1926
|
+
cursor: 'pointer'
|
|
1927
|
+
}, navOptions.menuItemStyle));
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
// Keep references to menu divs to be able to destroy them
|
|
1931
|
+
chart.exportDivElements.push(element);
|
|
1905
1932
|
}
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1933
|
+
});
|
|
1934
|
+
// Keep references to menu and innerMenu div to be able to destroy
|
|
1935
|
+
// them
|
|
1936
|
+
chart.exportDivElements.push(innerMenu, menu);
|
|
1937
|
+
chart.exportMenuWidth = menu.offsetWidth;
|
|
1938
|
+
chart.exportMenuHeight = menu.offsetHeight;
|
|
1909
1939
|
}
|
|
1910
|
-
|
|
1911
|
-
|
|
1940
|
+
var menuStyle = { display: 'block' };
|
|
1941
|
+
// if outside right, right align it
|
|
1942
|
+
if (x + chart.exportMenuWidth > chartWidth) {
|
|
1943
|
+
menuStyle.right = (chartWidth - x - width - menuPadding) + 'px';
|
|
1912
1944
|
}
|
|
1913
|
-
else
|
|
1914
|
-
|
|
1915
|
-
width: btnOptions.width,
|
|
1916
|
-
height: btnOptions.height,
|
|
1917
|
-
padding: 0
|
|
1918
|
-
});
|
|
1945
|
+
else {
|
|
1946
|
+
menuStyle.left = (x - menuPadding) + 'px';
|
|
1919
1947
|
}
|
|
1920
|
-
if
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1948
|
+
// if outside bottom, bottom align it
|
|
1949
|
+
if (y + height + chart.exportMenuHeight > chartHeight &&
|
|
1950
|
+
button.alignOptions.verticalAlign !== 'top') {
|
|
1951
|
+
menuStyle.bottom = (chartHeight - y - menuPadding) + 'px';
|
|
1924
1952
|
}
|
|
1925
|
-
|
|
1926
|
-
.
|
|
1927
|
-
.addClass(options.className)
|
|
1928
|
-
.attr({
|
|
1929
|
-
title: pick(chart.options.lang[btnOptions._titleKey || btnOptions.titleKey], '')
|
|
1930
|
-
});
|
|
1931
|
-
button.menuClassName = (options.menuClassName ||
|
|
1932
|
-
'highcharts-menu-' + chart.btnCount++);
|
|
1933
|
-
if (btnOptions.symbol) {
|
|
1934
|
-
symbol = renderer
|
|
1935
|
-
.symbol(btnOptions.symbol, btnOptions.symbolX - (symbolSize / 2), btnOptions.symbolY - (symbolSize / 2), symbolSize, symbolSize
|
|
1936
|
-
// If symbol is an image, scale it (#7957)
|
|
1937
|
-
, {
|
|
1938
|
-
width: symbolSize,
|
|
1939
|
-
height: symbolSize
|
|
1940
|
-
})
|
|
1941
|
-
.addClass('highcharts-button-symbol')
|
|
1942
|
-
.attr({
|
|
1943
|
-
zIndex: 1
|
|
1944
|
-
})
|
|
1945
|
-
.add(button);
|
|
1946
|
-
if (!chart.styledMode) {
|
|
1947
|
-
symbol.attr({
|
|
1948
|
-
stroke: btnOptions.symbolStroke,
|
|
1949
|
-
fill: btnOptions.symbolFill,
|
|
1950
|
-
'stroke-width': btnOptions.symbolStrokeWidth || 1
|
|
1951
|
-
});
|
|
1952
|
-
}
|
|
1953
|
+
else {
|
|
1954
|
+
menuStyle.top = (y + height - menuPadding) + 'px';
|
|
1953
1955
|
}
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
(btnOptions.align === 'right' ? -1 : 1));
|
|
1962
|
-
chart.exportSVGElements.push(button, symbol);
|
|
1963
|
-
},
|
|
1956
|
+
css(menu, menuStyle);
|
|
1957
|
+
// #10361, #9998
|
|
1958
|
+
css(chart.renderTo, { overflow: '' });
|
|
1959
|
+
css(chart.container, { overflow: '' });
|
|
1960
|
+
chart.openMenu = true;
|
|
1961
|
+
fireEvent(chart, 'exportMenuShown');
|
|
1962
|
+
}
|
|
1964
1963
|
/**
|
|
1965
1964
|
* Destroy the export buttons.
|
|
1966
1965
|
* @private
|
|
@@ -1969,12 +1968,12 @@
|
|
|
1969
1968
|
* @return {void}
|
|
1970
1969
|
* @requires modules/exporting
|
|
1971
1970
|
*/
|
|
1972
|
-
|
|
1971
|
+
function destroyExport(e) {
|
|
1973
1972
|
var chart = e ? e.target : this,
|
|
1974
1973
|
exportSVGElements = chart.exportSVGElements,
|
|
1975
1974
|
exportDivElements = chart.exportDivElements,
|
|
1976
|
-
exportEvents = chart.exportEvents
|
|
1977
|
-
|
|
1975
|
+
exportEvents = chart.exportEvents;
|
|
1976
|
+
var cacheName;
|
|
1978
1977
|
// Destroy the extra buttons added
|
|
1979
1978
|
if (exportSVGElements) {
|
|
1980
1979
|
exportSVGElements.forEach(function (elem, i) {
|
|
@@ -1985,7 +1984,7 @@
|
|
|
1985
1984
|
if (chart[cacheName]) {
|
|
1986
1985
|
delete chart[cacheName];
|
|
1987
1986
|
}
|
|
1988
|
-
|
|
1987
|
+
exportSVGElements[i] = elem.destroy();
|
|
1989
1988
|
}
|
|
1990
1989
|
});
|
|
1991
1990
|
exportSVGElements.length = 0;
|
|
@@ -1998,17 +1997,20 @@
|
|
|
1998
1997
|
// Destroy the divs for the menu
|
|
1999
1998
|
if (exportDivElements) {
|
|
2000
1999
|
exportDivElements.forEach(function (elem, i) {
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2000
|
+
if (elem) {
|
|
2001
|
+
// Remove the event handler
|
|
2002
|
+
U.clearTimeout(elem.hideTimer); // #5427
|
|
2003
|
+
removeEvent(elem, 'mouseleave');
|
|
2004
|
+
// Remove inline events
|
|
2005
|
+
// (chart.exportDivElements as any)[i] =
|
|
2006
|
+
exportDivElements[i] =
|
|
2007
|
+
elem.onmouseout =
|
|
2008
|
+
elem.onmouseover =
|
|
2009
|
+
elem.ontouchstart =
|
|
2010
|
+
elem.onclick = null;
|
|
2011
|
+
// Destroy the div by moving to garbage bin
|
|
2012
|
+
discardElement(elem);
|
|
2013
|
+
}
|
|
2012
2014
|
});
|
|
2013
2015
|
exportDivElements.length = 0;
|
|
2014
2016
|
}
|
|
@@ -2019,72 +2021,250 @@
|
|
|
2019
2021
|
exportEvents.length = 0;
|
|
2020
2022
|
}
|
|
2021
2023
|
}
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2024
|
+
/**
|
|
2025
|
+
* Exporting module required. Submit an SVG version of the chart to a server
|
|
2026
|
+
* along with some parameters for conversion.
|
|
2027
|
+
*
|
|
2028
|
+
* @sample highcharts/members/chart-exportchart/
|
|
2029
|
+
* Export with no options
|
|
2030
|
+
* @sample highcharts/members/chart-exportchart-filename/
|
|
2031
|
+
* PDF type and custom filename
|
|
2032
|
+
* @sample highcharts/members/chart-exportchart-custom-background/
|
|
2033
|
+
* Different chart background in export
|
|
2034
|
+
* @sample stock/members/chart-exportchart/
|
|
2035
|
+
* Export with Highcharts Stock
|
|
2036
|
+
*
|
|
2037
|
+
* @function Highcharts.Chart#exportChart
|
|
2038
|
+
*
|
|
2039
|
+
* @param {Highcharts.ExportingOptions} exportingOptions
|
|
2040
|
+
* Exporting options in addition to those defined in
|
|
2041
|
+
* [exporting](https://api.highcharts.com/highcharts/exporting).
|
|
2042
|
+
*
|
|
2043
|
+
* @param {Highcharts.Options} chartOptions
|
|
2044
|
+
* Additional chart options for the exported chart. For example a
|
|
2045
|
+
* different background color can be added here, or `dataLabels` for
|
|
2046
|
+
* export only.
|
|
2047
|
+
*
|
|
2048
|
+
* @requires modules/exporting
|
|
2049
|
+
*/
|
|
2050
|
+
function exportChart(exportingOptions, chartOptions) {
|
|
2051
|
+
var svg = this.getSVGForExport(exportingOptions,
|
|
2052
|
+
chartOptions);
|
|
2053
|
+
// merge the options
|
|
2054
|
+
exportingOptions = merge(this.options.exporting, exportingOptions);
|
|
2055
|
+
// do the post
|
|
2056
|
+
HU.post(exportingOptions.url, {
|
|
2057
|
+
filename: exportingOptions.filename ?
|
|
2058
|
+
exportingOptions.filename.replace(/\//g, '-') :
|
|
2059
|
+
this.getFilename(),
|
|
2060
|
+
type: exportingOptions.type,
|
|
2061
|
+
// IE8 fails to post undefined correctly, so use 0
|
|
2062
|
+
width: exportingOptions.width || 0,
|
|
2063
|
+
scale: exportingOptions.scale,
|
|
2064
|
+
svg: svg
|
|
2065
|
+
}, exportingOptions.formAttributes);
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Return the unfiltered innerHTML of the chart container. Used as hook for
|
|
2069
|
+
* plugins. In styled mode, it also takes care of inlining CSS style rules.
|
|
2070
|
+
*
|
|
2071
|
+
* @see Chart#getSVG
|
|
2072
|
+
*
|
|
2073
|
+
* @function Highcharts.Chart#getChartHTML
|
|
2074
|
+
*
|
|
2075
|
+
* @returns {string}
|
|
2076
|
+
* The unfiltered SVG of the chart.
|
|
2077
|
+
*
|
|
2078
|
+
* @requires modules/exporting
|
|
2079
|
+
*/
|
|
2080
|
+
function getChartHTML() {
|
|
2081
|
+
if (this.styledMode) {
|
|
2082
|
+
this.inlineStyles();
|
|
2083
|
+
}
|
|
2084
|
+
return this.container.innerHTML;
|
|
2085
|
+
}
|
|
2086
|
+
/**
|
|
2087
|
+
* Get the default file name used for exported charts. By default it creates
|
|
2088
|
+
* a file name based on the chart title.
|
|
2089
|
+
*
|
|
2090
|
+
* @function Highcharts.Chart#getFilename
|
|
2091
|
+
*
|
|
2092
|
+
* @return {string} A file name without extension.
|
|
2093
|
+
*
|
|
2094
|
+
* @requires modules/exporting
|
|
2095
|
+
*/
|
|
2096
|
+
function getFilename() {
|
|
2097
|
+
var s = this.userOptions.title && this.userOptions.title.text;
|
|
2098
|
+
var filename = this.options.exporting.filename;
|
|
2099
|
+
if (filename) {
|
|
2100
|
+
return filename.replace(/\//g, '-');
|
|
2101
|
+
}
|
|
2102
|
+
if (typeof s === 'string') {
|
|
2103
|
+
filename = s
|
|
2104
|
+
.toLowerCase()
|
|
2105
|
+
.replace(/<\/?[^>]+(>|$)/g, '') // strip HTML tags
|
|
2106
|
+
.replace(/[\s_]+/g, '-')
|
|
2107
|
+
.replace(/[^a-z0-9\-]/g, '') // preserve only latin
|
|
2108
|
+
.replace(/^[\-]+/g, '') // dashes in the start
|
|
2109
|
+
.replace(/[\-]+/g, '-') // dashes in a row
|
|
2110
|
+
.substr(0, 24)
|
|
2111
|
+
.replace(/[\-]+$/g, ''); // dashes in the end;
|
|
2112
|
+
}
|
|
2113
|
+
if (!filename || filename.length < 5) {
|
|
2114
|
+
filename = 'chart';
|
|
2115
|
+
}
|
|
2116
|
+
return filename;
|
|
2117
|
+
}
|
|
2118
|
+
/**
|
|
2119
|
+
* Return an SVG representation of the chart.
|
|
2120
|
+
*
|
|
2121
|
+
* @sample highcharts/members/chart-getsvg/
|
|
2122
|
+
* View the SVG from a button
|
|
2123
|
+
*
|
|
2124
|
+
* @function Highcharts.Chart#getSVG
|
|
2125
|
+
*
|
|
2126
|
+
* @param {Highcharts.Options} [chartOptions]
|
|
2127
|
+
* Additional chart options for the generated SVG representation. For
|
|
2128
|
+
* collections like `xAxis`, `yAxis` or `series`, the additional
|
|
2129
|
+
* options is either merged in to the original item of the same
|
|
2130
|
+
* `id`, or to the first item if a common id is not found.
|
|
2131
|
+
*
|
|
2132
|
+
* @return {string}
|
|
2133
|
+
* The SVG representation of the rendered chart.
|
|
2134
|
+
*
|
|
2135
|
+
* @fires Highcharts.Chart#event:getSVG
|
|
2136
|
+
*
|
|
2137
|
+
* @requires modules/exporting
|
|
2138
|
+
*/
|
|
2139
|
+
function getSVG(chartOptions) {
|
|
2140
|
+
var chart = this;
|
|
2141
|
+
var svg,
|
|
2142
|
+
seriesOptions,
|
|
2143
|
+
// Copy the options and add extra options
|
|
2144
|
+
options = merge(chart.options,
|
|
2145
|
+
chartOptions);
|
|
2146
|
+
// Use userOptions to make the options chain in series right (#3881)
|
|
2147
|
+
options.plotOptions = merge(chart.userOptions.plotOptions, chartOptions && chartOptions.plotOptions);
|
|
2148
|
+
// ... and likewise with time, avoid that undefined time properties are
|
|
2149
|
+
// merged over legacy global time options
|
|
2150
|
+
options.time = merge(chart.userOptions.time, chartOptions && chartOptions.time);
|
|
2151
|
+
// create a sandbox where a new chart will be generated
|
|
2152
|
+
var sandbox = createElement('div',
|
|
2153
|
+
null, {
|
|
2154
|
+
position: 'absolute',
|
|
2155
|
+
top: '-9999em',
|
|
2156
|
+
width: chart.chartWidth + 'px',
|
|
2157
|
+
height: chart.chartHeight + 'px'
|
|
2158
|
+
},
|
|
2159
|
+
doc.body);
|
|
2160
|
+
// get the source size
|
|
2161
|
+
var cssWidth = chart.renderTo.style.width,
|
|
2162
|
+
cssHeight = chart.renderTo.style.height,
|
|
2163
|
+
sourceWidth = options.exporting.sourceWidth ||
|
|
2164
|
+
options.chart.width ||
|
|
2165
|
+
(/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
|
|
2166
|
+
(options.isGantt ? 800 : 600),
|
|
2167
|
+
sourceHeight = options.exporting.sourceHeight ||
|
|
2168
|
+
options.chart.height ||
|
|
2169
|
+
(/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
|
|
2170
|
+
400;
|
|
2171
|
+
// override some options
|
|
2172
|
+
extend(options.chart, {
|
|
2173
|
+
animation: false,
|
|
2174
|
+
renderTo: sandbox,
|
|
2175
|
+
forExport: true,
|
|
2176
|
+
renderer: 'SVGRenderer',
|
|
2177
|
+
width: sourceWidth,
|
|
2178
|
+
height: sourceHeight
|
|
2179
|
+
});
|
|
2180
|
+
options.exporting.enabled = false; // hide buttons in print
|
|
2181
|
+
delete options.data; // #3004
|
|
2182
|
+
// prepare for replicating the chart
|
|
2183
|
+
options.series = [];
|
|
2184
|
+
chart.series.forEach(function (serie) {
|
|
2185
|
+
seriesOptions = merge(serie.userOptions, {
|
|
2186
|
+
animation: false,
|
|
2187
|
+
enableMouseTracking: false,
|
|
2188
|
+
showCheckbox: false,
|
|
2189
|
+
visible: serie.visible
|
|
2190
|
+
});
|
|
2191
|
+
// Used for the navigator series that has its own option set
|
|
2192
|
+
if (!seriesOptions.isInternal) {
|
|
2193
|
+
options.series.push(seriesOptions);
|
|
2194
|
+
}
|
|
2195
|
+
});
|
|
2196
|
+
var colls = {};
|
|
2197
|
+
chart.axes.forEach(function (axis) {
|
|
2198
|
+
// Assign an internal key to ensure a one-to-one mapping (#5924)
|
|
2199
|
+
if (!axis.userOptions.internalKey) { // #6444
|
|
2200
|
+
axis.userOptions.internalKey = uniqueKey();
|
|
2201
|
+
}
|
|
2202
|
+
if (!axis.options.isInternal) {
|
|
2203
|
+
if (!colls[axis.coll]) {
|
|
2204
|
+
colls[axis.coll] = true;
|
|
2205
|
+
options[axis.coll] = [];
|
|
2206
|
+
}
|
|
2207
|
+
options[axis.coll].push(merge(axis.userOptions, {
|
|
2208
|
+
visible: axis.visible
|
|
2209
|
+
}));
|
|
2210
|
+
}
|
|
2211
|
+
});
|
|
2212
|
+
// generate the chart copy
|
|
2213
|
+
var chartCopy = new Chart(options,
|
|
2214
|
+
chart.callback);
|
|
2215
|
+
// Axis options and series options (#2022, #3900, #5982)
|
|
2216
|
+
if (chartOptions) {
|
|
2217
|
+
['xAxis', 'yAxis', 'series'].forEach(function (coll) {
|
|
2218
|
+
var collOptions = {};
|
|
2219
|
+
if (chartOptions[coll]) {
|
|
2220
|
+
collOptions[coll] = chartOptions[coll];
|
|
2221
|
+
chartCopy.update(collOptions);
|
|
2222
|
+
}
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
// Reflect axis extremes in the export (#5924)
|
|
2226
|
+
chart.axes.forEach(function (axis) {
|
|
2227
|
+
var axisCopy = find(chartCopy.axes,
|
|
2228
|
+
function (copy) {
|
|
2229
|
+
return copy.options.internalKey ===
|
|
2230
|
+
axis.userOptions.internalKey;
|
|
2231
|
+
}), extremes = axis.getExtremes(), userMin = extremes.userMin, userMax = extremes.userMax;
|
|
2232
|
+
if (axisCopy &&
|
|
2233
|
+
((typeof userMin !== 'undefined' &&
|
|
2234
|
+
userMin !== axisCopy.min) || (typeof userMax !== 'undefined' &&
|
|
2235
|
+
userMax !== axisCopy.max))) {
|
|
2236
|
+
axisCopy.setExtremes(userMin, userMax, true, false);
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
// Get the SVG from the container's innerHTML
|
|
2240
|
+
svg = chartCopy.getChartHTML();
|
|
2241
|
+
fireEvent(this, 'getSVG', { chartCopy: chartCopy });
|
|
2242
|
+
svg = chart.sanitizeSVG(svg, options);
|
|
2243
|
+
// free up memory
|
|
2244
|
+
options = null;
|
|
2245
|
+
chartCopy.destroy();
|
|
2246
|
+
discardElement(sandbox);
|
|
2247
|
+
return svg;
|
|
2248
|
+
}
|
|
2249
|
+
/**
|
|
2250
|
+
* @private
|
|
2251
|
+
* @function Highcharts.Chart#getSVGForExport
|
|
2252
|
+
* @param {Highcharts.ExportingOptions} options
|
|
2253
|
+
* @param {Highcharts.Options} chartOptions
|
|
2254
|
+
* @return {string}
|
|
2255
|
+
* @requires modules/exporting
|
|
2256
|
+
*/
|
|
2257
|
+
function getSVGForExport(options, chartOptions) {
|
|
2258
|
+
var chartExportingOptions = this.options.exporting;
|
|
2259
|
+
return this.getSVG(merge({ chart: { borderRadius: 0 } }, chartExportingOptions.chartOptions, chartOptions, {
|
|
2260
|
+
exporting: {
|
|
2261
|
+
sourceWidth: ((options && options.sourceWidth) ||
|
|
2262
|
+
chartExportingOptions.sourceWidth),
|
|
2263
|
+
sourceHeight: ((options && options.sourceHeight) ||
|
|
2264
|
+
chartExportingOptions.sourceHeight)
|
|
2265
|
+
}
|
|
2266
|
+
}));
|
|
2267
|
+
}
|
|
2088
2268
|
/**
|
|
2089
2269
|
* Make hyphenated property names out of camelCase
|
|
2090
2270
|
* @private
|
|
@@ -2099,273 +2279,377 @@
|
|
|
2099
2279
|
});
|
|
2100
2280
|
}
|
|
2101
2281
|
/**
|
|
2102
|
-
*
|
|
2282
|
+
* Analyze inherited styles from stylesheets and add them inline
|
|
2283
|
+
*
|
|
2103
2284
|
* @private
|
|
2104
|
-
* @
|
|
2105
|
-
* Element child
|
|
2285
|
+
* @function Highcharts.Chart#inlineStyles
|
|
2106
2286
|
* @return {void}
|
|
2287
|
+
*
|
|
2288
|
+
* @todo: What are the border styles for text about? In general, text has a
|
|
2289
|
+
* lot of properties.
|
|
2290
|
+
* @todo: Make it work with IE9 and IE10.
|
|
2291
|
+
*
|
|
2292
|
+
* @requires modules/exporting
|
|
2107
2293
|
*/
|
|
2108
|
-
function
|
|
2109
|
-
var
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2294
|
+
function inlineStyles() {
|
|
2295
|
+
var blacklist = inlineBlacklist,
|
|
2296
|
+
whitelist = Exporting.inlineWhitelist, // For IE
|
|
2297
|
+
defaultStyles = {};
|
|
2298
|
+
var dummySVG;
|
|
2299
|
+
// Create an iframe where we read default styles without pollution from
|
|
2300
|
+
// this body
|
|
2301
|
+
var iframe = doc.createElement('iframe');
|
|
2302
|
+
css(iframe, {
|
|
2303
|
+
width: '1px',
|
|
2304
|
+
height: '1px',
|
|
2305
|
+
visibility: 'hidden'
|
|
2306
|
+
});
|
|
2307
|
+
doc.body.appendChild(iframe);
|
|
2308
|
+
var iframeDoc = iframe.contentWindow.document;
|
|
2309
|
+
iframeDoc.open();
|
|
2310
|
+
iframeDoc.write('<svg xmlns="http://www.w3.org/2000/svg"></svg>');
|
|
2311
|
+
iframeDoc.close();
|
|
2117
2312
|
/**
|
|
2118
|
-
*
|
|
2119
|
-
* styles or atttributes.
|
|
2313
|
+
* Call this on all elements and recurse to children
|
|
2120
2314
|
* @private
|
|
2121
|
-
* @param {
|
|
2122
|
-
*
|
|
2123
|
-
* @param {string} prop
|
|
2124
|
-
* Style property name
|
|
2315
|
+
* @param {Highcharts.HTMLDOMElement} node
|
|
2316
|
+
* Element child
|
|
2125
2317
|
* @return {void}
|
|
2126
2318
|
*/
|
|
2127
|
-
function
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2319
|
+
function recurse(node) {
|
|
2320
|
+
var styles,
|
|
2321
|
+
parentStyles,
|
|
2322
|
+
cssText = '',
|
|
2323
|
+
dummy,
|
|
2324
|
+
styleAttr,
|
|
2325
|
+
blacklisted,
|
|
2326
|
+
whitelisted,
|
|
2327
|
+
i;
|
|
2328
|
+
/**
|
|
2329
|
+
* Check computed styles and whether they are in the white/blacklist
|
|
2330
|
+
* for styles or atttributes.
|
|
2331
|
+
* @private
|
|
2332
|
+
* @param {string} val
|
|
2333
|
+
* Style value
|
|
2334
|
+
* @param {string} prop
|
|
2335
|
+
* Style property name
|
|
2336
|
+
* @return {void}
|
|
2337
|
+
*/
|
|
2338
|
+
function filterStyles(val, prop) {
|
|
2339
|
+
// Check against whitelist & blacklist
|
|
2340
|
+
blacklisted = whitelisted = false;
|
|
2341
|
+
if (whitelist.length) {
|
|
2342
|
+
// Styled mode in IE has a whitelist instead.
|
|
2343
|
+
// Exclude all props not in this list.
|
|
2344
|
+
i = whitelist.length;
|
|
2345
|
+
while (i-- && !whitelisted) {
|
|
2346
|
+
whitelisted = whitelist[i].test(prop);
|
|
2347
|
+
}
|
|
2348
|
+
blacklisted = !whitelisted;
|
|
2136
2349
|
}
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2350
|
+
// Explicitly remove empty transforms
|
|
2351
|
+
if (prop === 'transform' && val === 'none') {
|
|
2352
|
+
blacklisted = true;
|
|
2353
|
+
}
|
|
2354
|
+
i = blacklist.length;
|
|
2355
|
+
while (i-- && !blacklisted) {
|
|
2356
|
+
blacklisted = (blacklist[i].test(prop) ||
|
|
2357
|
+
typeof val === 'function');
|
|
2358
|
+
}
|
|
2359
|
+
if (!blacklisted) {
|
|
2360
|
+
// If parent node has the same style, it gets inherited, no
|
|
2361
|
+
// need to inline it. Top-level props should be diffed
|
|
2362
|
+
// against parent (#7687).
|
|
2363
|
+
if ((parentStyles[prop] !== val ||
|
|
2364
|
+
node.nodeName === 'svg') &&
|
|
2365
|
+
defaultStyles[node.nodeName][prop] !== val) {
|
|
2366
|
+
// Attributes
|
|
2367
|
+
if (!inlineToAttributes ||
|
|
2368
|
+
inlineToAttributes.indexOf(prop) !== -1) {
|
|
2369
|
+
if (val) {
|
|
2370
|
+
node.setAttribute(hyphenate(prop), val);
|
|
2371
|
+
}
|
|
2372
|
+
// Styles
|
|
2373
|
+
}
|
|
2374
|
+
else {
|
|
2375
|
+
cssText += hyphenate(prop) + ':' + val + ';';
|
|
2160
2376
|
}
|
|
2161
|
-
// Styles
|
|
2162
|
-
}
|
|
2163
|
-
else {
|
|
2164
|
-
cssText += hyphenate(prop) + ':' + val + ';';
|
|
2165
2377
|
}
|
|
2166
2378
|
}
|
|
2167
2379
|
}
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2380
|
+
if (node.nodeType === 1 &&
|
|
2381
|
+
unstyledElements.indexOf(node.nodeName) === -1) {
|
|
2382
|
+
styles = win.getComputedStyle(node, null);
|
|
2383
|
+
parentStyles = node.nodeName === 'svg' ?
|
|
2384
|
+
{} :
|
|
2385
|
+
win.getComputedStyle(node.parentNode, null);
|
|
2386
|
+
// Get default styles from the browser so that we don't have to
|
|
2387
|
+
// add these
|
|
2388
|
+
if (!defaultStyles[node.nodeName]) {
|
|
2389
|
+
/*
|
|
2390
|
+
if (!dummySVG) {
|
|
2391
|
+
dummySVG = doc.createElementNS(H.SVG_NS, 'svg');
|
|
2392
|
+
dummySVG.setAttribute('version', '1.1');
|
|
2393
|
+
doc.body.appendChild(dummySVG);
|
|
2394
|
+
}
|
|
2395
|
+
*/
|
|
2396
|
+
dummySVG = iframeDoc.getElementsByTagName('svg')[0];
|
|
2397
|
+
dummy = iframeDoc.createElementNS(node.namespaceURI, node.nodeName);
|
|
2398
|
+
dummySVG.appendChild(dummy);
|
|
2399
|
+
// Copy, so we can remove the node
|
|
2400
|
+
defaultStyles[node.nodeName] = merge(win.getComputedStyle(dummy, null));
|
|
2401
|
+
// Remove default fill, otherwise text disappears when
|
|
2402
|
+
// exported
|
|
2403
|
+
if (node.nodeName === 'text') {
|
|
2404
|
+
delete defaultStyles.text.fill;
|
|
2405
|
+
}
|
|
2406
|
+
dummySVG.removeChild(dummy);
|
|
2183
2407
|
}
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
// Remove default fill, otherwise text disappears when exported
|
|
2191
|
-
if (node.nodeName === 'text') {
|
|
2192
|
-
delete defaultStyles.text.fill;
|
|
2408
|
+
// Loop through all styles and add them inline if they are ok
|
|
2409
|
+
if (G.isFirefox || G.isMS) {
|
|
2410
|
+
// Some browsers put lots of styles on the prototype
|
|
2411
|
+
for (var p in styles) { // eslint-disable-line guard-for-in
|
|
2412
|
+
filterStyles(styles[p], p);
|
|
2413
|
+
}
|
|
2193
2414
|
}
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
// Loop through all styles and add them inline if they are ok
|
|
2197
|
-
if (H.isFirefox || H.isMS) {
|
|
2198
|
-
// Some browsers put lots of styles on the prototype
|
|
2199
|
-
for (var p in styles) { // eslint-disable-line guard-for-in
|
|
2200
|
-
filterStyles(styles[p], p);
|
|
2415
|
+
else {
|
|
2416
|
+
objectEach(styles, filterStyles);
|
|
2201
2417
|
}
|
|
2418
|
+
// Apply styles
|
|
2419
|
+
if (cssText) {
|
|
2420
|
+
styleAttr = node.getAttribute('style');
|
|
2421
|
+
node.setAttribute('style', (styleAttr ? styleAttr + ';' : '') + cssText);
|
|
2422
|
+
}
|
|
2423
|
+
// Set default stroke width (needed at least for IE)
|
|
2424
|
+
if (node.nodeName === 'svg') {
|
|
2425
|
+
node.setAttribute('stroke-width', '1px');
|
|
2426
|
+
}
|
|
2427
|
+
if (node.nodeName === 'text') {
|
|
2428
|
+
return;
|
|
2429
|
+
}
|
|
2430
|
+
// Recurse
|
|
2431
|
+
[].forEach.call(node.children || node.childNodes, recurse);
|
|
2202
2432
|
}
|
|
2203
|
-
else {
|
|
2204
|
-
objectEach(styles, filterStyles);
|
|
2205
|
-
}
|
|
2206
|
-
// Apply styles
|
|
2207
|
-
if (cssText) {
|
|
2208
|
-
styleAttr = node.getAttribute('style');
|
|
2209
|
-
node.setAttribute('style', (styleAttr ? styleAttr + ';' : '') + cssText);
|
|
2210
|
-
}
|
|
2211
|
-
// Set default stroke width (needed at least for IE)
|
|
2212
|
-
if (node.nodeName === 'svg') {
|
|
2213
|
-
node.setAttribute('stroke-width', '1px');
|
|
2214
|
-
}
|
|
2215
|
-
if (node.nodeName === 'text') {
|
|
2216
|
-
return;
|
|
2217
|
-
}
|
|
2218
|
-
// Recurse
|
|
2219
|
-
[].forEach.call(node.children || node.childNodes, recurse);
|
|
2220
2433
|
}
|
|
2434
|
+
/**
|
|
2435
|
+
* Remove the dummy objects used to get defaults
|
|
2436
|
+
* @private
|
|
2437
|
+
* @return {void}
|
|
2438
|
+
*/
|
|
2439
|
+
function tearDown() {
|
|
2440
|
+
dummySVG.parentNode.removeChild(dummySVG);
|
|
2441
|
+
// Remove trash from DOM that stayed after each exporting
|
|
2442
|
+
iframe.parentNode.removeChild(iframe);
|
|
2443
|
+
}
|
|
2444
|
+
recurse(this.container.querySelector('svg'));
|
|
2445
|
+
tearDown();
|
|
2221
2446
|
}
|
|
2222
2447
|
/**
|
|
2223
|
-
*
|
|
2448
|
+
* Move the chart container(s) to another div.
|
|
2449
|
+
*
|
|
2450
|
+
* @function Highcharts#moveContainers
|
|
2451
|
+
*
|
|
2224
2452
|
* @private
|
|
2453
|
+
*
|
|
2454
|
+
* @param {Highcharts.HTMLDOMElement} moveTo
|
|
2455
|
+
* Move target
|
|
2225
2456
|
* @return {void}
|
|
2226
2457
|
*/
|
|
2227
|
-
function
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2458
|
+
function moveContainers(moveTo) {
|
|
2459
|
+
var chart = this;
|
|
2460
|
+
(chart.fixedDiv ? // When scrollablePlotArea is active (#9533)
|
|
2461
|
+
[chart.fixedDiv, chart.scrollingContainer] :
|
|
2462
|
+
[chart.container]).forEach(function (div) {
|
|
2463
|
+
moveTo.appendChild(div);
|
|
2464
|
+
});
|
|
2231
2465
|
}
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
Chart.prototype.renderExporting = function () {
|
|
2272
|
-
var chart = this,
|
|
2273
|
-
exportingOptions = chart.options.exporting,
|
|
2274
|
-
buttons = exportingOptions.buttons,
|
|
2275
|
-
isDirty = chart.isDirtyExporting || !chart.exportSVGElements;
|
|
2276
|
-
chart.buttonOffset = 0;
|
|
2277
|
-
if (chart.isDirtyExporting) {
|
|
2278
|
-
chart.destroyExport();
|
|
2466
|
+
/**
|
|
2467
|
+
* Add update methods to handle chart.update and chart.exporting.update and
|
|
2468
|
+
* chart.navigation.update. These must be added to the chart instance rather
|
|
2469
|
+
* than the Chart prototype in order to use the chart instance inside the
|
|
2470
|
+
* update function.
|
|
2471
|
+
* @private
|
|
2472
|
+
*/
|
|
2473
|
+
function onChartInit() {
|
|
2474
|
+
var chart = this,
|
|
2475
|
+
/**
|
|
2476
|
+
* @private
|
|
2477
|
+
* @param {"exporting"|"navigation"} prop
|
|
2478
|
+
* Property name in option root
|
|
2479
|
+
* @param {Highcharts.ExportingOptions|Highcharts.NavigationOptions} options
|
|
2480
|
+
* Options to update
|
|
2481
|
+
* @param {boolean} [redraw=true]
|
|
2482
|
+
* Whether to redraw
|
|
2483
|
+
* @return {void}
|
|
2484
|
+
*/
|
|
2485
|
+
update = function (prop,
|
|
2486
|
+
options,
|
|
2487
|
+
redraw) {
|
|
2488
|
+
chart.isDirtyExporting = true;
|
|
2489
|
+
merge(true, chart.options[prop], options);
|
|
2490
|
+
if (pick(redraw, true)) {
|
|
2491
|
+
chart.redraw();
|
|
2492
|
+
}
|
|
2493
|
+
};
|
|
2494
|
+
chart.exporting = {
|
|
2495
|
+
update: function (options, redraw) {
|
|
2496
|
+
update('exporting', options, redraw);
|
|
2497
|
+
}
|
|
2498
|
+
};
|
|
2499
|
+
// Register update() method for navigation. Can not be set the same way
|
|
2500
|
+
// as for exporting, because navigation options are shared with bindings
|
|
2501
|
+
// which has separate update() logic.
|
|
2502
|
+
chartNavigationMixin.addUpdate(function (options, redraw) {
|
|
2503
|
+
update('navigation', options, redraw);
|
|
2504
|
+
}, chart);
|
|
2279
2505
|
}
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2506
|
+
/**
|
|
2507
|
+
* Exporting module required. Clears away other elements in the page and
|
|
2508
|
+
* prints the chart as it is displayed. By default, when the exporting
|
|
2509
|
+
* module is enabled, a context button with a drop down menu in the upper
|
|
2510
|
+
* right corner accesses this function.
|
|
2511
|
+
*
|
|
2512
|
+
* @sample highcharts/members/chart-print/
|
|
2513
|
+
* Print from a HTML button
|
|
2514
|
+
*
|
|
2515
|
+
* @function Highcharts.Chart#print
|
|
2516
|
+
*
|
|
2517
|
+
* @return {void}
|
|
2518
|
+
*
|
|
2519
|
+
* @fires Highcharts.Chart#event:beforePrint
|
|
2520
|
+
* @fires Highcharts.Chart#event:afterPrint
|
|
2521
|
+
*
|
|
2522
|
+
* @requires modules/exporting
|
|
2523
|
+
*/
|
|
2524
|
+
function print() {
|
|
2525
|
+
var chart = this;
|
|
2526
|
+
if (chart.isPrinting) { // block the button while in printing mode
|
|
2527
|
+
return;
|
|
2528
|
+
}
|
|
2529
|
+
printingChart = chart;
|
|
2530
|
+
if (!G.isSafari) {
|
|
2531
|
+
chart.beforePrint();
|
|
2532
|
+
}
|
|
2533
|
+
// Give the browser time to draw WebGL content, an issue that randomly
|
|
2534
|
+
// appears (at least) in Chrome ~67 on the Mac (#8708).
|
|
2535
|
+
setTimeout(function () {
|
|
2536
|
+
win.focus(); // #1510
|
|
2537
|
+
win.print();
|
|
2538
|
+
// allow the browser to prepare before reverting
|
|
2539
|
+
if (!G.isSafari) {
|
|
2540
|
+
setTimeout(function () {
|
|
2541
|
+
chart.afterPrint();
|
|
2542
|
+
}, 1000);
|
|
2543
|
+
}
|
|
2544
|
+
}, 1);
|
|
2290
2545
|
}
|
|
2291
|
-
};
|
|
2292
|
-
/* eslint-disable no-invalid-this */
|
|
2293
|
-
// Add update methods to handle chart.update and chart.exporting.update and
|
|
2294
|
-
// chart.navigation.update. These must be added to the chart instance rather
|
|
2295
|
-
// than the Chart prototype in order to use the chart instance inside the update
|
|
2296
|
-
// function.
|
|
2297
|
-
addEvent(Chart, 'init', function () {
|
|
2298
|
-
var chart = this;
|
|
2299
2546
|
/**
|
|
2547
|
+
* Add the buttons on chart load
|
|
2300
2548
|
* @private
|
|
2301
|
-
* @
|
|
2302
|
-
* Property name in option root
|
|
2303
|
-
* @param {Highcharts.ExportingOptions|Highcharts.NavigationOptions} options
|
|
2304
|
-
* Options to update
|
|
2305
|
-
* @param {boolean} [redraw=true]
|
|
2306
|
-
* Whether to redraw
|
|
2549
|
+
* @function Highcharts.Chart#renderExporting
|
|
2307
2550
|
* @return {void}
|
|
2551
|
+
* @requires modules/exporting
|
|
2308
2552
|
*/
|
|
2309
|
-
function
|
|
2310
|
-
chart
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
chart.
|
|
2553
|
+
function renderExporting() {
|
|
2554
|
+
var chart = this,
|
|
2555
|
+
exportingOptions = chart.options.exporting,
|
|
2556
|
+
buttons = exportingOptions.buttons,
|
|
2557
|
+
isDirty = chart.isDirtyExporting || !chart.exportSVGElements;
|
|
2558
|
+
chart.buttonOffset = 0;
|
|
2559
|
+
if (chart.isDirtyExporting) {
|
|
2560
|
+
chart.destroyExport();
|
|
2561
|
+
}
|
|
2562
|
+
if (isDirty && exportingOptions.enabled !== false) {
|
|
2563
|
+
chart.exportEvents = [];
|
|
2564
|
+
chart.exportingGroup = chart.exportingGroup ||
|
|
2565
|
+
chart.renderer.g('exporting-group').attr({
|
|
2566
|
+
zIndex: 3 // #4955, // #8392
|
|
2567
|
+
}).add();
|
|
2568
|
+
objectEach(buttons, function (button) {
|
|
2569
|
+
chart.addButton(button);
|
|
2570
|
+
});
|
|
2571
|
+
chart.isDirtyExporting = false;
|
|
2314
2572
|
}
|
|
2315
2573
|
}
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2574
|
+
/**
|
|
2575
|
+
* Exporting module only. A collection of fixes on the produced SVG to
|
|
2576
|
+
* account for expando properties, browser bugs, VML problems and other.
|
|
2577
|
+
* Returns a cleaned SVG.
|
|
2578
|
+
*
|
|
2579
|
+
* @private
|
|
2580
|
+
* @function Highcharts.Chart#sanitizeSVG
|
|
2581
|
+
* @param {string} svg
|
|
2582
|
+
* SVG code to sanitize
|
|
2583
|
+
* @param {Highcharts.Options} options
|
|
2584
|
+
* Chart options to apply
|
|
2585
|
+
* @return {string}
|
|
2586
|
+
* Sanitized SVG code
|
|
2587
|
+
* @requires modules/exporting
|
|
2588
|
+
*/
|
|
2589
|
+
function sanitizeSVG(svg, options) {
|
|
2590
|
+
var split = svg.indexOf('</svg>') + 6;
|
|
2591
|
+
var html = svg.substr(split);
|
|
2592
|
+
// Remove any HTML added to the container after the SVG (#894, #9087)
|
|
2593
|
+
svg = svg.substr(0, split);
|
|
2594
|
+
// Move HTML into a foreignObject
|
|
2595
|
+
if (options && options.exporting && options.exporting.allowHTML) {
|
|
2596
|
+
if (html) {
|
|
2597
|
+
html = '<foreignObject x="0" y="0" ' +
|
|
2598
|
+
'width="' + options.chart.width + '" ' +
|
|
2599
|
+
'height="' + options.chart.height + '">' +
|
|
2600
|
+
'<body xmlns="http://www.w3.org/1999/xhtml">' +
|
|
2601
|
+
// Some tags needs to be closed in xhtml (#13726)
|
|
2602
|
+
html.replace(/(<(?:img|br).*?(?=\>))>/g, '$1 />') +
|
|
2603
|
+
'</body>' +
|
|
2604
|
+
'</foreignObject>';
|
|
2605
|
+
svg = svg.replace('</svg>', html + '</svg>');
|
|
2606
|
+
}
|
|
2319
2607
|
}
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
let div = doc.createElement('div');
|
|
2341
|
-
div.innerHTML = chart.getSVGForExport();
|
|
2342
|
-
chart.renderTo.parentNode.appendChild(div);
|
|
2343
|
-
};
|
|
2344
|
-
|
|
2345
|
-
viewSource = function () {
|
|
2346
|
-
let pre = doc.createElement('pre');
|
|
2347
|
-
pre.innerHTML = chart.getSVGForExport()
|
|
2348
|
-
.replace(/</g, '\n<')
|
|
2349
|
-
.replace(/>/g, '>');
|
|
2350
|
-
chart.renderTo.parentNode.appendChild(pre);
|
|
2351
|
-
};
|
|
2352
|
-
|
|
2353
|
-
viewImage();
|
|
2354
|
-
|
|
2355
|
-
// View SVG Image
|
|
2356
|
-
button = doc.createElement('button');
|
|
2357
|
-
button.innerHTML = 'View SVG Image';
|
|
2358
|
-
chart.renderTo.parentNode.appendChild(button);
|
|
2359
|
-
button.onclick = viewImage;
|
|
2360
|
-
|
|
2361
|
-
// View SVG Source
|
|
2362
|
-
button = doc.createElement('button');
|
|
2363
|
-
button.innerHTML = 'View SVG Source';
|
|
2364
|
-
chart.renderTo.parentNode.appendChild(button);
|
|
2365
|
-
button.onclick = viewSource;
|
|
2608
|
+
svg = svg
|
|
2609
|
+
.replace(/zIndex="[^"]+"/g, '')
|
|
2610
|
+
.replace(/symbolName="[^"]+"/g, '')
|
|
2611
|
+
.replace(/jQuery[0-9]+="[^"]+"/g, '')
|
|
2612
|
+
.replace(/url\(("|")(.*?)("|")\;?\)/g, 'url($2)')
|
|
2613
|
+
.replace(/url\([^#]+#/g, 'url(#')
|
|
2614
|
+
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
|
|
2615
|
+
.replace(/ (|NS[0-9]+\:)href=/g, ' xlink:href=') // #3567
|
|
2616
|
+
.replace(/\n/, ' ')
|
|
2617
|
+
// Batik doesn't support rgba fills and strokes (#3095)
|
|
2618
|
+
.replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, // eslint-disable-line max-len
|
|
2619
|
+
'$1="rgb($2)" $1-opacity="$3"')
|
|
2620
|
+
// Replace HTML entities, issue #347
|
|
2621
|
+
.replace(/ /g, '\u00A0') // no-break space
|
|
2622
|
+
.replace(/­/g, '\u00AD'); // soft hyphen
|
|
2623
|
+
// Further sanitize for oldIE
|
|
2624
|
+
if (this.ieSanitizeSVG) {
|
|
2625
|
+
svg = this.ieSanitizeSVG(svg);
|
|
2626
|
+
}
|
|
2627
|
+
return svg;
|
|
2366
2628
|
}
|
|
2367
|
-
|
|
2368
|
-
|
|
2629
|
+
})(Exporting || (Exporting = {}));
|
|
2630
|
+
/* *
|
|
2631
|
+
*
|
|
2632
|
+
* Registry
|
|
2633
|
+
*
|
|
2634
|
+
* */
|
|
2635
|
+
defaultOptions.exporting = merge(ExportingDefaults.exporting, defaultOptions.exporting);
|
|
2636
|
+
defaultOptions.lang = merge(ExportingDefaults.lang, defaultOptions.lang);
|
|
2637
|
+
// Buttons and menus are collected in a separate config option set called
|
|
2638
|
+
// 'navigation'. This can be extended later to add control buttons like
|
|
2639
|
+
// zoom and pan right click menus.
|
|
2640
|
+
/**
|
|
2641
|
+
* A collection of options for buttons and menus appearing in the exporting
|
|
2642
|
+
* module.
|
|
2643
|
+
*
|
|
2644
|
+
* @requires modules/exporting
|
|
2645
|
+
* @optionparent navigation
|
|
2646
|
+
*/
|
|
2647
|
+
defaultOptions.navigation = merge(ExportingDefaults.navigation, defaultOptions.navigation);
|
|
2648
|
+
/* *
|
|
2649
|
+
*
|
|
2650
|
+
* Default Export
|
|
2651
|
+
*
|
|
2652
|
+
* */
|
|
2369
2653
|
/* *
|
|
2370
2654
|
*
|
|
2371
2655
|
* API Declarations
|
|
@@ -2438,10 +2722,49 @@
|
|
|
2438
2722
|
* @typedef {"image/png"|"image/jpeg"|"application/pdf"|"image/svg+xml"} Highcharts.ExportingMimeTypeValue
|
|
2439
2723
|
*/
|
|
2440
2724
|
(''); // keeps doclets above in transpiled file
|
|
2725
|
+
/* *
|
|
2726
|
+
*
|
|
2727
|
+
* API Options
|
|
2728
|
+
*
|
|
2729
|
+
* */
|
|
2730
|
+
/**
|
|
2731
|
+
* Fires after a chart is printed through the context menu item or the
|
|
2732
|
+
* `Chart.print` method.
|
|
2733
|
+
*
|
|
2734
|
+
* @sample highcharts/chart/events-beforeprint-afterprint/
|
|
2735
|
+
* Rescale the chart to print
|
|
2736
|
+
*
|
|
2737
|
+
* @type {Highcharts.ExportingAfterPrintCallbackFunction}
|
|
2738
|
+
* @since 4.1.0
|
|
2739
|
+
* @context Highcharts.Chart
|
|
2740
|
+
* @requires modules/exporting
|
|
2741
|
+
* @apioption chart.events.afterPrint
|
|
2742
|
+
*/
|
|
2743
|
+
/**
|
|
2744
|
+
* Fires before a chart is printed through the context menu item or
|
|
2745
|
+
* the `Chart.print` method.
|
|
2746
|
+
*
|
|
2747
|
+
* @sample highcharts/chart/events-beforeprint-afterprint/
|
|
2748
|
+
* Rescale the chart to print
|
|
2749
|
+
*
|
|
2750
|
+
* @type {Highcharts.ExportingBeforePrintCallbackFunction}
|
|
2751
|
+
* @since 4.1.0
|
|
2752
|
+
* @context Highcharts.Chart
|
|
2753
|
+
* @requires modules/exporting
|
|
2754
|
+
* @apioption chart.events.beforePrint
|
|
2755
|
+
*/
|
|
2756
|
+
(''); // keeps doclets above in transpiled file
|
|
2441
2757
|
|
|
2758
|
+
return Exporting;
|
|
2442
2759
|
});
|
|
2443
|
-
_registerModule(_modules, 'masters/modules/exporting.src.js', [], function () {
|
|
2760
|
+
_registerModule(_modules, 'masters/modules/exporting.src.js', [_modules['Core/Globals.js'], _modules['Extensions/Exporting/Exporting.js'], _modules['Core/HttpUtilities.js']], function (Highcharts, Exporting, HttpUtilities) {
|
|
2444
2761
|
|
|
2762
|
+
var G = Highcharts;
|
|
2763
|
+
G.HttpUtilities = HttpUtilities;
|
|
2764
|
+
G.ajax = HttpUtilities.ajax;
|
|
2765
|
+
G.getJSON = HttpUtilities.getJSON;
|
|
2766
|
+
G.post = HttpUtilities.post;
|
|
2767
|
+
Exporting.compose(G.Chart, G.Renderer);
|
|
2445
2768
|
|
|
2446
2769
|
});
|
|
2447
2770
|
}));
|