Package org.jfree.chart

Examples of org.jfree.chart.ChartPanel


        if (chart != null) {
            chart.getPlot().setNoDataMessage(resources.getString("No_Data_Message"));
            adjustPlot((P) chart.getPlot(), data, environment, parameters);
        }
       
        ChartPanel panel = getChartPanel(chart, data);
        panel.setInitialDelay(50);
        panel.setDismissDelay(60000);
       
        return panel;
    }
View Full Code Here


    protected D getAdjustedData(D data) { return data; }
   
    protected void adjustPlot(P plot, D data, Map environment, Map parameters) { }
   
    protected ChartPanel getChartPanel(JFreeChart chart, D data) {
        return new ChartPanel(chart);
    }
View Full Code Here

    public void writeChartAsHtml(Writer out, Map environment, Map parameters)
            throws IOException {
        Map htmlEnv = new HashMap(environment);
        htmlEnv.put(EVSnippetEnvironment.HTML_OUTPUT_KEY, Boolean.TRUE);
        D dataset = createDataset(htmlEnv, parameters);
        ChartPanel chartPanel = buildChart(dataset, htmlEnv, parameters);
        JFreeChart chart = chartPanel.getChart();
        if (chart != null) {
            new HtmlWriter(out, parameters, chart).writeChartHtml();
        }
    }
View Full Code Here

    this.maxRange = maxRange;

    this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
    this.setBorder(BorderFactory.createEtchedBorder());

    ChartPanel chartPanel = new ChartPanel(chart);
    this.add(chartPanel);

    configureChart();

    chartPanel.addChartMouseListener(this);
    model.addChangeListener(this);
  }
View Full Code Here

    this.showErrorBars = true;
    this.showCrossHairs = true;

    // Create a chart with legend, tooltips, and URLs showing
    // and add it to the panel.
    this.chartPanel = new ChartPanel(ChartFactory.createScatterPlot(title,
        domainTitle, rangeTitle, obsModel, PlotOrientation.VERTICAL,
        true, true, true));

    this.chartPanel.setPreferredSize(bounds);
View Full Code Here

   *            The desired width of the image.
   * @param height
   *            The desired height of the image.
   */
  public void saveCurrentPlotToFile(File file, int width, int height) {
    ChartPanel chart = analysisTypeMap.get(analysisType)
        .getObsAndMeanChartPane().getChartPanel();

    try {
      ChartUtilities
          .saveChartAsPNG(file, chart.getChart(), width, height);
    } catch (IOException e) {
      MessageBox.showErrorDialog("Save plot to file",
          "Cannot save plot to " + "'" + file.getPath() + "'.");
    }
  }
View Full Code Here

   * @param parent
   *            The parent component of the file dialog.
   */
  private void savePlotToFile(Component parent) {
    try {
      ChartPanel chartPanel = analysisTypeMap.get(analysisType)
          .getObsAndMeanChartPane().getChartPanel();

      if (imageSaveDialog.showDialog(parent)) {
        File path = imageSaveDialog.getSelectedFile();
        JFreeChart chart = chartPanel.getChart();
        int width = chartPanel.getWidth();
        int height = chartPanel.getHeight();

        ChartUtilities.saveChartAsPNG(path, chart, width, height);
      }
    } catch (IOException ex) {
      MessageBox.showErrorDialog(parent,
View Full Code Here

     *
     * @return A panel.
     */
    public static JPanel createDemoPanel() {
        JFreeChart chart = createChart(createDataset());
        ChartPanel panel = new ChartPanel(chart);
        panel.setMouseWheelEnabled(true);
        return panel;
    }
View Full Code Here

    createDatasetPV(rsPVProfileWinter, "PV Winter", qPVMaxPowerValues[2]);
   
    //some instructions to draw the chart
    XYDataset dataset = xySeriesCollDataset;
    JFreeChart chart = createChart(dataset);
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    setContentPane(chartPanel);   
  }
View Full Code Here

  private void createFrame(
      String chartName,
      String eventType,
      ParCollection params,
      JFreeChart chart) {
    ChartPanel chartPanel = new ChartPanel(chart);
    JFrame frame = new JFrame(eventType + " [" + chartName + "]");
    frame.getContentPane().add(chartPanel, BorderLayout.CENTER);
    frame.setBounds(200, 120, 600, 280);
    if (params.getParValueBoolean("showLiveCharts?")) {
        frame.setVisible(true);
View Full Code Here

TOP

Related Classes of org.jfree.chart.ChartPanel

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.