8

グラフの実際のサイズ (ラベルなし) を設定する方法はありますか?

I have a container that is 880 pixels width and I'd like to have the chart extend exactly to that and have the axes rather stick out. Right now it's of course applying padding so that the axes can fit in the designated area.

I fiddled around with fixed labelWidth options and negative margins applied to the container but that didn't get me anywhere useful.

4

1 に答える 1

6

軸を突き出すには、軸 (それぞれ y と x) の labelWidth と labelHeight を負の値に設定し、コンテナーにマージンを与えて、外側に十分な余裕を持たせることができます。

CSS:

#placeholder {
    border 2px solid red;
    margin: 30px;
}

フロー オプション:

var options = {
    xaxis: { labelHeight: -10 },
    yaxis: { labelWidth: -10 }
}

jsFiddleでわかるように、コンテナーの境界線とプロットの間にはまだギャップがあります。グリッドのminBorderMarginプロパティでそれを制御できますが、プロットの境界線を完全に非表示にするわけではないため、グリッドborderWidthを 0 に設定するか、 を設定することをお勧めしますborderColor私はそれでjsFiddleを更新しました。

于 2013-08-07T14:04:38.940 に答える