
時間加重指数移動平均 (TWEMA) スムージング (デフォルト)
y 値の数) を考慮します。これにより、特性の異なる複数の線を同時に表示する場合でも、一貫したスムージングを行えます。
この仕組みの内部動作を示すサンプルコードを以下に示します。

ガウススムージング

移動平均スムージング

指数移動平均 (EMA) スムージング
- サンプリング
- グループ化
- 式
- 非単調な x 軸
- 時間ベースの x 軸

元のデータを非表示

Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Help us improve these docs. Take our quick survey.
折れ線グラフでは、スムージングを使用してノイズの多いデータの傾向を把握できます。

y 値の数) を考慮します。これにより、特性の異なる複数の線を同時に表示する場合でも、一貫したスムージングを行えます。
この仕組みの内部動作を示すサンプルコードを以下に示します。
const smoothingWeight = Math.min(Math.sqrt(smoothingParam || 0), 0.999);
let lastY = yValues.length > 0 ? 0 : NaN;
let debiasWeight = 0;
return yValues.map((yPoint, index) => {
const prevX = index > 0 ? index - 1 : 0;
// VIEWPORT_SCALE はチャートのx軸の範囲に合わせて結果をスケーリングする
const changeInX =
((xValues[index] - xValues[prevX]) / rangeOfX) * VIEWPORT_SCALE;
const smoothingWeightAdj = Math.pow(smoothingWeight, changeInX);
lastY = lastY * smoothingWeightAdj + yPoint;
debiasWeight = debiasWeight * smoothingWeightAdj + 1;
return lastY / debiasWeight;
});



data.forEach(d => {
const nextVal = d;
last = last * smoothingWeight + (1 - smoothingWeight) * nextVal;
numAccum++;
debiasWeight = 1.0 - Math.pow(smoothingWeight, numAccum);
smoothedData.push(last / debiasWeight);

