How to set fixed width of the bar in barseries?

3 Answers 653 Views
ChartView
Om Pushkara deep
Top achievements
Rank 2
Iron
Iron
Iron
Om Pushkara deep asked on 17 Jun 2021, 11:30 AM
I have a radchartview - Bar , conbined mode = stack. I wanted to set a fixed width for bar shown. Can i do that ?

3 Answers, 1 is accepted

Sort by
1
Nadya | Tech Support Engineer
Telerik team
answered on 23 Jun 2021, 09:34 AM

Hello,

The Width property is exposed on a control level. If you want to use RadChartElement you can use the MaxSize property and adjust the width value:

this.radChartView1.ChartElement.MaxSize = new Size(400, 0);

Note, RadChartView is a complex control to be displayed in a row in the grid and it is expected to require more space in order to be displayed.

I hope this helps. Let me know if I can assist you further.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Nadya | Tech Support Engineer
Telerik team
answered on 17 Jun 2021, 12:31 PM

Hello,

You can not set a fixed width for the bars. When you use ChartSeriesCombineMode.Stack all the bars have the same width and it depends on the values displayed on the axis. The possible solution that I can suggest is to manage the Width of the chart view itself. Thus, if you set a smaller width the bars would look thinner and vice versa. Please refer to the following examples:

this.radChartView1.Width = 400;

 this.radChartView1.Width = 600;

I hope this helps. If you have other questions please let me know.

Regards,
Nadya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Om Pushkara deep
Top achievements
Rank 2
Iron
Iron
Iron
commented on 17 Jun 2021, 01:00 PM

There is no width property coming up for me in this.radChartView1 . I am using 2015 version for telerik . Is it newly added?
0
Nadya | Tech Support Engineer
Telerik team
answered on 17 Jun 2021, 01:30 PM

Hello,

The Width property gets/sets the width of control and it is in standart the System.Windows.Forms namespace. It is available in the 2015 Telerik version.

It seems you are using an old version. Since there is a 5-years gap in the Telerik versions (the latest version and the one you are using), I would highly encourage you to upgrade to the latest version. Thus, you can benefit from all the introduced improvements and new features of our controls.

I hope this information helps.

Regards,
Nadya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Om Pushkara deep
Top achievements
Rank 2
Iron
Iron
Iron
commented on 21 Jun 2021, 07:45 AM

Yes but there is no property like that in RadChartElement :( I am using a custom chart column of type RadChartElement . When i try to reduce the radgridview rowheight the bar simply pops out of the row :(
Tags
ChartView
Asked by
Om Pushkara deep
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or