Ejemplo n.º 1
0
        /// <summary>
        /// Create the chart using the data.
        /// </summary>
        private JFreeChart createChart(DefaultTableXYDataset dataset)
        {
            string xlabel = "Surface Area (ACRE)";

            if (__type.Equals("Seepage"))
            {
                xlabel = "Seepage (AF/M)";
            }
            JFreeChart chart = ChartFactory.createXYLineChart("Reservoir Content/" + __type + " Curve", xlabel, "Content (ACFT)", dataset, PlotOrientation.VERTICAL, false, true, false);

            chart.addSubtitle(new TextTitle(__res.getID() + " (" + __res.getName() + ")"));
            //TextTitle source = new TextTitle("Source: rgtTW.res");
            //source.setFont(new Font("SansSerif", Font.PLAIN, 10));
            //source.setPosition(RectangleEdge.BOTTOM);
            //source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
            //chart.addSubtitle(source);

            chart.setBackgroundPaint(Color.WHITE);

            XYPlot plot = (XYPlot)chart.getPlot();

            plot.setBackgroundPaint(Color.white);
            plot.setRangeGridlinePaint(Color.lightGray);

            NumberAxis rangeAxis = (NumberAxis)plot.getRangeAxis();

            rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

            return(chart);
        }