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

Really simple 100% bar chart with just 2 values

3 Answers 46 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
matt
Top achievements
Rank 1
matt asked on 09 Sep 2010, 04:36 PM

I just want one bar.. This one bar will contain 2 colors.. One color for 'Disbursed' and one color for 'Remaining'.. I have these 2 values as doubles... so if the values are 200/50 then one color of the bar will cover 25% and the other will cover 75%

What am I missing? As you see I have been poking in the dark (originally it was a datatable but since its just 2 numbers I got them... and now not sure what to do with them.

 

 

 

double dDisbursed = Convert.ToDouble(_grantService.GetFinacialDashboardTotal(234).Rows[0][2].ToString());

 

 

 

double dRemaining = Convert.ToDouble(_grantService.GetFinacialDashboardTotal(234).Rows[0][1].ToString());

 

 

 

// RadChartLOCCS.PlotArea.XAxis.DataLabelsColumn = "GrantID";

 

 

 

 

 

 

 

// RadChartLOCCS.Series[0].DataLabelsColumn = "AwardAmount";

 

 

 

 

 

 

 

// RadChartLOCCS.Series[0].DataXColumn = "AwardAmount";

 

 

 

 

 

 

 

// RadChartLOCCS.Series[0].DataXColumn2 = "LOCCSDisbursed";

 

 

 

 

 

 

 

//RadChartLOCCS.Series[0].DataYColumn = "AwardAmount";

 

 

 

 

 

RadChartLOCCS.DataBind();

 

 

 

<telerik:RadChart ID="RadChartLOCCS" runat="server" DefaultType="StackedBar100" SeriesOrientation="Horizontal">

 

 

 

 

 

 

 

<Series>

 

 

 

 

 

 

 

<telerik:ChartSeries Name="SeriesLOCCS" Type="StackedBar100">

 

 

 

 

 

 

 

</telerik:ChartSeries>

 

 

 

 

 

 

 

</Series>

 

 

 

 

 

 

 

<ChartTitle>

 

 

 

 

 

 

 

<TextBlock Text="LOCCS Budget">

 

 

 

 

 

 

 

</TextBlock>

 

 

 

 

 

 

 

</ChartTitle>

 

 

 

 

 

 

 

</telerik:RadChart>

 

3 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 14 Sep 2010, 06:23 PM
Hi matt,

Try this sample in your code-behind.
protected void Page_Load(object sender, EventArgs e)
   {
       // Create a ChartSeries and assign its name and chart type
       ChartSeries chartSeries1 = new ChartSeries();
       chartSeries1.DefaultLabelValue = "#%";
       chartSeries1.Name = "Disbursed";
       chartSeries1.Type = ChartSeriesType.StackedBar100;
       // add new items to the series
       chartSeries1.AddItem(50);
       ChartSeries chartSeries2 = new ChartSeries();
       chartSeries2.DefaultLabelValue = "#%";
       chartSeries2.Name = "Remaining";
       chartSeries2.Type = ChartSeriesType.StackedBar100;
       // add new items to the series
       chartSeries2.AddItem(200);
       // add the series to the RadChart Series collection
       RadChart1.Series.Add(chartSeries1);
       RadChart1.Series.Add(chartSeries2);
         
       // add the RadChart to the page.
       this.Page.Controls.Add(RadChart1);
   }

Feel free to contact us if more questions arise.

Regards,
Evgenia
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
matt
Top achievements
Rank 1
answered on 14 Sep 2010, 08:47 PM
ok thanks..

I was trying to figure out how to make the charts 3d like the ASP.NET 3.5 Charts I am converting from ...  you only do 3D charts in wpf/silverlight and not asp.net

is that correct?

0
Evgenia
Telerik team
answered on 15 Sep 2010, 06:29 PM
Hello matt,

Unforunatelly we don't provide RadChart for ASP.NET AJAX in 3D. In order to have 3D chart you should use our Silverlight or WPF RadChart controls.


Sincerely yours,
Evgenia
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 (Obsolete)
Asked by
matt
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
matt
Top achievements
Rank 1
Share this question
or