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

[Solved] Charts-1 bar should use 1 Column of Table

3 Answers 110 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sai Baba
Top achievements
Rank 1
Sai Baba asked on 13 May 2009, 03:40 PM
Hello Team,
in chart graphs,
the Bars, i have 4 columns in a table i need to show the 4 columns as a Bar Chart.
main concept is 1 bar should use the Data from 1 coulmn
and 2 bar should use the other column of the Table.

how can i bind the Bars to a particular column of A table.
Please let me know.
Thanks in Advance,

Sai Baba.

3 Answers, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 15 May 2009, 03:05 PM
Hello Sai Baba,

You can do this by adding four ChartSeries to RadChart's Series collection property. Each of these series should have its DataYColumn property set to the name of the corresponding column from your table.
ChartSeries series1 = new ChartSeries("Series1", ChartSeriesType.Bar); 
        ChartSeries series2 = new ChartSeries("Series2", ChartSeriesType.Bar); 
        ChartSeries series3 = new ChartSeries("Series3", ChartSeriesType.Bar); 
        ChartSeries series4 = new ChartSeries("Series4", ChartSeriesType.Bar); 
 
        series1.DataYColumn = "Series1"
        series2.DataYColumn = "Series2"
        series3.DataYColumn = "Series3"
        series4.DataYColumn = "Series4"
 
        RadChart1.Series.Add(series1); 
        RadChart1.Series.Add(series2); 
        RadChart1.Series.Add(series3); 
        RadChart1.Series.Add(series4); 
 
        RadChart1.DataSource = GetData(); 
        RadChart1.DataBind(); 

Please, find attached the sample page.

Kind regards,
Velin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sai Baba
Top achievements
Rank 1
answered on 18 May 2009, 04:28 PM
Team,
Thanks For your Support.
some other issues are.(Reply me using VB.net)

1.i have four Horizontal Bars,i want to set each bar a Color
2.now i'm getting a number value for each Bar showing its value but requiremnt is it should be eg: 296 (32%). i,e
 nothing but it's value and in Percentage immedaitely after the Number.

Thansk a lot for your support.

Sai Baba.
0
Accepted
Velin
Telerik team
answered on 21 May 2009, 01:55 PM
Hi Sai Baba,

You can find information to how to set different color of each bar here.

As for your second question - you can get such labels by setting a custom format string to the series DefaultLabelValue property.
series.DefaultLabelValue = "#Y(#%)" 

Kind regards,
Velin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Sai Baba
Top achievements
Rank 1
Answers by
Velin
Telerik team
Sai Baba
Top achievements
Rank 1
Share this question
or