BUG: MSChart Control Can't Plot Data Points >15 Decimal PlacesLast reviewed: January 6, 1998Article ID: Q178881 |
The information in this article applies to:
SYMPTOMSWhen the Chart Control is assigned an array of data points containing 16 or more decimal places, those data points do not appear when the chart is updated.
RESOLUTIONThere are two ways to deal with this issue:
Workaround 1Before setting the chart to the variant array, "truncate" the decimal values to 15 places or less as seen in the form_load event below:
Private Sub Form_Load() Dim data_pts(1 To 3, 1 To 2) As Variant dim i as integer data_pts(1, 1) = "R1" data_pts(1, 2) = 5.48487730596136E-02 data_pts(2, 1) = "R2" data_pts(2, 2) = 7.04216678154124E-02 data_pts(3, 1) = "R3" data_pts(3, 2) = 3.10863837084563E-04 For i = 1 To 3 data_pts(i, 2) = CDbl(Format(data_pts(i, 2), "0.000000000000000")) 'Truncate data_pts to 15 decimal places of precision Next MSChart1 = data_pts End Sub Workaround 2Use the SetData method to add the data to the chart instead of setting the chart to the variant array. To use this workaround, rewrite the Form_Load event to look like this instead:
Private Sub Form_Load() With MSChart1 .RowCount = 3 .ColumnCount = 1 .DataGrid.SetData 1, 1, 5.48487730596136E-02, False .DataGrid.SetData 2, 1, 7.04216678154124E-02, False .DataGrid.SetData 3, 1, 3.10863837084563E-04, False End With End Sub STATUSMicrosoft has confirmed this to be a problem in the Microsoft products noted at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONTo reproduce the problem, follow the steps below:
|
Additional query words: accuracy exponent significant digits
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |