This is a migrated thread and some comments may be shown as answers.

doughnut chart with number over one billion

3 Answers 76 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Seo
Top achievements
Rank 1
Seo asked on 02 Nov 2010, 07:50 AM
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
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.

3 Answers, 1 is accepted

Sort by
0
Accepted
Yavor
Telerik team
answered on 05 Nov 2010, 01:19 PM
Hi Seo,

This issue has been reported by other users and fixed. I have created a small application that does not crash using the latest binaries. Can you please try the application in your environment to check if it can reproduce the problem? Then get the latest binaries from the LIB and try again and see if the problem persists.

Regards,
Yavor Ivanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Seo
Top achievements
Rank 1
answered on 10 Nov 2010, 05:45 AM
Hi Yavor

In the latest version of silverlight libraries, the exception has become not to occur.
I definitely downloaded the latest version and I thought that I installed,
but it is not replaced by a new version in VS2010 automatically.

Thank you very much.
0
Yavor
Telerik team
answered on 11 Nov 2010, 12:24 PM
Hello Seo,

Visual Studio adds reference usually to some specific version of the referenced assemblies in GAC.

<Reference Include="Telerik.Windows.Controls, Version=2010.2.1109.1040, Culture=neutral, PublicKeyToken=5803cfa389c90ce7, processorArchitecture=MSIL">
When you download the latest version it is recommended to remove the references and add them again to your projects and also Clean & Rebuild.

I am glad that the issue you were facing is now resolved.

Regards,
Yavor Ivanov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Seo
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Seo
Top achievements
Rank 1
Share this question
or