私はほとんどすべてをデフォルトでセットアップしており、小さい数値 (9.22337 × 109) では機能しますが、シリーズに大きな数値 (9.9E+37) を追加しようとすると、コントロールがクラッシュします。スタック トレースをさらに調べると、2 進数から 10 進数への変換エラーのように見えますか?
これがコントロールの制限なのか、それとも他の設定が必要なのか知りたいだけだと思います。何が起こっているのかを見て、それが限界だと推測していますが、あきらめて別の方法を見つけようとする前に、ここで質問することにしました.
System.OverflowException occurred
HResult=-2146233066
Message=Value was either too large or too small for a Decimal.
Source=mscorlib
StackTrace:
at System.Decimal..ctor(Double value)
at System.Decimal.op_Explicit(Double value)
at System.Windows.Forms.DataVisualization.Charting.Axis.RoundedValues(Double inter, Boolean shouldStartFromZero, Boolean autoMax, Boolean autoMin, Double& min, Double& max)
at System.Windows.Forms.DataVisualization.Charting.Axis.EstimateNumberAxis(Double& minimumValue, Double& maximumValue, Boolean shouldStartFromZero, Int32 preferredNumberOfIntervals, Boolean autoMaximum, Boolean autoMinimum)
at System.Windows.Forms.DataVisualization.Charting.Axis.EstimateAxis(Double& minimumValue, Double& maximumValue, Boolean autoMaximum, Boolean autoMinimum)
at System.Windows.Forms.DataVisualization.Charting.Axis.EstimateAxis()
at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetDefaultAxesValues()
at System.Windows.Forms.DataVisualization.Charting.ChartArea.SetData(Boolean initializeAxes, Boolean checkIndexedAligned)
at System.Windows.Forms.DataVisualization.Charting.ChartArea.ReCalcInternal()
at System.Windows.Forms.DataVisualization.Charting.ChartPicture.Paint(Graphics graph, Boolean paintTopLevelElementOnly)
InnerException:
そして、dotPeek から取り出した "逆アセンブル" System.Windows.Forms.DataVisualization.Charting.Axis.RoundedValues 関数を次に示します。
internal double RoundedValues(double inter, bool shouldStartFromZero, bool autoMax, bool autoMin, ref double min, ref double max)
{
if (this.axisType == AxisName.X || this.axisType == AxisName.X2)
{
if (this.margin == 0.0 && !this.roundedXValues)
return inter;
}
else if (this.margin == 0.0)
return inter;
if (autoMin)
min = min < 0.0 || !shouldStartFromZero && !this.ChartArea.stacked ? (double) (Decimal.op_Decrement((Decimal) Math.Ceiling(min / inter)) * (Decimal) inter) : 0.0;
if (autoMax)
max = max > 0.0 || !shouldStartFromZero ? (double) (Decimal.op_Increment((Decimal) Math.Floor(max / inter)) * (Decimal) inter) : 0.0;
return inter;
}