Package com.googlecode.charts4j

Examples of com.googlecode.charts4j.ScatterPlot


        ScatterPlotData data = Plots.newScatterPlotData(d1, d2, pointSizes);
        data.setLegend("Diamond");
        Color diamondColor = Color.newColor("FF471A");
        data.addShapeMarkers(Shape.DIAMOND, diamondColor, 30);
        data.setColor(diamondColor);
        ScatterPlot chart = GCharts.newScatterPlot(data);
        chart.setSize(600, 450);
        chart.setGrid(20, 20, 3, 2);

        AxisLabels axisLabels = AxisLabelsFactory.newNumericRangeAxisLabels(0, 100);
        axisLabels.setAxisStyle(AxisStyle.newAxisStyle(WHITE, 13, AxisTextAlignment.CENTER));

        chart.addXAxisLabels(axisLabels);
        chart.addYAxisLabels(axisLabels);

        chart.setTitle("Scatter Plot", WHITE, 16);
        chart.setBackgroundFill(Fills.newSolidFill(Color.newColor("2F3E3E")));
        LinearGradientFill fill = Fills.newLinearGradientFill(0, Color.newColor("3783DB"), 100);
        fill.addColorAndOffset(Color.newColor("9BD8F5"), 0);
        chart.setAreaFill(fill);
        String url = chart.toURLString();
        // EXAMPLE CODE END. Use this url string in your web or
        // Internet application.
        Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(url);
        String expectedString = "http://chart.apis.google.com/chart?chf=bg,s,2F3E3E|c,lg,0,3783DB,1.0,9BD8F5,0.0&chs=600x450&chd=e:GagATNczpm8yMzzM,MzZmZmJm2Z8yzMMz,..TNgAv.ZmWZzM..&chtt=Scatter+Plot&chts=FFFFFF,16&chg=20.0,20.0,3,2&chxt=y,x&chxr=0,0.0,100.0|1,0.0,100.0&chxs=0,FFFFFF,13,0|1,FFFFFF,13,0&chco=FF471A&chdl=Diamond&chm=d,FF471A,0,-1,30,0&cht=s";
        assertEquals("Junit error", normalize(expectedString), normalize(url));
View Full Code Here


        lineChart.setSize(400, 200);
        BarChart barChart = GCharts.newBarChart(plot);
        barChart.setSize(400, 200);
        RadarChart radarChart = GCharts.newRadarChart(plot);
        radarChart.setSize(400, 200);
        ScatterPlot  scatterChart = GCharts.newScatterPlot(plot);
        scatterChart.setSize(400, 200);
        XYLineChart  xyLineChart = GCharts.newXYLineChart(plot);
        xyLineChart.setSize(400, 200);


        String lineChartUrl = lineChart.toURLString();
        String barChartUrl = barChart.toURLString();
        String radarChartUrl = radarChart.toURLString();
        String scatterChartUrl = scatterChart.toURLString();
        String xyLineChartUrl = xyLineChart.toURLString();

        // EXAMPLE CODE END. Use these URLs string in your web or
        // Internet application.
View Full Code Here

TOP

Related Classes of com.googlecode.charts4j.ScatterPlot

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.