How to get visualize.js working in mvc web app

0

I have a piece of javascript that mimics the sample javascript, and it works fine in jsfiddle. It doesn't work in my sample mvc web app. Is there anything special I have to do in order to use visualize.js in the .net environment? Here is my sample code:

@{
    ViewBag.Title = "About";
}
 
<!-- Provide the URL to visualize.js -->
 
 
<h2>@ViewBag.Title.</h2>
<h3>Sample Jasper Report</h3>
 
<div id="container"></div>
 
<script>
    visualize({
        auth: {
 
            name: "superuser",
            password: "superuser",
            //organization: "organization_1"
        }
    }, function (v) {
 
        v("#container").report({
            resource: "/organizations/organization_1Total_Hours_Pie_Chart_Report",
            error: handleError
        });
 
        function handleError(err) {
            alert(err.message);
        }
    });
    
</script>
 

 

a.ottinger's picture
Joined: Jul 8 2015 - 1:34pm
Last seen: 4 years 2 weeks ago

1 Answer:

0

Try using ip address instead of "localhost".

Also, use firebug to check for any errors. I had some problem with Visualize.js on 5.6.0 but it's OK on 6.1.0 so I recommend 6.1.0 if you're not using it yet.

hozawa's picture
47047
Joined: Apr 24 2010 - 4:31pm
Last seen: 2 months 2 weeks ago
Feedback