|
To display dynamically-generated charts in your browser you need to setup WebCharts3D on the server. In
the simplest case all you need to do is to add wcruntime.jar or wc50.jar to your WEB-INF/lib. For more
information about setting up WebCharts3D on the server please refer to the documentation provided with the product.
There are multiple ways to produce charts on the server. The examples in this section use indirect method of image delivery
when the tags produced by WebCharts3D component are embedded into a JSP page. The generated tags will need to point
back to the server to retrieve the actual image bytes. You can implement a servlet for this purpose, but these
examples instead use a simple JSP page called getimage.jsp located in the current folder:
getimage.jsp
<%
MxServerComponent svr = MxServerComponent.getDefaultInstance(application);
svr.writeCachedBytesTo(request.getParameterValues("image")[0],out,response);
%><%@ page import = "com.gp.api.jsp.MxServerComponent" %><!-- NO CR/LF HERE-->
Once this page is created you can launch WebCharts3D Designer, design you chart and copy generated JSP
code into your web page. In some cases you will need to change the name and the path to getimage.jsp page/servlet
in the generated code.
The rest of the examples in this section cover
the following topics:
- Changing chart style based on the end-user preferences.
- Changing chart model based on the end-user preferences.
- Implementing drill-down and onclick event handlers.
- Refreshing server-generated charts without reloading web pages.
|