Home Forums Chart Support Using JSP

Using JSP

Viewing 4 posts - 1 through 4 (of 4 total)
  • #20297

    I’m new to web development. My database professor had the bright idea to have us create a web based interface to a Postgres database that updates bar charts based on database queries in the last three weeks of the semester. Many of the students have little to no web dev experience and we have to figure it all out on our own. I managed to set up a Java/Glassfish/Postgres which will use JSP in a JavaFaces framework. I have a student license for CanvasJS and managed to get a JSP bar graph to display but it will not display on my start page only when I navigate to it from my start page. If I put the graph code from the page I downloaded on my start page I get a Java null pointer exception when I try to display it in a web browser. Any advice on how to do this would be appreciated.



    Can you kindly share sample project along with sample database (over onedrive or google-drive), so that we can understand your code and scenario better and help you out?

    Vishwas R
    Team CanvasJS


    I followed this tutorial to set up the server/web app/database: https://netbeans.org/kb/docs/web/mysql-webapp.html. I’m using Postgres instead of MySQL but shouldn’t matter. I have not yet attempted to update a graph with data from my database. At this point I’m just trying to figure out how to display a graph I downloaded from CanvasJS on a page with HTML elements and formatting. The graph I’m trying to use is the JSP version of the “Olympic Medals of all Times” bar chart. I am able to display it if I navigate to it from my HTML start page but not if I make it the start page in the application. In that case the browser say there was a Java exception. I don’t have much to put on a drive to share (I would need your email in any case to share documents). Helpful advice would be how to create a bar graph in a JSP framework that will display on a web page along with HTML elements and formatting. We have to input parameters in fields on the web page which will modify the database query and update the bar chart with new data once the ‘submit’ button is clicked. I need to know how to assign variables to the height of the bars in the chart that will be updated with new values from a modified query. The HTML coded fields and the bar charts (2 of them) must be on the same web page. I have taken a course in HTML5/CSS so that part is not an issue. I have background in Java but just learning JavaScript for this project.



    Please take a look at JSP Gallery which has a wide range of examples showing how to render CanvasJS charts within JSP along with source-code. Also you can try downloading JSP Sample Project from download page, which you can run locally and try.

    If these doesn’t help you fulfill your requirement, can you please create a sample project with the issue you are facing and share the onedrive/google-drive link, so that we can look into your code and understand the issue better and help you resolve that?

    Vishwas R
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.