Welcome Guest Search | Active Topics |

Change a chart attribute from Client-Side Event
tlewi2
#1 Posted : Wednesday, March 12, 2014 3:45:59 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/2/2013(UTC)
Posts: 6

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Hi,

I'm not sure of the j-query syntax to reverse the x-axis if the user clicks on the x-axis of the chart. I got something like:

$(document).ready(function () {
var chartName = '#<%= Chart1.ClientID %>';

$(chartName).bind('axisLabelMouseDown', function (e, data) {

if (data.axis.name == "MyXAxis") {
data.axis.reversed = "True";
}

});

});


But the data.axis.reversed = "True"; is not correct.

Thanks,
Tobin
Ivan
#2 Posted : Wednesday, March 12, 2014 3:58:13 PM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
Try using this code:

Code:
$(document).ready(function () {
      var chartName = '#<%= Chart1.ClientID %>';

      $(chartName).bind('axisLabelMouseDown', function (e, data) {

        if (data.axis.name == "MyXAxis") {
            data.axis.options.reversed = true;
        $(chartName).jqChart('update');
        }

      });

});
Best,
Ivan Petrov
jqChart Inc.
1 user thanked Ivan for this useful post.
tlewi2 on 3/12/2014(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.140 seconds.