Monday, 8 January 2018

How get data name in Highcharts pie chart legend instead of "Slice" using array of values?

I am creating a pie chart in Highcharts with a legend.
When I specify the series as an array of values (my preferred method), the legend
displays the string "Slice" for each value. If I instead specify the series as a list of
objects with named values, I correctly see the data names. Can I see the data names if I
specify the series as an array of values?



Here
is the code that doesn't work but that I would like to
use:






HighCharts<br /> pie
src="http://code.jquery.com/jquery-1.11.1.min.js">
src="http://code.highcharts.com/highcharts.js">












Here is the code that
does work when I specify the series as a list of objects with named
values:





HighCharts<br /> pie
src="http://code.jquery.com/jquery-1.11.1.min.js">

src="http://code.highcharts.com/highcharts.js">




style="width:600px; height:400px;">





No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...