jQWidgets Forums

jQuery UI Widgets Forums Chart How use the click events on line type

This topic contains 6 replies, has 5 voices, and was last updated by  Finnigan 12 years, 2 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • How use the click events on line type #9516

    akun_007
    Member

    // get the series groups of an existing chart
    var groups = $(‘#jqxChart’).jqxChart(‘seriesGroups’);

    // add a click event handler function to the 1st group
    if (groups.length > 0)
    {
    groups[0].click = function(e)
    {
    alert(‘event = ‘ + e.event + ‘ index = ‘ + e.elementIndex );
    }

    // update the group
    $(‘#jqxChart’).jqxChart({seriesGroups: groups});
    }

    Use this code, nothing happened…..

    How use the click events on line type #9521

    Dimitar
    Participant

    Hello akun_007,

    Unfortunately, the click event is not supported by line type charts.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    How use the click events on line type #10439

    alearg
    Member

    Do you plan to support click events on line charts eventually (_very_ useful!)?

    If not, can you suggest some other way to interact with line charts on a mobile device?

    Thanks in advance

    Alexis

    How use the click events on line type #10523

    Dimitar
    Participant

    Hello Alexis,

    Currently, we have no plans to support click events on line charts.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    How use the click events on line type #12871

    Ernst
    Member

    Well, that explains my problem.

    Any reason for not being consistent with your API? since you can support the mouseover/out events, it shouldn’t be that hard to add the click too?

    I agree that it would be a very useful addition since a bar chart would be too cluttering in my case.

    How use the click events on line type #15889

    Finnigan
    Member

    Son la cara

    How use the click events on line type #15971

    Finnigan
    Member

    I solved it by doing this:
    1- Created two vars to store the selected x and it’s value.
    2- Created a function for the mouseover event in “seriesGroups” like this:

    onChartMouseOver = function (evt) {
    lastElementIndex = evt.elementIndex;
    lastElementValue = evt.elementValue;
    },

    3- Created a function for the click event of the whole component (which is triggered when the user clicks in any part of the chart, so it requires validation). From there I used the lastElementIndex and lastElementValue previously updated with the last mouseover event.

    Hope it helps you.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.