how to create rounded corner for column chart

1 Answer 10 Views
Charts
Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
Benjamin asked on 29 May 2025, 07:55 AM

can't seems to find an example for creating column chart looking similar to the image

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 02 Jun 2025, 02:21 PM

Hello Benjamin,

This can be achieved with a custom visual function for the series.

Here is an example logic:

series: [{
            type: "column",
            data: [1, 2],
            visual: function (e) {
              var rect = e.rect,
                options = e.options.color;

              var curveDistance = rect.size.width / 4;
              var x = rect.origin.x;
              var y = rect.origin.y;
              var bottomRight = rect.bottomRight();
              var bottomRightX = bottomRight.x;
              var bottomRightY = bottomRight.y;
              var gradient = new kendo.drawing.LinearGradient({
                start: [0.5, 0],
                end: [0.5, 1],
                stops: [
                  {
                    offset: 0.3,
                    color: "#2587d0",
                    opacity: 0.6,
                  },
                  {
                    offset: 1,
                    color: "#2587d0",
                    opacity: 1,
                  },
                ],
              });

              var roundedRectPath = new kendo.drawing.Path({
                fill: gradient,
                stroke: {
                  color: "none",
                },
              })
                .moveTo(bottomRightX - curveDistance, y)
                .curveTo(
                  [bottomRightX, y],
                  [bottomRightX, y],
                  [bottomRightX, y + curveDistance],
                )
                .lineTo([bottomRightX, bottomRightY - curveDistance])
                .curveTo(bottomRight, bottomRight, [
                  bottomRightX - curveDistance,
                  bottomRightY,
                ])
                .lineTo([x + curveDistance, bottomRightY])
                .curveTo(
                  [x, bottomRightY],
                  [x, bottomRightY],
                  [x, bottomRightY - curveDistance],
                )
                .lineTo(x, y + curveDistance)
                .curveTo([x, y], [x, y], [x + curveDistance, y])
                .close();

              return roundedRectPath;
            }
          }]

Dojo demo: https://dojo.telerik.com/VZSjIgoF

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.

Tags
Charts
Asked by
Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Nikolay
Telerik team
Share this question
or