Reflex iText Sample

機能説明 (3/5)

グラフ

Reflex iTextでは、円グラフ(piechart)、棒グラフ(barchart)、折れ線グラフ(linechart)、 エリアグラフ(areachart)、時系列グラフ(timeserieschart)、ローソク足グラフ(candlestickchart)、 ガントチャート(ganttchart)を出力することができます。

piechart

円グラフを出力します。

属性style属性内容初期値指定方法
styletitle円グラフのタイトルPie Chart文字列
stylelegend下部に項目名の説明を表示するかどうかを指定truetrue/false
stylewidth500数値
styleheigth高さ500数値
styleabsolutex, absoluteyページ内の絶対座標(なし)ページ左下を基点とし、四角形の左下角の座標を指定。
stylecategory項目(なし。必須)エンティティの項目名 注)内容は一意とする。
stylevalue(なし。必須)エンティティの項目名
piechartタグの属性

piechartタグのサンプル

  • テンプレート (piechartsample.html)
    <?xml version="1.0" encoding="UTF-8" ?>
    <html>
    <head>
    </head>
    <body>
    
    <div class="_page" style="pagesize:B5; orientation:portrait;">
        <div class="_piechart" style="title:世界の人口(単位:億人);
            legend:true; width:150; height:180; absolutex:50; absolutey:500;
            category:country; value:population;" />
    </div>
    
    </body>
    </html>
    
    
  • エンティティ (PopulationList.java)
    package jp.reflexworks.test.model;
    
    import java.util.ArrayList;
    import java.util.List;
    
    public class PopulationList {
    
        public static List populationInfo;    // 項目名がクラス名と前方一致していないので、1ページのみ出力する
    
        public static List getPopulation() {
            return populationInfo;
        }
    
        public static void setPopulation(List population) {
            populationInfo = population;
        }
    
        static {
            setPopulation(getData());
        }
    
        public static List getData() {
    
            List populationList = new ArrayList();
    
            PopulationInfo population1 = new PopulationInfo();
            population1.country = "中国";
            population1.population = 13.3;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.country = "インド";
            population1.population = 11.4;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.country = "アメリカ";
            population1.population = 3;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.country = "インドネシア";
            population1.population = 2.3;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.country = "ブラジル";
            population1.population = 1.9;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.country = "パキスタン";
            population1.population = 1.6;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.country = "バングラディシュ";
            population1.population = 1.5;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.country = "ロシア";
            population1.population = 1.4;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.country = "ナイジェリア";
            population1.population = 1.4;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.country = "日本";
            population1.population = 1.3;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.country = "その他";
            population1.population = 28.0;
            populationList.add(population1);
    
            return populationList;
        }
    
    }
    
    
  • エンティティ (PopulationInfo.java)
    package jp.reflexworks.test.model;
    
    public class PopulationInfo {
    
        public String country;
        public String area;
        public String year;
        public double population;
    
    }
    
    
  • XML (populationlist.xml)
    <?xml version="1.0" encoding="UTF-8" ?>
    <populationList>
        <populationInfo>    <!-- 2階層目の項目名が1階層目の項目名と前方一致していないので、1ページのみ出力する -->
            <country>中国</country>
            <population>13.3</population>
        </populationInfo>
        <populationInfo>
            <country>インド</country>
            <population>11.4</population>
        </populationInfo>
        <populationInfo>
            <country>アメリカ</country>
            <population>3.0</population>
        </populationInfo>
        <populationInfo>
            <country>インドネシア</country>
            <population>2.3</population>
        </populationInfo>
        <populationInfo>
            <country>ブラジル</country>
            <population>1.9</population>
        </populationInfo>
        <populationInfo>
            <country>パキスタン</country>
            <population>1.6</population>
        </populationInfo>
        <populationInfo>
            <country>バングラディシュ</country>
            <population>1.5</population>
        </populationInfo>
        <populationInfo>
            <country>ロシア</country>
            <population>1.4</population>
        </populationInfo>
        <populationInfo>
            <country>ナイジェリア</country>
            <population>1.4</population>
        </populationInfo>
        <populationInfo>
            <country>日本</country>
            <population>1.3</population>
        </populationInfo>
        <populationInfo>
            <country>その他</country>
            <population>28.0</population>
        </populationInfo>
    </populationList>
    
    
  • JSON (populationlist.json)
    {"populationList" :
        {"populationInfo" :
            [{"country" : "中国", "population" : "13.3"},
             {"country" : "インド", "population" : "11.4"},
             {"country" : "アメリカ", "population" : "3"},
             {"country" : "インドネシア", "population" : "2.3"},
             {"country" : "ブラジル", "population" : "1.9"},
             {"country" : "パキスタン", "population" : "1.6"},
             {"country" : "バングラディシュ", "population" : "1.5"},
             {"country" : "ロシア", "population" : "1.4"},
             {"country" : "ナイジェリア", "population" : "1.4"},
             {"country" : "日本", "population" : "1.3"},
             {"country" : "その他", "population" : "28.0"}
            ]
        }
    }
    
    
  • Reflex iText 実行結果
    PiechartSample実行結果

categoryとvalueについて、二次元配列の項目を指定することもできます。

piechart(二次元配列項目)のサンプル

  • テンプレート (piechartarraysample.html)
    <?xml version="1.0" encoding="UTF-8" ?>
    <html>
    <head>
    </head>
    <body>
    
    <div class="_page" style="pagesize:B5; orientation:portrait;">
        <div class="_piechart" style="title:世界の人口 Array(単位:億人);
            legend:true; width:150; height:180; absolutex:50; absolutey:500;
            category:populationText-i-0; value:populationText-i-1;" />
    </div>
    
    </body>
    </html>
    
    
  • エンティティ (PopulationArray.java)
    package jp.reflexworks.test.model;
    
    import java.util.ArrayList;
    import java.util.List;
    
    public class PopulationArray {
    
        public static List populationText;
    
        public static List getPopulationText() {
            return populationText;
        }
    
        public static void setPopulationText(List populationList) {
            populationText = populationList;
        }
    
        static {
            setPopulationText(getTextData());
        }
    
        public static List getTextData() {
    
            List populationTextList = new ArrayList();
    
            PopulationText population1 = new PopulationText();
            population1._$$text = "中国";
            PopulationText population2 = new PopulationText();
            population2._$$text = "13.3";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            population1 = new PopulationText();
            population1._$$text = "インド";
            population2 = new PopulationText();
            population2._$$text = "11.4";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            population1 = new PopulationText();
            population1._$$text = "アメリカ";
            population2 = new PopulationText();
            population2._$$text = "3";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            population1 = new PopulationText();
            population1._$$text = "インドネシア";
            population2 = new PopulationText();
            population2._$$text = "2.3";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            population1 = new PopulationText();
            population1._$$text = "ブラジル";
            population2 = new PopulationText();
            population2._$$text = "1.9";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            population1 = new PopulationText();
            population1._$$text = "パキスタン";
            population2 = new PopulationText();
            population2._$$text = "1.6";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            population1 = new PopulationText();
            population1._$$text = "バングラディシュ";
            population2 = new PopulationText();
            population2._$$text = "1.5";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            population1 = new PopulationText();
            population1._$$text = "ロシア";
            population2 = new PopulationText();
            population2._$$text = "1.4";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            population1 = new PopulationText();
            population1._$$text = "ナイジェリア";
            population2 = new PopulationText();
            population2._$$text = "1.4";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            population1 = new PopulationText();
            population1._$$text = "日本";
            population2 = new PopulationText();
            population2._$$text = "1.3";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            population1 = new PopulationText();
            population1._$$text = "その他";
            population2 = new PopulationText();
            population2._$$text = "28.0";
            populationTextList.add(population1);
            populationTextList.add(population2);
    
            return populationTextList;
        }
    
    }
    
    
  • エンティティ (PopulationText.java)
    package jp.reflexworks.test.model;
    
    public class PopulationText {
    
        public final int _$$col = 2;
        public String _$$text;
    
    }
    
    
  • JSON (populationarray.json)
    {"populationArray" :
        {"populationText" :
            [["中国","13.3"],
             ["インド","11.4"],
             ["アメリカ","3"],
             ["インドネシア","2.3"],
             ["ブラジル","1.9"],
             ["パキスタン","1.6"],
             ["バングラディシュ","1.5"],
             ["ロシア","1.4"],
             ["ナイジェリア","1.4"],
             ["日本","1.3"],
             ["その他","28.0"]
            ]
        }
    }
    
    
  • Reflex iText 実行結果
    PiechartArraySample実行結果

barchart

棒グラフを出力します。

属性style属性内容初期値指定方法
styletitle棒グラフのタイトルBar Chart文字列
stylecategorylabel横軸(カテゴリ)のタイトルcategory文字列
stylevaluelabel縦軸(値)のタイトルvalue文字列
stylelegend下部に項目名の説明を表示するかどうかを指定truetrue/false
stylewidth500数値
styleheigth高さ500数値
styleabsolutex, absoluteyページ内の絶対座標(なし)ページ左下を基点とし、四角形の左下角の座標を指定。
stylevalue(なし。必須)エンティティの項目名
styleseries小項目(なし。必須)エンティティの項目名 注)内容は大項目と小項目で一意とする。
stylecategory大項目(なし。必須)エンティティの項目名 注)内容は大項目と小項目で一意とする
stylevaluelower縦軸(値)の最低表示値(なし)数値
stylevalueupper縦軸(値)の最大表示値(なし)数値
stylevaluepattern縦軸(値)目盛りの数値パターン(なし)java.text.DecimalFormat に設定するパターン
stylevalueunitcount縦軸(値)目盛りの表示単位(なし)数値
barchartタグの属性

barchartタグのサンプル

  • テンプレート (barchartsample.html)
    <?xml version="1.0" encoding="UTF-8" ?>
    <html>
    <head>
    </head>
    <body>
    
    <div class="_page" style="pagesize:B5; orientation:portrait;">
        <div class="_barchart" style="title:世界の人口(単位:100万人);
            legend:true; width:260; height:200; absolutex:50; absolutey:480;
            categorylabel:地域; valuelabel:人口; value:population; category:area; series:year;
            valuelower:50; valueupper:1000; valuepattern:####0; valueunitcount:50;" />
    </div>
    
    </body>
    </html>
    
    
  • エンティティ (PopulationAreaList.java)
    package jp.reflexworks.test.model;
    
    import java.util.ArrayList;
    import java.util.List;
    
    public class PopulationAreaList {
    
        public static List populationChart;
    
        public static List getPopulation() {
            return populationChart;
        }
    
        public static void setPopulation(List population) {
            populationChart = population;
        }
    
        static {
            setPopulation(getData());
        }
    
        public static List getData() {
    
            List populationList = new ArrayList();
    
            PopulationInfo population1 = new PopulationInfo();
            population1.area = "世界";
            population1.year = "1960";
            population1.population = 3032;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アフリカ";
            population1.year = "1960";
            population1.population = 282;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ラテンアメリカ";
            population1.year = "1960";
            population1.population = 220;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "北アメリカ";
            population1.year = "1960";
            population1.population = 204;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アジア";
            population1.year = "1960";
            population1.population = 1704;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ヨーロッパ";
            population1.year = "1960";
            population1.population = 605;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "オセアニア";
            population1.year = "1960";
            population1.population = 16;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "世界";
            population1.year = "1980";
            population1.population = 4451;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アフリカ";
            population1.year = "1980";
            population1.population = 480;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ラテンアメリカ";
            population1.year = "1980";
            population1.population = 364;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "北アメリカ";
            population1.year = "1980";
            population1.population = 256;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アジア";
            population1.year = "1980";
            population1.population = 2636;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ヨーロッパ";
            population1.year = "1980";
            population1.population = 693;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "オセアニア";
            population1.year = "1980";
            population1.population = 23;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "世界";
            population1.year = "2000";
            population1.population = 6124;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アフリカ";
            population1.year = "2000";
            population1.population = 821;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ラテンアメリカ";
            population1.year = "2000";
            population1.population = 523;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "北アメリカ";
            population1.year = "2000";
            population1.population = 316;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アジア";
            population1.year = "2000";
            population1.population = 3705;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ヨーロッパ";
            population1.year = "2000";
            population1.population = 729;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "オセアニア";
            population1.year = "2000";
            population1.population = 31;
            populationList.add(population1);
    
            return populationList;
        }
    
    }
    
    
  • エンティティ (PopulationInfo.java)
    package jp.reflexworks.test.model;
    
    public class PopulationInfo {
    
        public String country;
        public String area;
        public String year;
        public double population;
    
    }
    
    
  • XML (populationarealist.xml)
    <?xml version="1.0" encoding="UTF-8" ?>
    <populationAreaList>
        <populationInfo>
            <area>世界</area>
            <year>1960</year>
            <population>3032.0</population>
        </populationInfo>
        <populationInfo>
            <area>アフリカ</area>
            <year>1960</year>
            <population>282.0</population>
        </populationInfo>
        <populationInfo>
            <area>ラテンアメリカ</area>
            <year>1960</year>
            <population>220.0</population>
        </populationInfo>
        <populationInfo>
            <area>北アメリカ</area>
            <year>1960</year>
            <population>204.0</population>
        </populationInfo>
        <populationInfo>
            <area>アジア</area>
            <year>1960</year>
            <population>1704.0</population>
        </populationInfo>
        <populationInfo>
            <area>ヨーロッパ</area>
            <year>1960</year>
            <population>605.0</population>
        </populationInfo>
        <populationInfo>
            <area>オセアニア</area>
            <year>1960</year>
            <population>16.0</population>
        </populationInfo>
        <populationInfo>
            <area>世界</area>
            <year>1980</year>
            <population>4451.0</population>
        </populationInfo>
        <populationInfo>
            <area>アフリカ</area>
            <year>1980</year>
            <population>480.0</population>
        </populationInfo>
        <populationInfo>
            <area>ラテンアメリカ</area>
            <year>1980</year>
            <population>364.0</population>
        </populationInfo>
        <populationInfo>
            <area>北アメリカ</area>
            <year>1980</year>
            <population>256.0</population>
        </populationInfo>
        <populationInfo>
            <area>アジア</area>
            <year>1980</year>
            <population>2636.0</population>
        </populationInfo>
        <populationInfo>
            <area>ヨーロッパ</area>
            <year>1980</year>
            <population>693.0</population>
        </populationInfo>
        <populationInfo>
            <area>オセアニア</area>
            <year>1980</year>
            <population>23.0</population>
        </populationInfo>
        <populationInfo>
            <area>世界</area>
            <year>2000</year>
            <population>6124.0</population>
        </populationInfo>
        <populationInfo>
            <area>アフリカ</area>
            <year>2000</year>
            <population>821.0</population>
        </populationInfo>
        <populationInfo>
            <area>ラテンアメリカ</area>
            <year>2000</year>
            <population>523.0</population>
        </populationInfo>
        <populationInfo>
            <area>北アメリカ</area>
            <year>2000</year>
            <population>316.0</population>
        </populationInfo>
        <populationInfo>
            <area>アジア</area>
            <year>2000</year>
            <population>3705.0</population>
        </populationInfo>
        <populationInfo>
            <area>ヨーロッパ</area>
            <year>2000</year>
            <population>729.0</population>
        </populationInfo>
        <populationInfo>
            <area>オセアニア</area>
            <year>2000</year>
            <population>31.0</population>
        </populationInfo>
    </populationAreaList>
    
    
  • JSON (populationarealist.json)
    {"populationAreaList" :
        {"populationInfo" :
            [{"area" : "世界","year" : "1960","population" : "3032"},
             {"area" : "アフリカ","year" : "1960","population" : "282"},
             {"area" : "ラテンアメリカ","year" : "1960","population" : "220"},
             {"area" : "北アメリカ","year" : "1960","population" : "204"},
             {"area" : "アジア","year" : "1960","population" : "1704"},
             {"area" : "ヨーロッパ","year" : "1960","population" : "605"},
             {"area" : "オセアニア","year" : "1960","population" : "16"},
             {"area" : "世界","year" : "1980","population" : "4451"},
             {"area" : "アフリカ","year" : "1980","population" : "480"},
             {"area" : "ラテンアメリカ","year" : "1980","population" : "364"},
             {"area" : "北アメリカ","year" : "1980","population" : "256"},
             {"area" : "アジア","year" : "1980","population" : "2636"},
             {"area" : "ヨーロッパ","year" : "1980","population" : "693"},
             {"area" : "オセアニア","year" : "1980","population" : "23"},
             {"area" : "世界","year" : "2000","population" : "6124"},
             {"area" : "アフリカ","year" : "2000","population" : "821"},
             {"area" : "ラテンアメリカ","year" : "2000","population" : "523"},
             {"area" : "北アメリカ","year" : "2000","population" : "316"},
             {"area" : "アジア","year" : "2000","population" : "3705"},
             {"area" : "ヨーロッパ","year" : "2000","population" : "729"},
             {"area" : "オセアニア","year" : "2000","population" : "31"}
            ]
        }
    }
    
    
  • Reflex iText 実行結果
    BarchartSample実行結果

linechart

折れ線グラフを出力します。

属性style属性内容初期値指定方法
styletitle折れ線グラフのタイトルLine Chart文字列
stylecategorylabel横軸(カテゴリ)のタイトルcategory文字列
stylevaluelabel縦軸(値)のタイトルvalue文字列
stylelegend下部に項目名の説明を表示するかどうかを指定truetrue/false
stylewidth500数値
styleheigth高さ500数値
styleabsolutex, absoluteyページ内の絶対座標(なし)ページ左下を基点とし、四角形の左下角の座標を指定。
stylevalue(なし。必須)エンティティの項目名
styleseries系列(なし。必須)エンティティの項目名 注)内容は系列とカテゴリで一意とする
stylecategory横軸(カテゴリ)(なし。必須)エンティティの項目名 注)内容は系列とカテゴリで一意とする
stylevaluelower縦軸(値)の最低表示値(なし)数値
stylevalueupper縦軸(値)の最大表示値(なし)数値
stylevaluepattern縦軸(値)目盛りの数値パターン(なし)java.text.DecimalFormat に設定するパターン
stylevalueunitcount縦軸(値)目盛りの表示単位(なし)数値
linechartタグの属性

linechartタグのサンプル

  • テンプレート (linechartsample.html)
    <?xml version="1.0" encoding="UTF-8" ?>
    <html>
    <head>
    </head>
    <body>
    
    <div class="_page" style="pagesize:B5; orientation:portrait;">
        <div class="_linechart" style="title:世界の人口推移(単位:100万人);
            legend:true; width:260; height:200; absolutex:50; absolutey:480;
            categorylabel:人口; valuelabel:年; value:population; category:year; series:area;
            valueupper:1000; valuepattern:####0; valueunitcount:50;" />
    </div>
    
    </body>
    </html>
    
    
  • エンティティ (PopulationArea2List.java)
    package jp.reflexworks.test.model;
    
    import java.util.ArrayList;
    import java.util.List;
    
    public class PopulationArea2List {
    
        public static List populationChart;
    
        public static List getPopulation() {
            return populationChart;
        }
    
        public static void setPopulation(List population) {
            populationChart = population;
        }
    
        static {
            setPopulation(getData());
        }
    
        public static List getData() {
    
            List populationList = new ArrayList();
    
            PopulationInfo population1 = new PopulationInfo();
            population1.area = "アフリカ";
            population1.year = "1960";
            population1.population = 282;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ラテンアメリカ";
            population1.year = "1960";
            population1.population = 220;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "北アメリカ";
            population1.year = "1960";
            population1.population = 204;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アジア";
            population1.year = "1960";
            population1.population = 1704;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ヨーロッパ";
            population1.year = "1960";
            population1.population = 605;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "オセアニア";
            population1.year = "1960";
            population1.population = 16;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アフリカ";
            population1.year = "1970";
            population1.population = 364;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ラテンアメリカ";
            population1.year = "1970";
            population1.population = 288;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "北アメリカ";
            population1.year = "1970";
            population1.population = 232;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アジア";
            population1.year = "1970";
            population1.population = 2139;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ヨーロッパ";
            population1.year = "1970";
            population1.population = 657;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "オセアニア";
            population1.year = "1970";
            population1.population = 20;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アフリカ";
            population1.year = "1980";
            population1.population = 480;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ラテンアメリカ";
            population1.year = "1980";
            population1.population = 364;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "北アメリカ";
            population1.year = "1980";
            population1.population = 256;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アジア";
            population1.year = "1980";
            population1.population = 2636;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ヨーロッパ";
            population1.year = "1980";
            population1.population = 693;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "オセアニア";
            population1.year = "1980";
            population1.population = 23;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アフリカ";
            population1.year = "1990";
            population1.population = 637;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ラテンアメリカ";
            population1.year = "1990";
            population1.population = 444;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "北アメリカ";
            population1.year = "1990";
            population1.population = 284;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アジア";
            population1.year = "1990";
            population1.population = 3181;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ヨーロッパ";
            population1.year = "1990";
            population1.population = 721;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "オセアニア";
            population1.year = "1990";
            population1.population = 27;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アフリカ";
            population1.year = "2000";
            population1.population = 821;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ラテンアメリカ";
            population1.year = "2000";
            population1.population = 523;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "北アメリカ";
            population1.year = "2000";
            population1.population = 316;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "アジア";
            population1.year = "2000";
            population1.population = 3705;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "ヨーロッパ";
            population1.year = "2000";
            population1.population = 729;
            populationList.add(population1);
    
            population1 = new PopulationInfo();
            population1.area = "オセアニア";
            population1.year = "2000";
            population1.population = 31;
            populationList.add(population1);
    
            return populationList;
        }
    
    }
    
    
  • エンティティ (PopulationInfo.java)
    package jp.reflexworks.test.model;
    
    public class PopulationInfo {
    
        public String country;
        public String area;
        public String year;
        public double population;
    
    }
    
    
  • XML (populationarea2list.xml)
    <?xml version="1.0" encoding="UTF-8" ?>
    <populationArea2List>
        <populationInfo>
            <area>アフリカ</area>
            <year>1960</year>
            <population>282.0</population>
        </populationInfo>
        <populationInfo>
            <area>ラテンアメリカ</area>
            <year>1960</year>
            <population>220.0</population>
        </populationInfo>
        <populationInfo>
            <area>北アメリカ</area>
            <year>1960</year>
            <population>204.0</population>
        </populationInfo>
        <populationInfo>
            <area>アジア</area>
            <year>1960</year>
            <population>1704.0</population>
        </populationInfo>
        <populationInfo>
            <area>ヨーロッパ</area>
            <year>1960</year>
            <population>605.0</population>
        </populationInfo>
        <populationInfo>
            <area>オセアニア</area>
            <year>1960</year>
            <population>16.0</population>
        </populationInfo>
        <populationInfo>
            <area>アフリカ</area>
            <year>1970</year>
            <population>364.0</population>
        </populationInfo>
        <populationInfo>
            <area>ラテンアメリカ</area>
            <year>1970</year>
            <population>288.0</population>
        </populationInfo>
        <populationInfo>
            <area>北アメリカ</area>
            <year>1970</year>
            <population>232.0</population>
        </populationInfo>
        <populationInfo>
            <area>アジア</area>
            <year>1970</year>
            <population>2139.0</population>
        </populationInfo>
        <populationInfo>
            <area>ヨーロッパ</area>
            <year>1970</year>
            <population>657.0</population>
        </populationInfo>
        <populationInfo>
            <area>オセアニア</area>
            <year>1970</year>
            <population>20.0</population>
        </populationInfo>
        <populationInfo>
            <area>アフリカ</area>
            <year>1980</year>
            <population>480.0</population>
        </populationInfo>
        <populationInfo>
            <area>ラテンアメリカ</area>
            <year>1980</year>
            <population>364.0</population>
        </populationInfo>
        <populationInfo>
            <area>北アメリカ</area>
            <year>1980</year>
            <population>256.0</population>
        </populationInfo>
        <populationInfo>
            <area>アジア</area>
            <year>1980</year>
            <population>2636.0</population>
        </populationInfo>
        <populationInfo>
            <area>ヨーロッパ</area>
            <year>1980</year>
            <population>693.0</population>
        </populationInfo>
        <populationInfo>
            <area>オセアニア</area>
            <year>1980</year>
            <population>23.0</population>
        </populationInfo>
        <populationInfo>
            <area>アフリカ</area>
            <year>1990</year>
            <population>637.0</population>
        </populationInfo>
        <populationInfo>
            <area>ラテンアメリカ</area>
            <year>1990</year>
            <population>444.0</population>
        </populationInfo>
        <populationInfo>
            <area>北アメリカ</area>
            <year>1990</year>
            <population>284.0</population>
        </populationInfo>
        <populationInfo>
            <area>アジア</area>
            <year>1990</year>
            <population>3181.0</population>
        </populationInfo>
        <populationInfo>
            <area>ヨーロッパ</area>
            <year>1990</year>
            <population>721.0</population>
        </populationInfo>
        <populationInfo>
            <area>オセアニア</area>
            <year>1990</year>
            <population>27.0</population>
        </populationInfo>
        <populationInfo>
            <area>アフリカ</area>
            <year>2000</year>
            <population>821.0</population>
        </populationInfo>
        <populationInfo>
            <area>ラテンアメリカ</area>
            <year>2000</year>
            <population>523.0</population>
        </populationInfo>
        <populationInfo>
            <area>北アメリカ</area>
            <year>2000</year>
            <population>316.0</population>
        </populationInfo>
        <populationInfo>
            <area>アジア</area>
            <year>2000</year>
            <population>3705.0</population>
        </populationInfo>
        <populationInfo>
            <area>ヨーロッパ</area>
            <year>2000</year>
            <population>729.0</population>
        </populationInfo>
        <populationInfo>
            <area>オセアニア</area>
            <year>2000</year>
            <population>31.0</population>
        </populationInfo>
    </populationArea2List>
    
    
  • JSON (populationarea2list.json)
    {"populationArea2List" :
        {"populationInfo" :
            [{"area" : "アフリカ","year" : "1960","population" : "282"},
             {"area" : "ラテンアメリカ","year" : "1960","population" : "220"},
             {"area" : "北アメリカ","year" : "1960","population" : "204"},
             {"area" : "アジア","year" : "1960","population" : "1704"},
             {"area" : "ヨーロッパ","year" : "1960","population" : "605"},
             {"area" : "オセアニア","year" : "1960","population" : "16"},
             {"area" : "アフリカ","year" : "1970","population" : "364"},
             {"area" : "ラテンアメリカ","year" : "1970","population" : "288"},
             {"area" : "北アメリカ","year" : "1970","population" : "232"},
             {"area" : "アジア","year" : "1970","population" : "2139"},
             {"area" : "ヨーロッパ","year" : "1970","population" : "657"},
             {"area" : "オセアニア","year" : "1970","population" : "20"},
             {"area" : "アフリカ","year" : "1980","population" : "480"},
             {"area" : "ラテンアメリカ","year" : "1980","population" : "364"},
             {"area" : "北アメリカ","year" : "1980","population" : "256"},
             {"area" : "アジア","year" : "1980","population" : "2636"},
             {"area" : "ヨーロッパ","year" : "1980","population" : "693"},
             {"area" : "オセアニア","year" : "1980","population" : "23"},
             {"area" : "アフリカ","year" : "1990","population" : "637"},
             {"area" : "ラテンアメリカ","year" : "1990","population" : "444"},
             {"area" : "北アメリカ","year" : "1990","population" : "284"},
             {"area" : "アジア","year" : "1990","population" : "3181"},
             {"area" : "ヨーロッパ","year" : "1990","population" : "721"},
             {"area" : "オセアニア","year" : "1990","population" : "27"},
             {"area" : "アフリカ","year" : "2000","population" : "821"},
             {"area" : "ラテンアメリカ","year" : "2000","population" : "523"},
             {"area" : "北アメリカ","year" : "2000","population" : "316"},
             {"area" : "アジア","year" : "2000","population" : "3705"},
             {"area" : "ヨーロッパ","year" : "2000","population" : "729"},
             {"area" : "オセアニア","year" : "2000","population" : "31"}
            ]
        }
    }
    
    
  • Reflex iText 実行結果
    LinechartSample実行結果

前へ << >> 次へ