Render chart for 0 value

3 Answers 34 Views
Charts
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Benjamin asked on 17 Jul 2025, 06:39 AM

Hi,

would like to render bar for 0 value.

this is my dojo link that is not working as expected

3 Answers, 1 is accepted

Sort by
0
Accepted
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
answered on 22 Jul 2025, 02:45 PM

Benjamin, here is a simple change to your dojo to make it work, just needed to change the -= to +=.

0
Nikolay
Telerik team
answered on 21 Jul 2025, 02:36 PM

Hello Benjamin,

There is a knowledge base article demonstrating how barc/columns can be rendered for the zero values:

https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/render-zero-bars

Regards,
Nikolay
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.

Jay
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 21 Jul 2025, 02:53 PM | edited

This is basically what his dojo does, except the chart type is "bar" instead of "column". If I change the chart type to bar in the knowledge base article and make changes to x and width instead of y and height, the zero bars do not render. With column chart type, they do.

 

Jay
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 22 Jul 2025, 02:46 PM

Ah, I see... it's because the Y axis goes the other way, so for the X, it has to add instead of subtract the bar size.
0
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
answered on 21 Jul 2025, 02:48 PM | edited on 21 Jul 2025, 03:04 PM
This dojo seems to do the trick. I modified your visual function slightly. What I noticed by is I could not get the bar to fill. For example, dojo 2 has a bigger width and a fill specified, but nothing gets filled.
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 22 Jul 2025, 02:47 PM

Switching to += for the X also fixes the fill issue.
Tags
Charts
Asked by
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Answers by
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
Nikolay
Telerik team
Share this question
or