Welcome Guest Search | Active Topics |

forcing visibleMinimum and visibleMaximum
cbolaurent
#1 Posted : Monday, February 4, 2013 1:38:37 PM(UTC)
Rank: Newbie

Groups: jQueryDV, Registered
Joined: 2/4/2013(UTC)
Posts: 6

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

I'm trying to force visibleMinimum and visibleMaximum.
It works when I give these values at initialisation time.

But I want to create buttons which activate some special periods (current year, last year, 24 months etc ...)

I tried this :

$("#bpap").button().click(function() {
var maxdate = data[data.length-1][0];
$('#chart1').jqChart('option', 'axes.visibleMinimum' , new Date(maxdate.getFullYear()-1, 0, 1));
$('#chart1').jqChart('option', 'axes.visibleMaximum' , new Date(maxdate.getFullYear()-1, 11, 31));
$('#chart1').jqChart('update');
});

(where data is the array wich contains the data of the chart)

but it don't work

Thx in advance
Laurent
Dragan
#2 Posted : Monday, February 4, 2013 1:52:18 PM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

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

You can change the axes configuration with:

Code:
var axes = $('#jqChart').jqChart('option', 'axes');

axes[0].visibleMinimum = new Date(maxdate.getFullYear() - 1, 0, 1);
axes[0].visibleMaximum = new Date(maxdate.getFullYear() - 1, 11, 31);

$('#jqChart').jqChart('update');


Best Regards,
Dragan Matek
jqChart Inc.
1 user thanked Dragan for this useful post.
cbolaurent on 2/5/2013(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.072 seconds.