Name

Connext Graph Plugin

Publisher

Mark Ashworth

License

Open Source (ASL2)

Version

0.7

Compatibility

Struts 2.0.2+

Homepage

https://connext-graphs.dev.java.net

Download

https://connext-graphs.dev.java.net/servlets/ProjectDocumentList

{rate:title=Rating|theme=dynamic}

Overview

The Connext Graphs INLINE

allows web applications to make use of the Open Flash Chart charts

.

Features

Changes

0.7 Release

0.6 Release

The following constructor is used to create the sketch bar chart

new OFCBarSketchSeriesType(55, 6, "#d070ac", "#000000", "Test", 10)

The following is complete snippet taken from the Connext-Graphs Demo web application that demonstrates the sketch bar chart

DefaultOFCGraphDataModel model = new DefaultOFCGraphDataModel(); model.setData(Arrays.asList(data01)); model.setFormat(new DecimalFormat("###0.000")); model.setSeriesType(new OFCBarSketchSeriesType(55, 6, "#d070ac", "#000000", "Test", 10)); controller.add(model);

0.5 Release

0.4 Release

Upcoming Features

0.5 Release

0.5+ Release

Project

The project is accessible at https://connext-graphs.dev.java.net/

Example

  1. Add the connext-graph.jar to the WEb_INF/lib folder
  1. Include the taglib in your page
<%@ taglib prefix="m" uri="/connext" %>
  1. Insert the graph tag into your JSP page. In the example the data.txt file contains the controller logic for the graph. If you would a Struts 2 action to provide the controller logic then place it's fully qualified URL in the url property. Example, /contractor/Graph.action if the Graph action provides the logic.
<m:graph id="graph" width="800" height="300" align="middle" bgcolor="#FFFFFF" url="/Graph_example01.action" />
  1. Code the Graph action class. Below is an example of the example01 method
OFCGraphController controller = new OFCGraphController(); controller.getTitle().setText("Example 01"); controller.getTitle().setSize(12); controller.getLabels().setLabels(Arrays.asList(labels)); controller.getYLegend().setText("No. of tasks"); controller.getYLegend().setColor("#8b0000"); controller.getYLegend().setSize(12); controller.getXLegend().setText("Months"); controller.getXLegend().setColor("#8b0000"); controller.getXLegend().setSize(12); controller.getColor().getBgColor().setColor("#FFFFFF"); controller.getColor().getXAxisColor().setColor("#e3e3e3"); controller.getColor().getYAxisColor().setColor("#e3e3e3"); controller.getColor().getXGridColor().setColor("#e3e3e3"); controller.getColor().getYGridColor().setColor("#e3e3e3"); DefaultOFCGraphDataModel model = new DefaultOFCGraphDataModel(); model.setData(Arrays.asList(data01)); model.setFormat(new DecimalFormat("###0.000")); model.setSeriesType(new OFCLineHollowSeriesType(3, "#8b0000", "Test", 10, 6)); controller.add(model); model = new DefaultOFCGraphDataModel(); model.setData(Arrays.asList(data02)); model.setFormat(new DecimalFormat("###0.000")); model.setSeriesType(new OFCLineDotSeriesType(3, "#8b0000", "Test 2", 5, 6)); controller.add(model); model = new DefaultOFCGraphDataModel(); model.setData(Arrays.asList(data03)); model.setFormat(new DecimalFormat("###0.000")); model.setSeriesType(new OFCLineSeriesType(2, "#8b0000", "Example", 4)); controller.add(model); value = controller.render(); return SUCCESS;
  1. Code the graph.jsp page to output the Graph.value property
<%@ include file="include.jsp" %> <s:property value="value" escape="false" />
  1. Remember to put cache control off
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 response.setHeader("Pragma","no-cache"); //HTTP 1.0 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server

Resources

Version History

Version

Date

Author

Notes

0.1

Jun 20, 2007

Mark Ashworth

Initial release

0.2

Jun 23, 2007

Mark Ashworth

Added the controller and line graph support

0.3

Aug 18, 2007

Mark Ashworth

Resolved the issue with the Tomcat tagSupport.xml file

0.4

Aug 20, 2007

Mark Ashworth

Added support for bar and filled bar charts