Hi
I am trying to draw a doughnut chart with some numbers that exceed one billion.
Binding dataseries to doughnut chart, overflow exception has been thrown.
The overflow exception says that value was either too large or too small for an Int32 in English.
Is there any way to overcome this?
I think dataseries contains number over one billion seems to be unable to bind to doughnut chart.
The others are fine with same dataseries, e.g. bar or spline.
I have attached the file with screenshots.
The codes are following
※Adding dataseries to doughnut chart
※Adding data to dataseries
Thanks in advance.
I am trying to draw a doughnut chart with some numbers that exceed one billion.
Binding dataseries to doughnut chart, overflow exception has been thrown.
The overflow exception says that value was either too large or too small for an Int32 in English.
Is there any way to overcome this?
I think dataseries contains number over one billion seems to be unable to bind to doughnut chart.
The others are fine with same dataseries, e.g. bar or spline.
I have attached the file with screenshots.
The codes are following
※Adding dataseries to doughnut chart
private
double
[] bufferGetsForChart =
new
double
[2];
bufferGetsForChart[0] = Convert.ToDouble(((InstantShotInfo)grdInstantShotList.SelectedItem).BUFFER_GETS);
bufferGetsForChart[1] = Convert.ToDouble(((InstantShotInfo)grdInstantShotList.SelectedItem).DISK_READS);
bufferGetsForChart[1] = bufferGetsForChart[0] - bufferGetsForChart[1];
DataSeries doughnutSeriesBufferGets = GetPieData(1);
doughnutSeriesBufferGets.Definition =
new
DoughnutSeriesDefinition();
doughnutSeriesBufferGets.Definition.InteractivitySettings.HoverScope = InteractivityScope.Item;
doughnutSeriesBufferGets.Definition.InteractivitySettings.SelectionScope = InteractivityScope.Item;
doughnutSeriesBufferGets.Definition.InteractivitySettings.SelectionMode = ChartSelectionMode.Single;
((DoughnutSeriesDefinition)doughnutSeriesBufferGets.Definition).LabelSettings.LabelOffset = 0.7d;
if
(bufferGetsForChart[0] == 0 && bufferGetsForChart[1] == 0)
{
doughnutSeriesBufferGets.Definition.ItemLabelFormat = itemLabelFormatZero;
}
else
{
doughnutSeriesBufferGets.Definition.ItemLabelFormat = itemLabelFormat;
}
chtBufferGets.DefaultView.ChartArea.DataSeries.Clear();
chtBufferGets.DefaultView.ChartArea.DataSeries.Add(doughnutSeriesBufferGets);
chtBufferGets.DefaultView.ChartArea.SmartLabelsEnabled =
false
;
chtBufferGets.DefaultView.ChartLegend.Header =
string
.Empty;
chtBufferGets.DefaultView.ChartTitle.Content = MaeStrings.dbo_BUFFER_GETS +
": "
+
(Convert.ToDecimal(bufferGetsForChart[0])).ToString(numberFormatString) +
"(100%)"
;
chtBufferGets.DefaultView.ChartLegend.LegendItemMarkerShape = MarkerShape.Circle;
※Adding data to dataseries
private
string
[] bufferGetsColumn =
new
string
[] { MaeStrings.dbo_DISK_READS, MaeStrings.prb_BUFFER };
for
(
int
i = 0; i < bufferGetsColumn.Length; i++)
{
series.Add(
new
DataPoint { YValue = bufferGetsForChart[i] });
DataPoint dataPoint = series[i];
dataPoint.LegendLabel = bufferGetsColumn[i];
}
Thanks in advance.