Table of Contents
package fusioncharts; /** * * @author fusioncharts */import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.interceptor.ServletRequestAware; import org.apache.struts2.interceptor.ServletResponseAware; import com.opensymphony.xwork2.ActionSupport; public class action extends ActionSupport implements ServletRequestAware, ServletResponseAware{ private static final long serialVersionUID = 1L; private HttpServletRequest request; private HttpServletResponse response; /** * * @return */ public String chartmaker(){ FusionCharts columnChart= new FusionCharts( "column2d",// chartType "chart1",// chartId "550","350",// chartWidth, chartHeight "chart",// chartContainer "json",// dataFormat "{\"chart\": {\"caption\": \"Harry\'s SuperMart - Top 5 Stores' Revenue\", \"subCaption\": \"Last Year\", \"numberPrefix\": \"$\", \"rotatevalues\": \"0\", \"plotToolText\": \"$label\", \"theme\": \"fint\"}, \"data\": [{\"label\": \"Bakersfield Central\", \"value\": \"880000\"}, {\"label\": \"Garden Groove harbour\", \"value\": \"730000\"}, {\"label\": \"Los Angeles Topanga\", \"value\": \"590000\"}, {\"label\": \"Compton-Rancho Dom\", \"value\": \"520000\"}, {\"label\": \"Daly City Serramonte\", \"value\": \"330000\"}] }" ); return columnChart.render(); } @Override public void setServletRequest(HttpServletRequest request) { this.request = request; } /** * * @param response */ @Override public void setServletResponse(HttpServletResponse response) { this.response = response; } }
Sales : $$value
<%@page import="fusioncharts.action"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page import="fusioncharts.FusionCharts" %> <!DOCTYPE html> <html> <head> <title>FusionCharts || www.fusioncharts.com</title> <script src="fusioncharts.js"></script> <script src="fusioncharts.charts.js"></script> <script src="fusioncharts.theme.fint.js"></script> </head> <body> <div id="chart"></div> <% action a= new action(); out.println(a.chartmaker()); %> </body> </html>Note : Import the Fusioncharts wrapper in the JSP page and also include the FusionCharts JS library files in the page.
Ever had a data set that seemed more complicated than a Rubik's cube? You’re not…
We’ve all seen them in textbooks or presentations—those overlapping circles that simplify complex information into…
We’re excited to announce the upcoming release of FusionCharts v4.1—a groundbreaking step forward in the…
Have you ever been overwhelmed by a massive data set and wondered, "How do I…
If you’ve ever tried to make sense of the stock market, you’ve probably come across…
Imagine you’re comparing the sales performance of your top product lines across different regions, or…