doughnut chart with number over one billion

4 posts, 1 answers
  1. Seo
    Seo avatar
    16 posts
    Member since:
    Sep 2010

    Posted 02 Nov 2010 Link to this post

    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.
  2. Answer
    Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 05 Nov 2010 Link to this post

    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
  3. Seo
    Seo avatar
    16 posts
    Member since:
    Sep 2010

    Posted 09 Nov 2010 Link to this post

    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.
  4. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 11 Nov 2010 Link to this post

    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
Back to Top