Package com.googlecode.charts4j

Examples of com.googlecode.charts4j.XYLineChart$XYPoint


        minLine.setLineStyle(LineStyle.THIN_LINE);
        minLine.setLegend("Min");


        String title = String.format("%s (k=%d, %d trials per data point)", estimator, k, NUM_TRIALS);
        XYLineChart chart = GCharts.newXYLineChart(maxLine, meanLine, minLine);

        /*
        List<String> xAxisLabels = new ArrayList<String>(xData.length);
        for(int i=0; i<xData.length; i++)
        {
            if(i % (xData.length / 10) == 0)
            {
                double d = xData[i];
                xAxisLabels.add(shortenNumericLabel(d));
            }
        }
           
        chart.addXAxisLabels(AxisLabelsFactory.newAxisLabels(xAxisLabels));
        */
        chart.addXAxisLabels(AxisLabelsFactory.newNumericRangeAxisLabels(xData[0], xData[xData.length - 1]));
        chart.addXAxisLabels(AxisLabelsFactory.newAxisLabels("Cardinality", 50));
        chart.addYAxisLabels(AxisLabelsFactory.newNumericRangeAxisLabels(minMin * 100, maxMax * 100));
        chart.addYAxisLabels(AxisLabelsFactory.newAxisLabels("% Error", 50));
        chart.setTitle(title);
        chart.setSize(533, 400);
        chart.setMargins(25, 25, 25, 25);

        double good = DataUtil.scaleWithinRange(minMin, maxMax, new double[]{0.01}).getData()[0];
        double bad = DataUtil.scaleWithinRange(minMin, maxMax, new double[]{0.03}).getData()[0];
        double wrong = DataUtil.scaleWithinRange(minMin, maxMax, new double[]{0.05}).getData()[0];

        if (0 <= good && good < 100) {
            chart.addHorizontalRangeMarker(good, Math.min(bad, 100), Color.LIGHTGREEN);
        }
        if (0 <= bad && bad < 100) {
            chart.addHorizontalRangeMarker(bad, Math.min(wrong, 100), Color.LIGHTGOLDENRODYELLOW);
        }
        if (wrong < 100) {
            chart.addHorizontalRangeMarker(Math.max(wrong, 0), 100, Color.LIGHTCORAL);
        }


        String url = chart.toURLForHTML();

        // Somewhat less than clean
        String pageStart = "<html><head><title>" + title + "</title></head><body>";
        String img = String.format("<img src=\"%s\"/>", url);
        String pageEnd = "</body></html>";
View Full Code Here


        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.

        Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(lineChartUrl);
View Full Code Here

        Data data1 = Data.newData(x);
        Data data2 = Data.newData(y);
        XYLine line = Plots.newXYLine(data1, data2);
        line.setColor(Color.newColor("27FEF6"));
        XYLineChart chart = GCharts.newXYLineChart(line);
        chart.setSize(500, 500);
        chart.setTitle("Lissajous curve", WHITE, 16);
        chart.setBackgroundFill(Fills.newSolidFill(Color.newColor("121411")));
        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);
        Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(url.length() + "");
        String expectedString = "http://chart.apis.google.com/chart?cht=lxy&chs=500x500&chts=FFFFFF,16&chco=27FEF6&chf=bg,s,121411&chd=e:gAlMqQvBzY3N6Y80-e.R.N-R8g582qywuVpgkbfNaBVAQSMAIRFMC3BWArA4B7D0GgJ4N3SXXPcWhkmvruwZ0m4O7M9a-z.W.B91705C1jxes6oAi3dpYfTiO8K0HREaCVBDApBGCaEjHcLBPLTzYwd6jIoRtLxt1w5M7896.D.V-w9T7D4D0YwJremehScFW-SHNpJrGVDtB2A2AsBaC-FWIdMNQhVQaTffkspxuly.236G8n-W.O.Q-Z8t6O3BzKuyp.k7fuahVeQuMZImFeDEBdAtA0ByDmGNJhNdR6Wwb2hEmPrQv90N36689O-t.V.F9.8D5V17x5tYofj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BHAqA5B1DcFtIjL7PwT8YZdChumZq6vLzG2m5m8B9z-7.W.E-F8c6J3Rz3wBrznViseAZWU2QlMrJNGPD3CHBCApA9B-DrF.I6MVQNUbY6djiQm6rZvozh29558P99.A.W-.988N5226zdvkrUm0iLdeY1UWQIMRI2F8DoB9A9ApBC&chtt=Lissajous+curve";
View Full Code Here

TOP

Related Classes of com.googlecode.charts4j.XYLineChart$XYPoint

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.