Package com.googlecode.charts4j

Examples of com.googlecode.charts4j.Line


   
    if (min >= max)
      return errorChart();
   
    // Defining lines
    Line line1;
    if (lineLabel == null)
      line1 = Plots.newLine(DataUtil.scaleWithinRange(min, max, points), lineColor);
    else
      line1 = Plots.newLine(DataUtil.scaleWithinRange(min, max, points), lineColor, lineLabel);
    line1.setLineStyle(LineStyle.newLineStyle(1, 1, 0));
    line1.addShapeMarkers(Shape.CIRCLE, lineColor, pointSize);
   
    // Defining chart.
    LineChart chart = GCharts.newLineChart(line1);
    chart.setSize(w, h);
    if (title != null)
View Full Code Here


        final double[] mywebsite = new double[NUM_POINTS];
        for (int i = 0; i < NUM_POINTS; i++) {
            competition[i] = 100-(Math.cos(30*i*Math.PI/180)*10 + 50)*i/20;
            mywebsite[i] = (Math.cos(30*i*Math.PI/180)*10 + 50)*i/20;
        }
        Line line1 = Plots.newLine(Data.newData(mywebsite), Color.newColor("CA3D05"), "My Website.com");
        line1.setLineStyle(LineStyle.newLineStyle(3, 1, 0));
        line1.addShapeMarkers(Shape.DIAMOND, Color.newColor("CA3D05"), 12);
        line1.addShapeMarkers(Shape.DIAMOND, Color.WHITE, 8);
        Line line2 = Plots.newLine(Data.newData(competition), SKYBLUE, "Competition.com");
        line2.setLineStyle(LineStyle.newLineStyle(3, 1, 0));
        line2.addShapeMarkers(Shape.DIAMOND, SKYBLUE, 12);
        line2.addShapeMarkers(Shape.DIAMOND, Color.WHITE, 8);


        // Defining chart.
        LineChart chart = GCharts.newLineChart(line1, line2);
        chart.setSize(600, 450);
View Full Code Here

        inflation[0] = sp500[0];
        for (int i = 1; i < inflation.length; i++) {
            inflation[i] = inflation[i-1] *INFLATION + inflation[i-1];
        }

        Line line1 = Plots.newLine(DataUtil.scaleWithinRange(0,1500,sp500), YELLOW, "S & P 500");
        line1.setLineStyle(LineStyle.newLineStyle(3, 1, 0));
        line1.addShapeMarkers(Shape.CIRCLE, YELLOW, 10);
        line1.addShapeMarkers(Shape.CIRCLE, BLACK, 7);
        line1.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, BLUE,3,8);
        line1.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, BLUE,3,17);
        line1.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, BLUE,3,24);
        line1.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, BLUE,3,40);
        line1.setFillAreaColor(LIGHTYELLOW);

        Line line2 = Plots.newLine(DataUtil.scaleWithinRange(0,1500,inflation), LIMEGREEN, "Inflation");
        line2.setLineStyle(LineStyle.newLineStyle(3, 1, 0));
        line2.addShapeMarkers(Shape.CIRCLE, LIME, 10);
        line2.addShapeMarkers(Shape.CIRCLE, BLACK, 7);
        line2.setFillAreaColor(LIGHTGREEN);


        // Defining chart.
        LineChart chart = GCharts.newLineChart(line1,line2);
        chart.setSize(600, 450);
View Full Code Here

    @Override
    public String getURLString(final int x, final int y) {

        try {
       
            final Line valuesLine = Plots.newLine(DataUtil.scale(state.getScaledData()));
            valuesLine.setColor(dataColor);

            // scaled data
            final int averageValue = (int) state.scale(state.getAverage());
            final Line avgLine = Plots.newLine(new Data(averageValue, averageValue));
            avgLine.setColor(averageColor);

            // put lines on the graph
            final Line[] lines = new Line[2];
            lines[0] = valuesLine;
            lines[1] = avgLine;
View Full Code Here

  @Override
  public String getURLString(int x, int y, String title) {
        try {
       
            Line valuesLine = Plots.newLine(DataUtil.scale(state.getScaledData()));
            valuesLine.setColor(dataColor);
    
            /* 
            final double red = (double)constants.getInteger("redSlice");
            Line redLine = Plots.newLine(new Data(red/10, red/10));
            redLine.setColor(Color.RED);
           
            final double orange = (double)constants.getInteger("orangeSlice");
            Line orangeLine = Plots.newLine(new Data(orange/10, orange/10));
            orangeLine.setColor(Color.BROWN);
          */
    /*
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.YELLOW, 2, constants.getInteger(BeamGUI.yellowX1));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.YELLOW, 2, constants.getInteger(BeamGUI.yellowX2));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.YELLOW, 2, constants.getInteger(BeamGUI.yellowY1));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.YELLOW, 2, constants.getInteger(BeamGUI.yellowY2));
       
      
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.RED, 2, constants.getInteger(BeamGUI.redX1));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.RED, 2, constants.getInteger(BeamGUI.redX2));          
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.RED, 2, constants.getInteger(BeamGUI.redY1));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.RED, 2, constants.getInteger(BeamGUI.redY2));
      
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.ORANGE, 2, constants.getInteger(BeamGUI.orangeX1));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.ORANGE, 2, constants.getInteger(BeamGUI.orangeX2));          
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.ORANGE, 2, constants.getInteger(BeamGUI.orangeY1));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_PARTIAL, Color.ORANGE, 2, constants.getInteger(BeamGUI.orangeY2));
         
             */
        
            // grid
          
            //  valuesLine.addShapeMarker(Shape.HORIZONTAL_LINE, Color.BLUE, 1, 3);
           
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_FULL, Color.BLACK, 1, (state.size()/2));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_FULL, Color.BLACK, 1, (state.size()/4));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_FULL, Color.BLACK, 1, ((state.size()/2) + (state.size()/4)));
           
            LineChart chart = GCharts.newLineChart(new Line[] {valuesLine}); // , redLine, orangeLine});

            // set the size
            chart.setSize(x, y);
View Full Code Here

    }

  public String getURLString(int x, int y, String title) {
        try {
       
            Line valuesLine = Plots.newLine(DataUtil.scale(state.getScaledData()));
            valuesLine.setColor(Color.BLUE);
            valuesLine.setFillAreaColor(Color.LIGHTGREY);
           
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_FULL, Color.BLACK, 2, (state.size()/2));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_FULL, Color.BLACK, 2, (state.size()/4));
            valuesLine.addShapeMarker(Shape.VERTICAL_LINE_FULL, Color.BLACK, 2, ((state.size()/2) + (state.size()/4)));
          
            LineChart chart = GCharts.newLineChart(new Line[] {valuesLine});

            // set the size
            chart.setSize(x, y);
View Full Code Here

TOP

Related Classes of com.googlecode.charts4j.Line

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.