Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed a typing error #10

Merged
merged 9 commits into from

2 participants

@viniciuspc

Altered from gridLineColer to gridLineColor.

viniciuspc added some commits
@viniciuspc viniciuspc Added the Cursor class.
Altered the Axis class to be generic and created AxisString and AxisNumber.
a5d2b29
@viniciuspc viniciuspc Commit new Classes acee720
@viniciuspc viniciuspc Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/main/java/br/com/digilabs/jqplot/ChartConfiguration.java
	src/main/java/br/com/digilabs/jqplot/axis/Axis.java
	src/main/java/br/com/digilabs/jqplot/elements/Cursor.java
6239c0d
@viniciuspc viniciuspc Merge branch 'master' of https://github.com/inaiat/jqplot4java.git
Conflicts:
	src/main/java/br/com/digilabs/jqplot/ChartConfiguration.java
	src/main/java/br/com/digilabs/jqplot/axis/AxisNumber.java
	src/main/java/br/com/digilabs/jqplot/axis/AxisString.java
bc91556
@viniciuspc viniciuspc LineSerieTest altered to work with the modificaions of the Axis class 146297a
@viniciuspc viniciuspc Merge branch 'master' of https://github.com/inaiat/jqplot4java.git e08bbb4
@viniciuspc viniciuspc More test code f00fa83
@viniciuspc viniciuspc Merge branch 'master' of https://github.com/inaiat/jqplot4java.git cd3d0c9
@viniciuspc viniciuspc Fixed a digitation mistake d0dc2f6
@inaiat inaiat merged commit d4c85ee into inaiat:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 11, 2012
  1. @viniciuspc

    Added the Cursor class.

    viniciuspc authored
    Altered the Axis class to be generic and created AxisString and AxisNumber.
  2. @viniciuspc

    Commit new Classes

    viniciuspc authored
Commits on Apr 12, 2012
  1. @viniciuspc

    Merge remote-tracking branch 'upstream/master'

    viniciuspc authored
    Conflicts:
    	src/main/java/br/com/digilabs/jqplot/ChartConfiguration.java
    	src/main/java/br/com/digilabs/jqplot/axis/Axis.java
    	src/main/java/br/com/digilabs/jqplot/elements/Cursor.java
  2. @viniciuspc

    Merge branch 'master' of https://github.com/inaiat/jqplot4java.git

    viniciuspc authored
    Conflicts:
    	src/main/java/br/com/digilabs/jqplot/ChartConfiguration.java
    	src/main/java/br/com/digilabs/jqplot/axis/AxisNumber.java
    	src/main/java/br/com/digilabs/jqplot/axis/AxisString.java
Commits on Apr 13, 2012
  1. @viniciuspc
  2. @viniciuspc
Commits on Apr 17, 2012
  1. @viniciuspc

    More test code

    viniciuspc authored
  2. @viniciuspc
  3. @viniciuspc

    Fixed a digitation mistake

    viniciuspc authored
This page is out of date. Refresh to see the latest.
View
7 .classpath
@@ -1,12 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
+ <classpathentry kind="lib" path="lib/json-org.jar"/>
+ <classpathentry kind="lib" path="lib/xstream-1.3.1.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
View
20 src/main/java/br/com/digilabs/jqplot/elements/Grid.java
@@ -39,8 +39,8 @@
/** The draw grid lines. */
private Boolean drawGridLines;
- /** The grid line coler. */
- private String gridLineColer;
+ /** The grid line color. */
+ private String gridLineColor;
/** The grid line width. */
private Double gridLineWidth;
@@ -229,21 +229,21 @@ public void setDrawGridLines(Boolean drawGridLines) {
}
/**
- * Gets the grid line coler.
+ * Gets the grid line color.
*
- * @return gridLineColer
+ * @return gridLineColor
*/
- public String getGridLineColer() {
- return gridLineColer;
+ public String getGridLineColor() {
+ return gridLineColor;
}
/**
- * Sets the grid line coler.
+ * Sets the grid line color.
*
- * @param gridLineColer the new grid line coler
+ * @param gridLineColer the new grid line color
*/
- public void setGridLineColer(String gridLineColer) {
- this.gridLineColer = gridLineColer;
+ public void setGridLineColer(String gridLineColor) {
+ this.gridLineColor = gridLineColor;
}
/**
View
190 src/test/java/br/com/digilabs/jqplot/test/LineSerieTest.java
@@ -0,0 +1,190 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package br.com.digilabs.jqplot.test;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import junit.framework.TestCase;
+import br.com.digilabs.jqplot.Chart;
+import br.com.digilabs.jqplot.JqPlotResources;
+import br.com.digilabs.jqplot.JqPlotUtils;
+import br.com.digilabs.jqplot.axis.Axis;
+import br.com.digilabs.jqplot.axis.AxisNumber;
+import br.com.digilabs.jqplot.axis.AxisString;
+import br.com.digilabs.jqplot.axis.XAxis;
+import br.com.digilabs.jqplot.chart.LabeledLineChart;
+import br.com.digilabs.jqplot.chart.LineChart;
+import br.com.digilabs.jqplot.chart.LineSeriesChart;
+import br.com.digilabs.jqplot.data.ChartData;
+import br.com.digilabs.jqplot.data.item.LineSeriesItem;
+import br.com.digilabs.jqplot.elements.Axes;
+import br.com.digilabs.jqplot.elements.Cursor;
+import br.com.digilabs.jqplot.elements.Grid;
+import br.com.digilabs.jqplot.elements.Highlighter;
+import br.com.digilabs.jqplot.elements.Legend;
+import br.com.digilabs.jqplot.elements.Location;
+import br.com.digilabs.jqplot.elements.MarkerOptions;
+import br.com.digilabs.jqplot.elements.Serie;
+import br.com.digilabs.jqplot.elements.TickOptions;
+import br.com.digilabs.jqplot.renderer.Renderer;
+
+/**
+ *
+ * @author vinicius
+ */
+public class LineSerieTest extends TestCase {
+
+ public LineSerieTest(String testName) {
+ super(testName);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testLineSeriesChart() {
+ LineSeriesChart<Number, Number> chart = new LineSeriesChart<Number, Number>("Curves","X", "Y");
+
+ Collection<LineSeriesItem<Number, Number>> linhaSin = new ArrayList<LineSeriesItem<Number,Number>>();
+
+ for(double i = 0; i<= 6; i+= 0.01 ){
+ linhaSin.add(new LineSeriesItem<Number, Number>(i, Math.sin(i)+4));
+ }
+
+ chart.addValue(linhaSin);
+
+ Collection<LineSeriesItem<Number, Number>> linhaCos = new ArrayList<LineSeriesItem<Number,Number>>();
+
+ for(double i = 0; i<= 6; i+= 0.01 ){
+ linhaCos.add(new LineSeriesItem<Number, Number>(i, Math.cos(i)));
+ }
+
+ chart.addValue(linhaCos);
+
+ Collection<LineSeriesItem<Number, Number>> linhaExp = new ArrayList<LineSeriesItem<Number,Number>>();
+
+ for(double i = 0; i<= 2; i+= 0.01 ){
+ linhaExp.add(new LineSeriesItem<Number, Number>(i, Math.exp(i)+1));
+ }
+
+ chart.addValue(linhaExp);
+
+ Collection<LineSeriesItem<Number, Number>> linhaReta = new ArrayList<LineSeriesItem<Number,Number>>();
+
+ for(double i = 0; i<= 6; i+= 0.01 ){
+ linhaReta.add(new LineSeriesItem<Number, Number>(i, i));
+ }
+
+ chart.addValue(linhaReta);
+
+
+ Highlighter highlighter = criarHighlighter();
+
+ chart.getChartConfiguration().setHighlighter(highlighter);
+
+ chart.addSerie(criarSerie("Seno", "#489104"));
+ chart.addSerie(criarSerie("Coseno", "#c91212"));
+ chart.addSerie(criarSerie("Exponensial", "#7D02B2"));
+ chart.addSerie(criarSerie("Reta", "#066FA7"));
+
+ Legend legend = new Legend(true, Location.ne);
+ legend.setPlacment("outsideGrid");
+
+
+ chart.setLegend(legend);
+
+ Axis<String> axis = new AxisString();
+ axis.setLabelRenderer(JqPlotResources.CanvasAxisLabelRenderer);
+
+ chart.setAxesDefaults(axis);
+
+ Axes axes = chart.getAxes();
+ XAxis xaxis = axes.getXaxis();
+ TickOptions tickOptions = new TickOptions();
+ tickOptions.setAngle(270);
+ tickOptions.setLabelPosition("end");
+
+
+ xaxis.setTickOptions(tickOptions);
+ xaxis.setTickRenderer(JqPlotResources.CanvasAxisTickRenderer);
+ xaxis.setTickInterval(1);
+
+ axes.getYaxis().setTickInterval(0.50);
+
+ axes.getYaxis().setMax(8.50);
+ axes.getYaxis().setMin(-1.50);
+
+
+
+ TickOptions tickOptionsY = new TickOptions();
+ tickOptionsY.setFormatString("%.2f");
+ axes.getYaxis().setTickOptions(tickOptionsY);
+
+ Grid grid = new Grid();
+ grid.setBackground("#ffffff");
+ grid.setGridLineColer("#a0a0a0");
+ chart.getChartConfiguration().setGrid(grid);
+ Cursor cursor = new Cursor();
+ cursor.setZoom(true);
+ cursor.setClickReset(true);
+ chart.getChartConfiguration().setCursor(cursor);
+
+
+
+ String json = JqPlotUtils.createJquery(chart, "div3");
+ json = json.replaceAll("\\$", "jQuery");
+ System.out.println(json);
+
+ }
+
+ /**
+ * Cria um Highlighter
+ * @return
+ */
+ public Highlighter criarHighlighter() {
+ Highlighter highlighter = new Highlighter();
+ highlighter.setFormatString("<table style='background:#fafafa;font-size:12px;color:#000000'>" +
+ "<tr><td COLSPAN=2 style='font-size:12px;color:#0012FF;font-weight:bold'>#serieLabel#</td></tr>"+
+ "<tr><td>DU:</td><td>%s</td></tr>" +
+ "<tr><td>Taxa:</td><td>%s%%</td></tr>"+
+ "</table>");
+
+
+
+ highlighter.setShow(true);
+ highlighter.setSizeAdjust(2.0);
+ return highlighter;
+ }
+
+ /**
+ * Cria uma serie para o gráfico ela é responsável em determinar a cor dos pontos e o nome da linha.
+ * @param titulo
+ * @param cor
+ * @return a Serie criada
+ */
+ public Serie criarSerie(String titulo, String cor) {
+ Serie s = new Serie(titulo);
+
+ MarkerOptions markerOptions = new MarkerOptions();
+ markerOptions.setStyle("filledSquare");
+ markerOptions.size(1.f);
+
+ s.setMarkerOptions(markerOptions );
+ s.showLine(true);
+ s.setLineWidth(1);
+ s.setColor(cor);
+
+ return s;
+ }
+
+
+}
Something went wrong with that request. Please try again.