highcharts / highcharts-vue

Other
686 stars 150 forks source link

highcharts-stocktools-toolbar not able to see the buttons #99

Closed harshasunny closed 5 years ago

harshasunny commented 5 years ago

I was trying load highcharts stocktools toolbar buttons. I tried different ways but no use. getting this error Uncaught TypeError: Cannot read property 'prototype' of undefined
indicators-all.js?32e6:11

My main.js file in vue application

`import Vue from 'vue' import App from './App.vue' import HighchartsVue from 'highcharts-vue' import Highcharts from 'highcharts' import stockInit from 'highcharts/modules/stock' import mapInit from 'highcharts/modules/map' import addWorldMap from './js/worldmap' import exportingInit from 'highcharts/modules/exporting'

import HIndicatorsAll from "highcharts/indicators/indicators-all" import HDragPanes from "highcharts/modules/drag-panes" import HAnnotationsAdvanced from "highcharts/modules/annotations-advanced" import HPriceIndicator from "highcharts/modules/price-indicator" import HFullScreen from "highcharts/modules/full-screen" import HStockTools from "highcharts/modules/stock-tools"

HIndicatorsAll(Highcharts); HDragPanes(Highcharts); HAnnotationsAdvanced(Highcharts); HPriceIndicator(Highcharts); HFullScreen(Highcharts); HStockTools(Highcharts);

stockInit(Highcharts) mapInit(Highcharts) addWorldMap(Highcharts) exportingInit(Highcharts)

Vue.use(HighchartsVue)

new Vue({ el: '#app', render: h => h(App) }) `

Denyllon commented 5 years ago

Hi @harshasunny ,

Thank you for reporting the issue. Generally it's caused by incorrect order of calling modules, because you are trying to run indicators-all module before loading stock module, but all indicators depends on it. Please apply following order of calling modules to avoid the problem:

stockInit(Highcharts)
mapInit(Highcharts)

HIndicatorsAll(Highcharts);
HDragPanes(Highcharts);
HAnnotationsAdvanced(Highcharts);
HPriceIndicator(Highcharts);
HFullScreen(Highcharts);
HStockTools(Highcharts);

exportingInit(Highcharts)

Kind regards!