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

Bar width & Average line

3 Answers 155 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ajith Nair
Top achievements
Rank 1
Ajith Nair asked on 01 Apr 2011, 04:25 PM
Hi All,

I have 2 queries regarding the chart.

1)  In my application I have a bar chart. Is there any way to decrease the bar width.(or the scale width)

2) I have a line chart with hours in the Y-Axis and Date in the x-Axis. Is there any way to draw a vertical line so that I can display the average hours of that chart.

Thanks in advance
Ajith

3 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 06 Apr 2011, 12:51 PM
Hi Ajith Nair,

Onto your questions:

  • You can control the bar width through the ChartSeries.Appearance.BarWidthPercent property (value 0 - 100).
  • The control does not provide built-in support for custom gridlines, but you can use the MarkedZones feature to achieve similar effect (you will need to set really small width for the marked zone to look like gridline):
ChartSeries series = new ChartSeries();
series.Type = ChartSeriesType.Line;
series.AddItem(10);
series.AddItem(20);
series.AddItem(30);
 
RadChart1.Series.Add(series);
 
ChartMarkedZone markedZone = new ChartMarkedZone();
markedZone.ValueStartX = 2;
markedZone.ValueEndX = 2;
markedZone.ValueStartY = 0;
markedZone.ValueStartY = 30;
markedZone.Appearance.Border.Width = 1;
markedZone.Appearance.Border.Color = Color.Red;
 
RadChart1.PlotArea.MarkedZones.Add(markedZone);


Regards,
Giuseppe
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
Alfonsina
Top achievements
Rank 1
answered on 05 Jul 2012, 09:38 AM

Hello Telerik Team,

I would like to know how can I set the border color of the item of a Serie, for example, in a Bar Serie.

I send a picture and you know what I mean.

Thank you very much,

Kind regards,

Alfonsina.

0
Evgenia
Telerik team
answered on 09 Jul 2012, 10:13 AM
Hi Alfonsina,

 You can either set Border for the whole serie or for an item of it. Here's how to set Border for all items of your first serie:

RadChart1.Series[0].Appearance.Border.Color = Color.Yellow;
RadChart1.Series[0].Appearance.Border.Width = 3;

To provide color for a single item (the second bar in this case) you should do the following:

RadChart1.Series[0].Items[1].Appearance.Border.Color = Color.Red;
RadChart1.Series[0].Items[1].Appearance.Border.Width = 3;

Greetings,
Evgenia
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
Chart (obsolete as of Q1 2013)
Asked by
Ajith Nair
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Alfonsina
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or