これは設計どおりです。ここでの解決策は、カスタム値を使用することです。ListBoxコンポーネントとTChartコンポーネントをFormにドロップし、次のコードを使用すると、違いを確認できます。
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
bool automatic = true;
SetChart(new[] { 0.5685, 0.7141, 0.7301, 0.748, 0.7847, 1.2127 }, automatic);
SetChart(new[] { 0.5686, 0.7141, 0.7301, 0.748, 0.7847, 1.2127 }, automatic);
tChart1.Axes.Left.SetMinMax(0.55, 1.25);
}
private void SetChart(double[] values, bool auto)
{
var box = new Steema.TeeChart.Styles.Box(tChart1.Chart);
box.Add(tChart1.Series.Count, values);
if (auto)
{
box.ReconstructFromData();
listBox1.Items.Add("Series: " + box.Title.ToString());
listBox1.Items.Add("Median: " + box.Median.ToString());
listBox1.Items.Add("Quartile1: " + box.Quartile1.ToString());
listBox1.Items.Add("Quartile3: " + box.Quartile3.ToString());
listBox1.Items.Add("InnerFence1: " + box.InnerFence1.ToString());
listBox1.Items.Add("InnerFence3: " + box.InnerFence3.ToString());
listBox1.Items.Add("OuterFence1: " + box.OuterFence1.ToString());
listBox1.Items.Add("OuterFence3: " + box.OuterFence3.ToString());
listBox1.Items.Add("AdjacentPoint1: " + box.AdjacentPoint1.ToString());
listBox1.Items.Add("AdjacentPoint3: " + box.AdjacentPoint3.ToString());
listBox1.Items.Add("-------------------------");
}
else
{
box.UseCustomValues = !auto;
box.Median = 0.73905;
box.OuterFence1 = 0.0357;
box.OuterFence3 = 1.5337;
box.InnerFence1 = 0.3567;
box.InnerFence3 = 1.2127;
box.Quartile1 = 0.6777;
box.Quartile3 = 0.8917;
box.AdjacentPoint1 = box.YValues[0];
box.AdjacentPoint3 = 1.2127;
box.Median = 0.73905;
}
}
自動変数がtrue の場合、次の画像のように自動的に計算された値が表示されます。

falseに設定すると、手動のカスタム値が使用されます。違いを確認するには、 ReconstructFromData()メソッドがどのように実装されているかを確認する必要があります (リフレクター ツールで確認できます)。
/// <summary>
/// Reconstructs the box plot from series data
/// </summary>
public void ReconstructFromData()
{
int N = SampleValues.Count;
if (N > 0)
{
double InvN = 1.0 / N;
/* calculate median */
int med = N / 2;
if ((N % 2) == 0) median = 0.5 * (SampleValues[med - 1] + SampleValues[med]);
else median = SampleValues[med];
/* calculate Q1 && Q3 */
quartile1 = N > 1 ? Percentile(SampleValues, 0.25) : SampleValues[0];
quartile3 = N > 1 ? Percentile(SampleValues, 0.75) : SampleValues[0];
/* calculate IQR */
double iqr = quartile3 - quartile1;
innerFence1 = quartile1 - whiskerLength * iqr;
innerFence3 = quartile3 + whiskerLength * iqr;
/* find adjacent points */
int i;
for (i = 0; i <= med; i++) if (SampleValues[i] > innerFence1) break;
adjacentPoint1 = SampleValues[i];
for (i = med; i < N; i++) if (SampleValues[i] > innerFence3) break;
adjacentPoint3 = SampleValues[i - 1];
/* calculate outer fences */
outerFence1 = quartile1 - 2 * whiskerLength * iqr;
outerFence3 = quartile3 + 2 * whiskerLength * iqr;
}
}
ここで違いを生むのは隣接ポイント 3です。最初のボックス プロットでは、innerFence3は系列の最後の値と一致しますが、2 番目のボックス プロットではわずかに小さくなっています。したがって、このコード:
for (i = med; i < N; i++) if (SampleValues[i] > innerFence3) break;
adjacentPoint3 = SampleValues[i - 1];
最初のシリーズよりも 1 ステップ前に中断し、最後ではなく最後から 2 番目の値が使用されています。したがって、AdjacentPoint3とペイントされているものの違いです。
自動的に計算されたデータを取得するには、次のようにします。
box.ReconstructFromData();
box.UseCustomValues = true;
box.Median = box.Median;
box.OuterFence1 = box.OuterFence1;
box.OuterFence3 = box.OuterFence3;
box.InnerFence1 = box.InnerFence1;
box.InnerFence3 = box.InnerFence3;
box.Quartile1 = box.Quartile1;
box.Quartile3 = box.Quartile3;
box.AdjacentPoint1 = box.AdjacentPoint1;
box.AdjacentPoint3 = box.YValues[box.Count-1];
box.Median = box.Median;