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

Small percentage values in Chart DataTable

1 Answer 97 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 20 Jan 2012, 05:30 PM
Hello,

I am working with a RadChart as a stacked bar style and showing the DataTable below the chart which shows value percentages. However, I am using some values with large range differences and this means several of my data items are less than 1% but show as 0% in the DataTable. Is it possible to change the DataTable values to show percentages less than 1%?

Thanks

1 Answer, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 23 Jan 2012, 06:37 PM
Christopher:

Depending on the ratio of sub 1% values, you could set AutoScale=false for the Y-axis and then set an arbitrary value for the YAxis.MaxValue that would better display the smaller values and just let the large values shoot through the roof.

Default.aspx.cs:
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
using Telerik.Charting;
 
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            LoadChart();
        }
    }
 
    private void LoadChart()
    {
        RadChart1.Series.Clear();
 
        ChartSeries c = new ChartSeries("Series1", ChartSeriesType.StackedBar);
 
        c.AddItem(.1);
        c.AddItem(10);
        c.AddItem(.3);
        c.AddItem(25);
        c.AddItem(.6);
        c.AddItem(75);
        c.AddItem(.2);
        c.AddItem(150);
        c.AddItem(.8);
        c.AddItem(200);
 
        RadChart1.AddChartSeries(c);
 
        RadChart1.PlotArea.YAxis.AutoScale = false;
        RadChart1.PlotArea.YAxis.MaxValue = 25;
    }
}

See attached image for display.
Tags
Chart (Obsolete)
Asked by
Christopher
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Share this question
or