0

一部のデータを表示することになっている flotr2 グラフがあります。

編集: Chrome ユーザー: 注意してください、この jsfiddle は chrome では機能しないようです。理由はわかりません

http://jsfiddle.net/1jgb2k6r/7/

私の問題は、バーが表す日付の中央に配置されていないことです。

$(function () {
    (function color_gradients(container) {
        var myData = [];

        myData.push([new Date('1/1/2014').getTime(), Math.ceil(Math.random() * 10)]);
        myData.push([new Date('1/8/2014').getTime(), Math.ceil(Math.random() * 10)]);
        myData.push([new Date('1/15/2014').getTime(), Math.ceil(Math.random() * 10)]);
        myData.push([new Date('1/22/2014').getTime(), Math.ceil(Math.random() * 10)]);
        var
        bars = {
            data: myData,
            bars: {
                show: true,
                barWidth: 0.8,
                lineWidth: 20,
            }
        };

        graph = Flotr.draw(
        container, [bars], {
            yaxis: {
                min: 0,
                max: 11
            },
            xaxis: {
                mode: 'time',
                timeMode: 'local',
                min: (new Date('1/1/2014').getTime() - (7 * 24 * 60 * 60 * 1000)),
                max: (new Date('1/22/2014').getTime() + (7 * 24 * 60 * 60 * 1000))
            }
        });
    })(document.getElementById("editor-render-0"));
});

これらのバーを再調整する方法はありますか?

4

1 に答える 1