私はここで何かが遅れていることを知っています... 私がしようとしているのは、-75 から 75 までの x の範囲に対して f(x) = 2500 をグラフ化することだけです。これにより、水平線が作成されます。今のところ、配列のいくつかの詳細についての私の誤解だと思います。0 から始まり、75 までは正常に進みます。0 よりも低いグラフは表示されません (線の半分を取得します)。
for(x = -75; x<75; x++)
{
a_const[x] = [x, 2250];
}
問題があることはほぼ確実です。念のため、私の .plot 関数を次に示します。
$.plot(
$("#mydiv"),
[
//{label : "f(x) = x^2", data : a_exp},
//{label : "f(x) = sqrt(x)", data : a_sqroot},
//{label : "f(x) = 3root(x)", data : a_cuberoot}
{label: "constant", data : a_const}
],
{
//yaxis: {min:-5000},
xaxis: {min:-75},
yaxis: {min:-1000},
yaxis: {max:4000},
grid: {hoverable:true, clickable:true },
series: { points: {show:true}, lines:{show:true}}
}
);