Add data label in hvplot

This command below output graph. i want to display count data labels on the line per day/complaint
Also how to control font of the data lables
Kindly guide:-

cust_group_by_work_projected.groupby([‘ddate’,
‘complaint_type’])[‘Count’].sum().hvplot.line(title=‘RBU’,x=‘ddate’, y=[‘Count’],by=[‘complaint_type’],rot=70)

You should be able to use the labels method on hvPlot, e.g.:

import holoviews as hv
agg = cust_group_by_work_projected.groupby([‘ddate’,
‘complaint_type’])[‘Count’].sum()
lines = agg.hvplot.line(title=‘RBU’, x=‘ddate’, y=[‘Count’], by=[‘complaint_type’], rot=70)
labels = agg.hvplot.labels(title=‘RBU’, x=‘ddate’, y=‘Count’, by=‘complaint_type’).opts(hv.opts.Labels(text_font='Ubuntu'))
lines * labels

Seems quite likely that this plot would be very busy though so you might want to aggregate further to reduce the number of labels, otherwise you can play with the xoffset/yoffset options to reduce overlap.

thanks it’s work. if i want to set the colors and font which options to use

It’s not totally obvious when using hvPlot but you can use hv.help(hv.Labels) to see all valid options. In this case you should add something like: .opts(hv.opts.Labels(text_font='Ubuntu', text_color='red'))

thanks it work. kindly guide kindly why .opts have sub hv.opts syntax/options to implement.

So HoloViews allows constructing composite objects, the hv.opts.<Element> syntax allows precisely targeting options to a specific element despite setting it on a composite object.