flot charts are not getting displayed

56 views
Skip to first unread message

@brooks

unread,
Sep 24, 2016, 7:05:25 AM9/24/16
to web2py-users
Hi,
I want to use flot charts in my application.I tried running an example which required jquery.js ,jquery.flot.js ,jquery.flot.navigate.js files.I uploaded all these files in the static/js folder and in the view I used <script src="{{=URL('static','js','jquery.js')}}"></script>
<script src="{{=URL('static','js','jquery.flot.js')}}"></script>
<script src="{{=URL('static','js','jquery.flot.navigate.js')}}"></script>
I also uploaded some images and included them in the view as follows:
...........
function addArrow(dir, right, top, offset) {
            var filename='arrow-'+dir+'gif';
            $("<img class='button' src="{{=URL('static','images')}}"+"/"+filename style='right:' + right + "px;top:" + top + 'px'>")........
            ............................................}
But the graph is not getting displayed.Could anyone please point out what I am doing wrong and why it is wrong.Thanks in advance.
Regards


Anthony

unread,
Sep 24, 2016, 12:01:48 PM9/24/16
to web2py-users
Not sure if any of this is the source of your problem, but first, make sure you are not loading jquery twice (it is loaded in the default layout.html view). Second, in the addArrow function, the "<img.." tag is wrapped in double quotes, but you also use double quotes to surround some of the contained attribute values.

More generally, always check the browser Javascript console for errors.

Anthony

brooks lee

unread,
Sep 26, 2016, 1:53:38 AM9/26/16
to web...@googlegroups.com
Thanks Anthony.I corrected the two things you pointed out and then checked for the errors in the console.It shows error 304(file not modified) and I am not able to rectify that! :(
Regards














--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/YA-o1OUS_0w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony

unread,
Sep 26, 2016, 7:13:42 AM9/26/16
to web2py-users
On Monday, September 26, 2016 at 1:53:38 AM UTC-4, @brooks wrote:
Thanks Anthony.I corrected the two things you pointed out and then checked for the errors in the console.It shows error 304(file not modified) and I am not able to rectify that! :(

Sounds like you're looking in the network tab at the HTTP requests. Instead, check the Javascript console to see if any Javascript errors are reported.

Anthony

brooks lee

unread,
Sep 27, 2016, 6:35:46 AM9/27/16
to web...@googlegroups.com
Got it! Had to update the jquery version.It's working now.Thanks Anthony.

--
Reply all
Reply to author
Forward
0 new messages