superman66 / vue-highcharts

The Component of Vue 2.x for highcharts
https://codesandbox.io/s/jjyqvv0k13
MIT License
115 stars 48 forks source link

Problem with the Drilldown #38

Closed joemanfoo closed 6 years ago

joemanfoo commented 6 years ago

Hi there!

Firstly, wow! Thank you for this package, seriously! I'm in the process of removing dependencies that are outside of Vue so I can wire up unit tests (easier/cleaner).

On to the problem. As the title suggests I've ran into an issue where I cannot seem to get drilldown wired up.

This shows the data that I've got - showing the data is cool. http://jsfiddle.net/gv1aeuuq/

I've followed the docs with setting things up but no drilldown.

import VueHighcharts from 'vue2-highcharts'
import Drilldown from '../../node_modules/highcharts/modules/Drilldown.js'
import Highcharts from 'highcharts'
Drilldown(Highcharts)

I've also tried (transpiles just fine on latest vue/webpack):

import VueHighcharts from 'vue2-highcharts'
import Drilldown from 'highcharts/modules/Drilldown.js'
import Highcharts from 'highcharts'
Drilldown(Highcharts)

And this is what's up in the <template> block: <vue-highcharts :Highcharts="Highcharts" :options="options" ref="demoInventory"></vue-highcharts>

And I've tried: <vue-highcharts :options="options" ref="demoInventory"></vue-highcharts>

The chart will render, labels are present but clicking on a wedge there's no drilldown.

vue-highcharts version "^1.1.9" vue version "^2.5.2"

superman66 commented 6 years ago

@joemanfoo sorry, it my mistake! this pull request: Align with best practices for production component change the props name of Highcharts to highcharts.

I forgot to update demo code in README.md.

<vue-highcharts :highcharts="Highcharts" :options="options" ref="demoInventory"></vue-highcharts>

it should be works.

joemanfoo commented 6 years ago

@superman66 - That did the trick! Thanks, I saw that and thought "hmmm" but didn't try that on my own

superman66 commented 6 years ago

@joemanfoo emmm....next time, just follow your heart.

HarisHashim commented 6 years ago

Just to share code how to change drilldown on the fly using mergeOption.

https://github.com/HarisHashim/vue-highcharts-demo/blob/master/src/components/LoadModuleChart.vue

The code is 2 functions in methods.

superman66 commented 6 years ago

@HarisHashim Thanks!