1

jfreechart を使用して、コンピューター内の操作のロガーに関するグラフを描画しています。

例: 1: 2012/09/39/28 06:55:37 8 S 0x1c0c762 ターミナル--geometry=134x35 --display :0.0 --role=Terminal-0x10591b0-16869-1343137248 --show-menubar --show- borders --hide-toolbars --working-directory /home/termier "Terminal", "Terminal" "Terminal - termier@akagi: ~" 2: 2012/09/39/28 06:55:41 8S 0x1600313 /usr /lib/xfce4/notifyd/xfce4-notifyd "xfce4-notifyd", "Xfce4-notifyd" "xfce4-notifyd"

今のところ、(2012/09/39/28 06:55:37,Terminal) のようにすべてのポイントを描画できます。scilicet: x 軸は 2012/09/39/28 06:55:37 、Y 軸は:ターミナル(ターミナルのような他のコマンドと同様に、ターミナルを表示するために1を使用します... 2:/ usr/lib/xfce4/notifyd/xfce4-notifydなど...)

しかし、私が必要とするのは、次のようなブロックを描くことです:

ターミナル1: _ _ _ _ _ _S ||||||

/usr/lib/xfce4/notifyd/xfce4-notifyd2: _ _ _ _ _ _ ___ _S ||||||

com 3: _ _ _ _S||||| (S:start ,eg: 2000/12/12 09:22:10 start) ..... (最初のコマンドが終了すると、別のコマンドが開始されます。開始を取得できます。ポスト コマンドがは前のコマンドの終了時間です)

1: S 2: S 3: S

ここにいくつかのコードがあります。

private XYDataset createDataset() {

    Calendar precal;
    Calendar postcal;

    this.flags = modelfocus.getListflag();
    commands = modelfocus.getListCommand();
    DateFormat formatedate = new SimpleDateFormat("yyyy/MM/ww/dd HH:mm:ss");
    precal = Calendar.getInstance();
    postcal = Calendar.getInstance();

    for (int i = 0; i < countCom; i++) {
        this.series[i] = new TimeSeries(commands.get(i));
    }

    for (Focus listTxt : modelfocus.getList()) {
        try {
            Date d = new Date();
            d = formatedate.parse(listTxt.date2String());
            System.out.println(d);
            precal.setTime(d);
            //postcal.setTime();
        } catch (ParseException e) {
            System.out.println("Can't change this date");
            e.printStackTrace();
        }
        String eachCmd = listTxt.getCommand();
        for (int i = 0; i < countCom; i++) {
            if (eachCmd == commands.get(i)) {
                series[i].addOrUpdate(new Second(precal.getTime()),
                        flags.get(i));
            }
        }

    }
    TimeSeriesCollection dataset = new TimeSeriesCollection();
    for (int i = 0; i < countCom; i++) {
        dataset.addSeries(this.series[i]);
    }
    return dataset;
}

この問題を解決するために誰か助けてください、どうもありがとう。

4

1 に答える 1

1

このShapeに示すように、時系列の値をレンダリングするために使用するを変更できます。ARectangleを以下に示します。

r.setSeriesShape(0, new Rectangle(-4, -4, 9, 9));

画像

于 2013-02-18T23:39:01.853 に答える