Example usage for org.jfree.chart StandardChartTheme createLegacyTheme

List of usage examples for org.jfree.chart StandardChartTheme createLegacyTheme

Introduction

In this page you can find the example usage for org.jfree.chart StandardChartTheme createLegacyTheme.

Prototype

public static ChartTheme createLegacyTheme() 

Source Link

Document

Creates and returns a ChartTheme that doesn't apply any changes to the JFreeChart defaults.

Usage

From source file:net.sourceforge.processdash.ui.web.reports.DashboardChartDefaults.java

public static void initialize() {
    // install the legacy theme for chart colors
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    // turn off shadows on bar charts by default
    BarRenderer.setDefaultShadowsVisible(false);
    XYBarRenderer.setDefaultShadowsVisible(false);
    // the standard set of colors includes yellow, which is nearly
    // impossible to see on a white background. Replace those yellows with
    // variations on orange.
    DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE[3] = Color.orange;
    DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE[18] = new Color(215, 170, 0);
    DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE[31] = new Color(255, 200, 128);
}

From source file:storybook.ui.chart.AbstractChartPanel.java

public AbstractChartPanel(MainFrame paramMainFrame, String paramString) {
    super(paramMainFrame);
    this.chartTitle = I18N.getMsg(paramString);

    // ChartFactory??
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
}

From source file:org.pentaho.plugin.jfreereport.reportcharts.LegacyChartModule.java

/**
 * Initializes the module. Use this method to perform all initial setup operations. This method is called only once in
 * a modules lifetime. If the initializing cannot be completed, throw a ModuleInitializeException to indicate the
 * error,. The module will not be available to the system.
 *
 * @param subSystem the subSystem.//from   w  w  w . j a  v  a 2 s.  c  o m
 * @throws ModuleInitializeException if an error occurred while initializing the module.
 */
public void initialize(final SubSystem subSystem) throws ModuleInitializeException {
    ElementMetaDataParser.initializeOptionalExpressionsMetaData(
            "org/pentaho/plugin/jfreereport/reportcharts/meta-xy-chart-expressions.xml");
    ElementMetaDataParser.initializeOptionalExpressionsMetaData(
            "org/pentaho/plugin/jfreereport/reportcharts/meta-other-chart-expressions.xml");
    ElementMetaDataParser.initializeOptionalExpressionsMetaData(
            "org/pentaho/plugin/jfreereport/reportcharts/meta-categorical-chart-expressions.xml");
    ElementMetaDataParser.initializeOptionalExpressionsMetaData(
            "org/pentaho/plugin/jfreereport/reportcharts/meta-collector-expressions.xml");

    // Set the ChartFactory to the Legacy Theme
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());

}

From source file:fi.smaa.jsmaa.gui.JSMAAMainFrame.java

public JSMAAMainFrame(SMAAModel model) {
    super(AppInfo.getAppName());

    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    ToolTipManager.sharedInstance().setInitialDelay(0);
    setPreferredSize(new Dimension(950, 700));
    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

    modelManager = new ModelFileManager();
    modelManager.addPropertyChangeListener(ModelFileManager.PROPERTY_TITLE, new PropertyChangeListener() {
        @Override//w  w w.ja  va  2 s  .  c  o  m
        public void propertyChange(PropertyChangeEvent ev) {
            setTitle((String) ev.getNewValue());
        }
    });
    modelManager.addPropertyChangeListener(ModelFileManager.PROPERTY_MODEL, new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            initWithModel((SMAAModel) evt.getNewValue());
        }
    });
    modelManager.setModel(model);
}

From source file:ec.nbdemetra.ui.demo.ComponentsDemo.java

private static void initStaticResources() {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    BarRenderer.setDefaultBarPainter(new StandardBarPainter());
    UIManager.put("Nb.Editor.Toolbar.border", BorderFactory.createLineBorder(Color.WHITE));
    TsFactory.instance.add(new FakeTsProvider());
}

From source file:entropy.plan.visualization.GanttVisualizer.java

/**
 * Build the plan agenda/*  w ww .  j a  v  a 2  s. c om*/
 *
 * @param plan the plan to visualize
 * @return {@code true} if the generation succeeds
 */
@Override
public boolean buildVisualization(TimedReconfigurationPlan plan) {
    File parent = new File(out).getParentFile();
    if (parent != null && !parent.exists() && !parent.mkdirs()) {
        Plan.logger.error("Unable to create '" + out + "'");
        return false;
    }
    final TaskSeriesCollection collection = new TaskSeriesCollection();
    TaskSeries ts = new TaskSeries("actions");
    for (Action action : plan) {
        Task t = new Task(action.toString(),
                new SimpleTimePeriod(action.getStartMoment(), action.getFinishMoment()));
        ts.add(t);
    }
    collection.add(ts);
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());

    final JFreeChart chart = ChartFactory.createGanttChart(null, // chart title
            "Actions", // domain axis label
            "Time", // range axis label
            collection, // data
            false, // include legend
            true, // tooltips
            false // urls
    );
    CategoryPlot plot = chart.getCategoryPlot();
    DateAxis da = (DateAxis) plot.getRangeAxis();
    SimpleDateFormat sdfmt = new SimpleDateFormat();
    sdfmt.applyPattern("S");
    da.setDateFormatOverride(sdfmt);
    ((GanttRenderer) plot.getRenderer()).setShadowVisible(false);
    int width = 500 + 10 * plan.getDuration();
    int height = 50 + 20 * plan.size();
    try {
        switch (fmt) {
        case png:
            ChartUtilities.saveChartAsPNG(new File(out), chart, width, height);
            break;
        case jpg:
            ChartUtilities.saveChartAsJPEG(new File(out), chart, width, height);
            break;
        }
    } catch (IOException e) {
        Plan.logger.error(e.getMessage(), e);
        return false;
    }
    return true;
}

From source file:org.uncommons.watchmaker.swing.evolutionmonitor.EvolutionMonitor.java

private void init(Renderer<? super T, JComponent> renderer) {
    // Make sure all JFreeChart charts are created with the legacy theme
    // (grey surround and white data area).
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());

    JTabbedPane tabs = new JTabbedPane();
    monitorComponent = new JPanel(new BorderLayout());
    monitorComponent.add(tabs, BorderLayout.CENTER);

    FittestCandidateView<T> candidateView = new FittestCandidateView<T>(renderer);
    tabs.add("Fittest Individual", candidateView);
    views.add(new SwingIslandEvolutionObserver<T>(candidateView, 300, TimeUnit.MILLISECONDS));

    PopulationFitnessView fitnessView = new PopulationFitnessView(islands);
    tabs.add(islands ? "Global Population" : "Population Fitness", fitnessView);
    views.add(fitnessView);/* www  .  j a  v  a 2  s  . co  m*/

    if (islands) {
        IslandsView islandsView = new IslandsView();
        tabs.add("Island Populations", islandsView);
        views.add(new SwingIslandEvolutionObserver<Object>(islandsView, 300, TimeUnit.MILLISECONDS));
    }

    JVMView jvmView = new JVMView();
    tabs.add("JVM Memory", jvmView);

    StatusBar statusBar = new StatusBar(islands);
    monitorComponent.add(statusBar, BorderLayout.SOUTH);
    views.add(new SwingIslandEvolutionObserver<Object>(statusBar, 300, TimeUnit.MILLISECONDS));
}

From source file:org.sbml.bargraph.MainWindow.java

/**
 * Creates an empty bar graph.//from   ww w.  j  a  v  a  2  s. com
 * @return
 */
public JFreeChart createModelBarGraph() {
    // Initialize the style. Have to do this before creating charts.

    BarRenderer.setDefaultShadowsVisible(false);
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());

    // Create the actual chart.

    chartData = new DefaultCategoryDataset();
    JFreeChart chart = ChartFactory.createBarChart(null, // chart title
            null, // domain axis label
            "Total count", // range axis label
            chartData, // data
            PlotOrientation.HORIZONTAL, // orientation
            false, // include legend
            false, // tooltips?
            false // URLs?
    );

    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setRangeGridlinePaint(Color.lightGray);
    plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 12));

    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 12));

    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setSeriesPaint(0, new Color(0, 101, 178));

    return chart;
}

From source file:org.talend.dataprofiler.chart.TOPChartService.java

@Override
public Object createBenfordChartByKCD(String axisXLabel, String categoryAxisLabel, Object dataset,
        Object customerDataset, List<String> dotChartLabels, double[] formalValues, String title) {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    Object barChart = ChartFactory.createBarChart(null, axisXLabel, categoryAxisLabel,
            (CategoryDataset) dataset, PlotOrientation.VERTICAL, false, true, false);
    Object lineChart = ChartDecorator.decorateBenfordLawChartByKCD((CategoryDataset) dataset, customerDataset,
            (JFreeChart) barChart, title, categoryAxisLabel, dotChartLabels, formalValues);
    return lineChart;

}

From source file:jhplot.HPlotChart.java

/**
    * Set a custom theme for chart.. It can be: LEGACY_THEME, JFREE_THEME,
    * DARKNESS_THEME/*from  ww  w . j  a va2  s  .  c  o m*/
    * 
    * @param s
    *            a theme, can be either LEGACY_THEME, JFREE_THEME,
    *            DARKNESS_THEME
    */
public void setTheme(String s) {

    if (s.equals("LEGACY_THEME")) {
        ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
        ChartUtilities.applyCurrentTheme(chart);
    } else if (s.equals("JFREE_THEME")) {
        ChartFactory.setChartTheme(StandardChartTheme.createJFreeTheme());
        ChartUtilities.applyCurrentTheme(chart);
    } else if (s.equals("DARKNESS_THEME")) {
        ChartFactory.setChartTheme(StandardChartTheme.createDarknessTheme());
        ChartUtilities.applyCurrentTheme(chart);

    }
}