score:7
You can see on the highcharts website the options used to create the pie chart you pasted by clicking on View options.
You'll see, among others, the following code:
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
}
},
This means you have to enable the dataLabels options and provide a formatter. In the code you provided, you can actually see in the second hc_add_series_labels_values
call that the dataLabels enabled
options is set to FALSE
:
hc_add_series_labels_values(favorite_bars$bar, favorite_bars$percent,
colors = substr(terrain.colors(5), 0 , 7), type = "pie",
name = "Bar", colorByPoint = TRUE, center = c('35%', '10%'),
size = 100, dataLabels = list(enabled = FALSE))
If you change it to TRUE
you will see the labels. If you want the numbers to display as well, you have to pass a function to a format
element in the list, like so:
hc_add_series_labels_values(favorite_bars$bar, favorite_bars$percent,
colors = substr(terrain.colors(5), 0 , 7), type = "pie",
name = "Bar", colorByPoint = TRUE, center = c('35%', '10%'),
size = 100, dataLabels = list(enabled = TRUE,
format = '{point.name}: {point.percentage:.1f} %'))
You'll then have to play with the different options to dataLabels
to display them however you want, see the Highcharts API for the Bar chart type for example.
Source: stackoverflow.com
Related Query
- r- how to display the labels on the highcharter objects all the time
- How can i hide all the Series in highcharts at a time
- how to display 2 same highcharts without duplicate the code
- How can I display crosshair labels on top of the chart with Highcharts
- How to force the display of every labels on yAxis in a BarChart
- How to display Highcharts x-axis time stamp labels inside tooltip?
- How to set the default display block position on the time line of highstock charts?
- hchart() Bar Graph does not display all the x axis labels in R
- how to display the last five hours time from current time(hh:mm ) 12 hour format in high charts?
- how to display total count of all the bar values at the top- Highcharts colum- react highhcharts
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- How to use the tooltip formatter and still display chart color (like it does by default)?
- How to hide labels in the highcharts in the pie
- Highcharts - How to display legend symbol inside the tooltip
- Highcharts : Display the labels (min, max, median etc.) in boxplot
- How do you increase the height of the x-axis labels area on a highchart.js chart?
- How can I delete all of the points from a highcharts series
- How to Check and Uncheck all the Legend elements in HighCharts Linechart?
- How do I add a tooltip to the x-axis labels in highcharts?
- how to get geojson of mainly cities of all of country of the world
- How do I style the series labels on a Highcharts pie chart?
- Highcharts : How to fix labels to the top when xAxis rotation is 90°?
- How can I change the scale of the legend in highcharter in R?
- How can I hide ALL series with the same ID with a button on highcharts? (line graph)
- HighCharts: display the y-axis labels in percentage instead of the absolute count for basic column charts
- How to change the palette colors of a highcharter column plot which depends on a variable?
- How to remove the value and number labels from Highcharts angular gauge
- How to add data labels for a treemap in highcharter in r?
- How do I place the labels next to the series on a split packed bubble chart?
- How to place highcharter objects at same horizontal level using rmarkdown?
More Query from same tag
- Rails - Highcharts on Heroku - Getting 'ReferenceError: Highcharts is not defined'
- Find special chart on highcharts
- Issue on Setting Up Highchats.js Index of Chart
- How do you put the datetime in the guage chart in human readable format
- Error while clicking links on highchart columns
- Highchart: Only show one series at a time
- highcharts on top of google map
- How to position highcharts tooltip above chart with outside:true
- How to set the padding and placement if we have more than 16 data in the series
- Is it possible to hide the line & symbol next to Highcharts legend items?
- High charts displays data only if we press F12 (developer tool) in chrome browser
- Printing from Highcharts returns focus to the top of the page
- Highcharts/Highstock flags series issue
- Setting background text in Scatter Plot using Highcharts API
- highcharts - inconsistent number of yAxis gridlines
- cursor:pointer on Highcharts Plotband or clickable Plotband Lable
- Odd color filling with gradient in Highstock areaspline
- highcharts. set full height of column/bar background color
- highcharts customEvents.js issue 0x800a138a - JavaScript runtime error: Function expected
- Highcharts: How to exempt a series from redraw zoom calculations?
- Additive Color in Highcharts
- Change Datalabel Color, Rotation and Align values based on Column value in highcharts
- Highcharts - Sankey chart not displaying all the data when series font increased
- GWT Highchart comparing series
- Add 2 legends in one chart
- Highcharts: Hide/remove values (in a range) from y axis
- how to dynamically change array in highchart?
- Change the text of the back button on Highcharts Treemap?
- Rally chart - column layout issues
- How to dynamically remove the whole Column from a single series HighCharts column graph?