IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

2D Java Discussion :

[JFreeChart] Creer diagramme en pyramide


Sujet :

2D Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé Avatar de L8O8L
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    148
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 148
    Par défaut [JFreeChart] Creer diagramme en pyramide
    Salut!

    Comment puis-je créer un diagramme en pyramide ac JFreeChart?
    Si vous voyez pas ce que je veux dire... Moi non plus ^^ Mais c'est le patron qui demande alors.... ^^

  2. #2
    Membre confirmé Avatar de L8O8L
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    148
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 148
    Par défaut
    Ou alors une pyramide genre pyramide des ages...

  3. #3
    Membre confirmé Avatar de L8O8L
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    148
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 148
    Par défaut
    up

  4. #4
    Membre confirmé Avatar de L8O8L
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    148
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 148
    Par défaut
    C bon j'ai trouver quelque chose en cherchant.

    Pour ceux que ca interresse, voici ce que j'ai trouvé :

    Post de David Gilbert, sur le forum de jfree.org

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    package org.jfree.chart.demo;
     
    import org.jfree.chart.JFreeChart;
    import org.jfree.chart.ChartFactory;
    import org.jfree.chart.ChartPanel;
    import org.jfree.chart.plot.CategoryPlot;
    import org.jfree.data.DefaultKeyedValues2DDataset;
    import org.jfree.data.KeyedValues2DDataset;
    import org.jfree.ui.ApplicationFrame;
    import org.jfree.ui.RefineryUtilities;
     
    /**
     * A population pyramid demo.
     *
     * @author David Gilbert
     */
    public class PopulationChartDemo extends ApplicationFrame {
     
        /**
         * Creates a new demo.
         *
         * @param title  the frame title.
         */
        public PopulationChartDemo(String title) {
     
            super(title);
            KeyedValues2DDataset dataset = createDataset();
     
            // create the chart...
            JFreeChart chart = ChartFactory.createStackedHorizontalBarChart(
                                                      "Population Chart Demo",
                                                      "Age Group",     // domain axis label
                                                      "Population (millions)", // range axis label
                                                      dataset,         // data
                                                      true,            // include legend
                                                      true,            // tooltips
                                                      false            // urls
                                                  );
     
            CategoryPlot plot = chart.getCategoryPlot();
     
            // add the chart to a panel...
            ChartPanel chartPanel = new ChartPanel(chart);
            chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
            setContentPane(chartPanel);
     
        }
     
        /**
        *
        */
       private KeyedValues2DDataset createDataset() {
     
            DefaultKeyedValues2DDataset data = new DefaultKeyedValues2DDataset();
          data.addValue( -6.0, "Male", "70+");
          data.addValue( -8.0, "Male", "60-69");
          data.addValue(-11.0, "Male", "50-59");
          data.addValue(-13.0, "Male", "40-49");
          data.addValue(-14.0, "Male", "30-39");
          data.addValue(-15.0, "Male", "20-29");
          data.addValue(-19.0, "Male", "10-19");
          data.addValue(-21.0, "Male", "0-9");
          data.addValue(10.0, "Female", "70+");
          data.addValue(12.0, "Female", "60-69");
          data.addValue(13.0, "Female", "50-59");
          data.addValue(14.0, "Female", "40-49");
          data.addValue(15.0, "Female", "30-39");
          data.addValue(17.0, "Female", "20-29");
          data.addValue(19.0, "Female", "10-19");
          data.addValue(20.0, "Female", "0-9");
          return data;
     
       }
     
       /**
         * Starting point for the demonstration application.
         *
         * @param args  ignored.
         */
        public static void main(String[] args) {
     
            PopulationChartDemo demo = new PopulationChartDemo("Population Chart Demo");
            demo.pack();
            RefineryUtilities.centerFrameOnScreen(demo);
            demo.setVisible(true);
     
        }
     
    }

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [JFreeChart] Problème diagramme Gantt
    Par Sancho_54 dans le forum 2D
    Réponses: 0
    Dernier message: 06/01/2010, 11h46
  2. Diagramme de Gantt avec JFreeChart 1.0.3 Demo
    Par mediateur59 dans le forum BIRT
    Réponses: 4
    Dernier message: 28/04/2007, 01h22
  3. [JFreeChart] Actualiser un diagramme
    Par Nasky dans le forum Multimédia
    Réponses: 1
    Dernier message: 03/03/2007, 23h11
  4. [JFreechart] changer les couleurs des barres d'un diagramme
    Par keumlebarbare dans le forum Servlets/JSP
    Réponses: 15
    Dernier message: 23/11/2006, 12h06
  5. Comment créer des diagrammes à l'aide de JFreeChart ?
    Par casho dans le forum Servlets/JSP
    Réponses: 1
    Dernier message: 06/10/2006, 16h56

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo