How to conditional visible ChartSeriesLabels in KendoUI react?

1 Answer 135 Views
Charts
NETe2
Top achievements
Rank 1
NETe2 asked on 07 Nov 2022, 09:54 AM
How to show chart label with conditional checking series item value. Show only value > 0 
const seriesData = [10, 0, 50, 30, 0, 19];
const ChartContainer = () => (
 <Chart>
    <ChartSeries>
      <ChartSeriesItem type="column" data={seriesData}>
        <ChartSeriesLabels visible={true} position={"center"} />
      </ChartSeriesItem>
    </ChartSeries>
  </Chart>
);

 

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 09 Nov 2022, 07:14 AM

Hello,

You can use custom "visual" for the label and conditionally return the default rendering if the value is higher than 0. I have prepared a simple example demonstrating such implementation:

Here is more information on the customization of the labels:

Hope this helps.

 

Regards,
Konstantin Dikov
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.

NETe2
Top achievements
Rank 1
commented on 14 Nov 2022, 07:07 AM

Thank you so much.
Tags
Charts
Asked by
NETe2
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or