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

[Solved] Set BarWidth of RadCartesianChart

3 Answers 192 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Florian
Top achievements
Rank 2
Florian asked on 07 Jan 2013, 09:47 AM
Hello!

I'm working with RadCartesianChart which uses BarSeries and CategorialAxis.

I want to display a dynamic number of items(bars), but without setting any width the chart renders itself way to small.

Can i set a "MinBarWidth" so the Chart defines it width based on NumberOfItems * BarWidth ?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 07 Jan 2013, 05:20 PM
Hi Florian,

Thank you for using our RadControls for Windows 8!

The current version of the control does not support setting of absolute threshold value (in pixels) for the bar width at series level but it is possible to set the RadCartesianChart.MinWidth property based on the number of DataPoints in the Series (if I understand you correctly, this seems to be the property you are looking for).

Note that you need to set it after the page is loaded because Series are not drawn in design time. For example: 
Loaded += MainPage_Loaded;

void MainPage_Loaded(object sender, RoutedEventArgs e)
{
    int dataPointCounter = (this.chart.Series[0] as BarSeries).DataPoints.Count;
    int desiredBarWidth = 80;
    this.chart.MinWidth =  dataPointCounter * desiredBarWidth;        
}

If you change the data source in runtime - make sure you also update the MinWidth.

I hope this helps. Let me know if I can assist you in some other way.

 

All the best,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Florian
Top achievements
Rank 2
answered on 08 Jan 2013, 08:53 AM
Hello,

thanks for your reply!

Yes, i was looking for the MinWidth property. It is working well.

Will telerik implement this,or a similar functionality in a future version of the control?
0
Ivaylo Gergov
Telerik team
answered on 08 Jan 2013, 12:25 PM
Hi Florian,

At this point we do not plan to implement such functionality. Nevertheless, you can log this as a feature request in our Ideas and Feedback Portal where you can follow its status and vote for already existing one in order to raise its priority.


 

Greetings,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Chart for XAML
Asked by
Florian
Top achievements
Rank 2
Answers by
Ivaylo Gergov
Telerik team
Florian
Top achievements
Rank 2
Share this question
or