Example usage for org.jfree.chart.renderer.category GanttRenderer setDrawBarOutline

List of usage examples for org.jfree.chart.renderer.category GanttRenderer setDrawBarOutline

Introduction

In this page you can find the example usage for org.jfree.chart.renderer.category GanttRenderer setDrawBarOutline.

Prototype

public void setDrawBarOutline(boolean draw) 

Source Link

Document

Sets the flag that controls whether or not bar outlines are drawn and sends a RendererChangeEvent to all registered listeners.

Usage

From source file:org.jfree.chart.demo.GanttDemo3.java

private static JFreeChart createChart(IntervalCategoryDataset intervalcategorydataset) {
    JFreeChart jfreechart = ChartFactory.createGanttChart("Gantt Chart Demo", "Task", "Date",
            intervalcategorydataset, true, true, false);
    CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
    categoryplot.getDomainAxis().setMaximumCategoryLabelWidthRatio(10F);
    DateAxis dateaxis = (DateAxis) categoryplot.getRangeAxis();
    dateaxis.setUpperMargin(0.20000000000000001D);
    GanttRenderer ganttrenderer = (GanttRenderer) categoryplot.getRenderer();
    ganttrenderer.setDrawBarOutline(false);
    ganttrenderer.setBaseItemLabelGenerator(new MyLabelGenerator(new SimpleDateFormat("d-MMM")));
    ganttrenderer.setBaseItemLabelsVisible(true);
    ganttrenderer.setBasePositiveItemLabelPosition(
            new ItemLabelPosition(ItemLabelAnchor.OUTSIDE3, TextAnchor.CENTER_LEFT));
    return jfreechart;
}

From source file:graficos.GraficoGantt.java

private static JFreeChart crearGrafico(IntervalCategoryDataset cjto_datos) {
    JFreeChart grafico = ChartFactory.createGanttChart("Diagrama de Gantt", // Ttulo
            "Actividad", // Ttulo eje x
            "Fecha", // Ttulo eje y
            cjto_datos, // Datos
            true, // Incluir leyenda
            true, // Incluir tooltips
            false // Incluir URLs
    );//from  ww w  . j  a  va2 s.  com
    grafico.setBackgroundPaint(new Color(240, 240, 240));
    grafico.getPlot().zoom(0.0);
    CategoryPlot categoriaPlot = (CategoryPlot) grafico.getPlot();
    GanttRenderer renderer = (GanttRenderer) categoriaPlot.getRenderer();
    renderer.setDrawBarOutline(true);
    // GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, new Color(102, 255, 102), 0.0f, 0.0f, new Color(102, 255, 102));
    renderer.setSeriesPaint(0, new Color(48, 239, 48));
    renderer.setSeriesPaint(1, Color.RED);
    grafico.getPlot().setOutlineVisible(true);
    return grafico;
}