Welcome Guest Search | Active Topics |

Zoom not working
Vince
#1 Posted : Wednesday, April 24, 2013 6:15:18 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/24/2013(UTC)
Posts: 16

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

I'm trying to build a chart, where the user can zoom using the mouse inside the chart. I don't want any sliders. Though i set zoomEnabled to true, it doesn't work. Here is my code:

Code:

31 $('#jqChart').jqChart({
32         border: {
33                 lineWidth: 0,
34                 padding: 0,
35                 cornerRadius: 0
36         },
37         legend: {
38                 visible: false
39         },
40         crosshairs: {
41                 enabled: true,
42                 snapToDataPoints: true,
43                 hLine: {
44                         visible: false
45                 },
46                 vLine: {
47                         strokeStyle: 'black'
48                 }
49         },
50         tooltips: {
51                 disabled: true,
52                 type: 'shared'
53         },
54         axes: [
55                 {
56                         type: 'dateTime',
57                         location: 'bottom',
58                         zoomEnabled: true,
59                         name: 'xAxis1',
60                         majorGridLines: {
61                                 strokeStyle: '#DDDDDD'
62                         },
63                         majorTickMarks: {
64                                 length: 0
65                         },
66                         labels: {
67                                 stringFormat: 'mmm'
68                         },
69                         strokeStyle: '#DDDDDD'
70                 }, {
71                         name: 'yAxis1',
72                         type: 'linear',
73                         majorGridLines: {
74                                 strokeStyle: '#DDDDDD'
75                         },
76                         minorGridLines: {
77                                 strokeStyle: '#DDDDDD'
78                         },
79                         majorTickMarks: {
80                                 length: 0
81                         },
82                         location: 'right',
83                         logarithmic: true,
84                         logBase: 2,
85                         minimum: 30,
86                         maximum: 70,
87                         zoomEnabled: true,
88                         strokeStyle: '#DDDDDD'
89                 }
98         ],
99         series: [
100                 {
101                         type: 'area',
102                         title: 'Zertifikat',
103                         axisX: 'xAxis1',
104                         axisY: 'yAxis1',
105                         strokeStyle: '#154B9D',
106                         lineWidth: 1,
107                         fillStyle: 'rgba(223, 234, 251, 0.7)',
108                         data: chartData
109                 }
110         ]
111 });
Dragan
#2 Posted : Wednesday, April 24, 2013 3:13:40 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 set to your axis config:
Code:
zoomEnabled: true,
rangeSlider: { visible: false }
Best Regards,
Dragan Matek
jqChart Inc.
Vince
#3 Posted : Thursday, April 25, 2013 1:35:14 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/24/2013(UTC)
Posts: 16

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Unfortunately it still doesn't work. Here are my axes now:

Code:

53 axes: [
54         {
55                 type: 'dateTime',
56                 location: 'bottom',
57                 zoomEnabled: true,
58                 rangeSlider: {
59                         visible: false
60                 },
61                 name: 'xAxis1',
62                 majorGridLines: {
63                         strokeStyle: '#DDDDDD'
64                 },
65                 majorTickMarks: {
66                         length: 0
67                 },
68                 labels: {
69                         stringFormat: 'mmm'
70                 },
71                 strokeStyle: '#DDDDDD'
72         }, {
73                 name: 'yAxis1',
74                 type: 'linear',
75                 majorGridLines: {
76                         strokeStyle: '#DDDDDD'
77                 },
78                 minorGridLines: {
79                         strokeStyle: '#DDDDDD'
80                 },
81                 majorTickMarks: {
82                         length: 0
83                 },
84                 location: 'right',
85                 logarithmic: true,
86                 logBase: 2,
87                 minimum: 30,
88                 maximum: 70,
89                 strokeStyle: '#DDDDDD'
90         }
99 ],


When I try to zoom, nothing happens at all.
Vince
#4 Posted : Thursday, April 25, 2013 5:55:24 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/24/2013(UTC)
Posts: 16

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
I also prepared a jsFiddle: http://jsfiddle.net/AUT2E/1/
Dragan
#5 Posted : Friday, April 26, 2013 1:29:17 AM(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 include the jQueryUI css file, so the chart toolbar will be visible and you can switch between padding and zooming:

Code:
<link rel="stylesheet" type="text/css" media="screen" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.21/themes/smoothness/jquery-ui.css" />


You can also make the default mouse interaction mode to zooming:

Code:
mouseInteractionMode: 'zooming',


check the example:http://jsfiddle.net/AUT2E/3/
Best Regards,
Dragan Matek
jqChart Inc.
Vince
#6 Posted : Tuesday, April 30, 2013 4:08:46 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/24/2013(UTC)
Posts: 16

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
It's working, thanks!
Users browsing this topic
Guest (2)
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.104 seconds.