how can i draw graph in spring mvc in jsp using highchart


Francisco Gallardo:

i want to draw graph in jsp unsando spring mvc and highchart but i still can't do it, i wait for your answer thanks

My point, this is where I want to draw the graph, but the graph is not showing, it shows nothing

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <title>Chart</title> 
            <script src="resources/assets/js/highcharts.js"></script>
            <script src="resources/assets/js/highcharts-3d.js"></script>
<!--          <script src="resources/assets/js/jquery.js"></script> -->
            <script src="https://code.jquery.com/jquery-3.2.1.js"></script>

    </head>

    <body class="page-container-bg-solid">
        <div class="page-container">
            <div class="page-content-wrapper">
                <div class="page-head" style="background-color:#eff3f8;padding-top:40px">
                    <div class="container">
                        <div class="row" style="margin-bottom:30px">
                            <div class="col-md-6">
                                <h1>my Chart</h1>
                            </div> 
                        </div>
                        <div class="row" style="margin-bottom:30px">                         
                            <div class="col-md-6" style="margin-top:20px">
                                <div id="mychart" style="width:100%; height:400px;"></div>
                            </div> 
                        </div>                        
                    </div> 
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(function () { 
                Highcharts.setOptions({
                    global: {
                        useUTC: false
                    }
                });
                drawSalesByTypeChart();
                drawSalesByRegionChart();
            });


            function drawSalesByRegionChart() {
                var salesByRegionChart = Highcharts.chart('mychart', {
                    chart: {
                        type: 'pie',
                        margin: 40,
                        options3d: {
                            enabled: true,
                            alpha: 45,
                            beta: 0
                        }
                    },
                    title: {
                        text: 'Sales by Region'
                    },
                    plotOptions: { 
                        pie: {
                            allowPointSelect: true,
                            depth: 35
                        }
                    },
                    series: [{ 
                        name: 'Regions',
                        colorByPoint:true,
                        data: [{
                            name: 'Northeast',
                            y: [[${listGraph}]]
                        }                      
                        ]
                    }]
                });
            }
        </script>        
    </body>
</html>

my controller

@RequestMapping(value = "/graphReport")
    public String combo(QcReport qc, Model model) throws IOException {
        List<QcReport> listGraph = assayServ.listGraphAssay();
        model.addAttribute("listGraph", listGraph);
        return ("graphReport");
    }
bkbb:

When I compare your work in the tutorial below:

https://careydevelopment.us/2017/07/01/add-charts-spring-boot-app-highchart/

You are trying to draw a pie chart which expects integer values ​​when passed a list ${listGraph}.

                    series: [{ 
                        name: 'Regions',
                        colorByPoint:true,
                        data: [{
                            name: 'Northeast',
                            y: [[${listGraph}]]
                        }                      
                        ]

Related


how can i draw graph in spring mvc in jsp using highchart

Francisco Gallardo: i want to draw graph in jsp unsando spring mvc and highchart but i still can't do it, i wait for your answer thanks My point, this is where I want to draw the graph, but the graph is not showing, it shows nothing <%@ taglib uri="http://java

how can i draw graph in spring mvc in jsp using highchart

Francisco Gallardo: i want to draw graph in jsp unsando spring mvc and highchart but i still can't do it, i wait for your answer thanks My point, this is where I want to draw the graph, but the graph is not showing, it shows nothing <%@ taglib uri="http://java

how can i draw graph in spring mvc in jsp using highchart

Francisco Gallardo: i want to draw graph in jsp unsando spring mvc and highchart but i still can't do it, i wait for your answer thanks My point, this is where I want to draw the graph, but the graph is not showing, it shows nothing <%@ taglib uri="http://java

How to draw a one-line graph using Highchart bullet chart?

Professor of Development I recently switched to highchart and I'm trying to use highchart bullet chart to achieve a graph like this But failed to customize it like this, can someone define what I'm doing wrong? Or is it possible to customize the bullet graph l

How can I draw an energy ranking graph using Python?

twin penguins This is a typical energy ranking used in some published papers, and I am struggling to reproduce one for my data using Python (any matplotlib, sns, etc.). I structure the data in a Pandas dataframe like this: System Color_id Data1 Data2 Form I

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw an energy ranking graph using Python?

twin penguins This is a typical energy ranking used in some published papers, and I am struggling to reproduce one for my data using Python (any matplotlib, sns, etc.). I structure the data in a Pandas dataframe like this: System Color_id Data1 Data2 Form I

How can I draw this graph in Android using XML?

João Correia I'm trying to draw a form in an image in Android XML. But so far my attempts have been unsuccessful. what should I do? Thanks in advance place If you use RelativeLayout, you can make a black rectangle and put a white triangle image on top. I can't

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw an energy ranking graph using Python?

twin penguins This is a typical energy ranking used in some published papers, and I am struggling to reproduce one for my data using Python (any matplotlib, sns, etc.). I structure the data in a Pandas dataframe like this: System Color_id Data1 Data2 Form I

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw this graph using iris data?

Special case agency Using the iris dataset I want to draw a graph like this: Using viewport(), the scatter plot has a width and height of 0.66 I have two questions: 1.) As you can see in the second plot (right) the lines are smoother, but in the first plot (ri

How can I draw this graph in Android using XML?

João Correia I'm trying to draw a form in an image in Android XML. But so far my attempts have been unsuccessful. what should I do? Thanks in advance place If you use RelativeLayout, you can make a black rectangle and put a white triangle image on top. I can't

I can't access jsp page using Spring MVC 3

Antony Prudyus: I created simple add entity form called addContact.jsp <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <html> <body> <h2>Contact information</h2> <form:form method="POST" action="contacts/add" modelAttribute="c

I can't access jsp page using Spring MVC 3

Antony Prudyus: I created simple add entity form called addContact.jsp <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <html> <body> <h2>Contact information</h2> <form:form method="POST" action="contacts/add" modelAttribute="c

I can't access jsp page using Spring MVC 3

Antony Prudyus: I created simple add entity form called addContact.jsp <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <html> <body> <h2>Contact information</h2> <form:form method="POST" action="contacts/add" modelAttribute="c

I can't access jsp page using Spring MVC 3

Antony Prudyus: I created simple add entity form called addContact.jsp <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <html> <body> <h2>Contact information</h2> <form:form method="POST" action="contacts/add" modelAttribute="c

How can I draw such a graph in Python?

Santos I want to draw a graph like the image below: I wrote the following code to plot the waveform for each time step. import matplotlib.pyplot as plt import numpy as np def u_0(x): a = 1.0/np.cosh(2.0*(x+8.0)) b = 1.0/np.cosh((x+1.0)) return 8.0

How can I draw this graph in Excel?

Pablo I have a CSV file with the following data This series has 500 rows. However, I need to plot whatever is on column A as the horizontal axis and whatever is on column B [0..499] as the vertical axis. I would like to label the horizontal axis values at ever

How can I draw a complete graph in R?

Mrsteve I want to draw complete graphs in R. How can I do this? I've only found one package on CRAN that has the ability to generate a full graph. But this package (i.e. "RnavGraph") is not installed but exits with error status. Further searching seems to be d

How can I draw this graph in R?

cooldood3490 I want to draw speedVS. Data are as follows:age Speed Age 15 <18 30 18-25 40 26-40 32 40+ How can I plot this as a scatterplot in R? I don't know how to do range. So far this is what I have. speed<-c(15,30,40,32) Peter Accu

How can I draw such a graph in Python?

Santos I want to draw a graph like the image below: I wrote the following code to plot the waveform for each time step. import matplotlib.pyplot as plt import numpy as np def u_0(x): a = 1.0/np.cosh(2.0*(x+8.0)) b = 1.0/np.cosh((x+1.0)) return 8.0

How can I draw this graph in Excel?

Pablo I have a CSV file with the following data This series has 500 rows. However, I need to plot whatever is on column A as the horizontal axis and whatever is on column B [0..499] as the vertical axis. I would like to label the horizontal axis values at ever

How can I draw this graph in R?

cooldood3490 I want to draw speedVS. Data are as follows:age Speed Age 15 <18 30 18-25 40 26-40 32 40+ How can I plot this as a scatterplot in R? I don't know how to do range. So far this is what I have. speed<-c(15,30,40,32) Peter Accu

How to draw an ellipse (ellipse) on a Highchart graph

Anton Rebalco I have two series and their intersection. I would like to have an ellipse (ellipse) on the graph with the center at the intersection. The ellipse radius should be set in axis units to show the region of interest for each axis. Highcharts.chart('c