I am trying to add tooltip to legend of piechart and remove the description from it. Here is a basic demonstration of this(I added explanation to pictures) :
In light of this image, I want to accomplish two things:
1-Firstly, I want to remove description from the legend section. As far as I understand, when I set the data source like this, it both sets tooltip of chart and legend label:
pie.set(String category, Number data)
However, since I am getting description from database, it can be very long and this causes legend to overlap chart like this:
So, I only want to show data as tooltip on the chart and legend section(on the labels) and remove description from legend. Here is the javascript code(s) that I tried:
function chartExtender() {
this.cfg.legend = {
show: true,
highlighter: {
show: true,
useAxesFormatters: false
},
tooltipLocation: 'nw',
placement: 'inside',
rendererOptions: {//I tried that one and above highlighter respectively.
highlighter: {
tooltipFadeSpeed: 'slow',
tooltipLocation: 'n',
show: true
}
}
};
this.cfg.highlighter = {
show: true,
useAxesFormatters: false, // must be false for piechart
tooltipLocation: 'n',
formatString: '%s = %d'
};
}
2- Secondly, is there a way to completely customise data sources of legend and chart section? I dont want them bounded like this.
Here is the links I have looked:
http://stackoverflow.com/questions/23846494/customize-primefaces-chart?rq=1
http://stackoverflow.com/questions/30644676/how-to-use-line-chart-extender-attribute-in-primefaces-5-2
http://www.jqplot.com/deploy/dist/examples/pieTest.html
http://stackoverflow.com/questions/4889464/jqplot-tooltip-on-bar-chart
http://stackoverflow.com/questions/12050008/primefaces-3-4-charts-datatipformat
http://forum.primefaces.org/viewtopic.php?f=3&t=18445
http://forum.primefaces.org/viewtopic.php?f=3&t=32166
http://stackoverflow.com/questions/15474242/jqplot-pie-chart-tooltips
http://stackoverflow.com/questions/30224074/primefaces-piechart-tooltips-are-not-displaying-in-my-local-environment