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

how to adjust width of candlestick chart' each item?

1 Answer 115 Views
Chart
This is a migrated thread and some comments may be shown as answers.
hyojung kwon
Top achievements
Rank 1
hyojung kwon asked on 15 Jun 2010, 12:03 PM
I am testing candlestick chart.
I am wondering how to reduce or expand width of each item?

following is my code :
<div><div>SeriesMapping sm = new SeriesMapping();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CandleStickSeriesDefinition candleStickSeriesDefinition = new CandleStickSeriesDefinition();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;candleStickSeriesDefinition.ShowItemToolTipstrue;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//candleStickSeriesDefinition.ItemStyle = this.Resources["CustomStyle"] as Style;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sm.SeriesDefinition = candleStickSeriesDefinition;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sm.LegendLabel = "BP";</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ItemMapping imHigh = new ItemMapping("High", DataPointMember.High);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ItemMapping imLow = new ItemMapping("Low", DataPointMember.Low);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ItemMapping imOpen = new ItemMapping("Open", DataPointMember.Open);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ItemMapping imClose = new ItemMapping("Close", DataPointMember.Close);</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sm.ItemMappings.Add(imHigh);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sm.ItemMappings.Add(imLow);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sm.ItemMappings.Add(imOpen);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sm.ItemMappings.Add(imClose);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RadChart1.SeriesMappings.Add(sm);</div></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">       </span>RadChart1.ItemsSource = Repository.GetBPList();<br></div><div></div


Thanks in advance.
Kwon

1 Answer, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 18 Jun 2010, 08:47 AM
Hi hyojung kwon,

The ChartArea.ItemWidthPercent property will affect the width of the CandleSticks drawn:

RadChart1.DefaultView.ChartArea.ItemWidthPercent = 50;

Sincerely,
Ves
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
Asked by
hyojung kwon
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or