Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

implement functions/events #48

Closed
jbkunst opened this issue Feb 29, 2016 · 5 comments
Closed

implement functions/events #48

jbkunst opened this issue Feb 29, 2016 · 5 comments
Milestone

Comments

@jbkunst
Copy link
Owner

jbkunst commented Feb 29, 2016

This is a vey inmature idea. The goal is define function to implement in an easy way events without write javascript.

This will be usefull with shiny app, addin etc.

@jbkunst jbkunst added this to the v0.3.0 milestone Feb 29, 2016
@jbkunst
Copy link
Owner Author

jbkunst commented Mar 2, 2016

http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-point-events-click-column/

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'scatter'
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },

        plotOptions: {
            series: {
                cursor: 'pointer',
                point: {
                    events: {
                        click: function () {
                            alert('Category: ' + this.category + ', value: ' + this.y + ', series: ' + this.series.name);
                        }
                    }
                }
            }
        },

        series: [{
            data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
        },{
            data: [135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0]
        }]
    });
});

@jbkunst jbkunst modified the milestones: v0.4.0, v0.3.0 Mar 27, 2016
@adymimos
Copy link
Contributor

good to have this.
With current package, below code will work
hc_plotOptions(
series = list(
cursor = 'pointer',
point = list(events = list(
click = JS("function() {
if (typeof Shiny != 'undefined') {
Shiny.onInputChange('bar_select',this.category); }
}")
))))

@jbkunst jbkunst modified the milestones: v0.5.0, v0.4.0 Jul 15, 2016
@jbkunst jbkunst modified the milestones: v0.5.0, v0.6.0 Nov 29, 2016
@davidmanero
Copy link

davidmanero commented Jan 10, 2017

This function will be great.

I've problems with the drilldown event in a 3Dpie chart.

I've try this:

hc_plotOptions(pie = list(depth = 40,
                                cursor = "pointer",
                                point = list(events = list(
                                    click = JS("function() {Shiny.onInputChange('pie', name: this.point.name);}")
                          ))))

I've try it with "drilldown" instead of "click" and nothing works.

Could you help me?

@jbkunst
Copy link
Owner Author

jbkunst commented Jan 10, 2017

See your browser console, I think you have a non valid js code. You need other set of brackets:

Shiny.onInputChange('pie', **{** name: this.point.name **}** )

Next time, try format your code using ``` ;)!

@davidmanero
Copy link

Thanks you, it works!!!

jbkunst added a commit that referenced this issue Feb 1, 2017
jbkunst added a commit that referenced this issue Feb 1, 2017
@jbkunst jbkunst closed this as completed in 0fcee2b Feb 5, 2017
@jbkunst jbkunst modified the milestones: v0.5.1, v0.6.0 Feb 5, 2017
jbkunst added a commit that referenced this issue Mar 6, 2017
jbkunst added a commit that referenced this issue Mar 6, 2017
@jbkunst jbkunst changed the title implement hc_drop hc_select functions/events implement functions/events Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants