Pie chart with legend included (wihtout the need of doing mouseover)

1 reply · opened Oct 27, 2016

JjuanleOct 27, 2016

Hello, firstly thanks for your support.

I have been reading through the chart documentation (https://github.com/chartjs/Chart.js/blob/v1.1.1/docs/00-Getting-Started.md) but I have not managed to include a legend and label. Could you share with me one example?

I am trying for example to display a pie chart. And directly, without the need of doing mouse over each part of the pie, display the content of each part. Example: we see the pie chart and directly 20% balblab 30% blablab 50% balbalb. If include label I can see when I do mouse over, but I would like to display that content upfront for all the parts of the pie chart. Is that possible?

Thanks
Juan

SSemicolon WebSTAFFNov 2, 2016

Hello,

This is Definitely Possible. Simply find the following code:

var globalGraphSettings = {animation : Modernizr.canvas};

and replace it with:

var globalGraphSettings = {
	animation : Modernizr.canvas,
	onAnimationComplete: function(){
		this.showTooltip(this.segments, true);
	},
	tooltipEvents: [],
	showTooltips: true
};

This will definitely work fine. Thanks for your Patience.

Do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard