Mostrar valores em gráfico de barra

JavaScript

26/03/2018

Boa tarde

Pessoal preciso indicar o valor em um gráfico de barra, não consigo montar o código para que os valores apareçam acima das barras do gráfico.



function Mychart(){

	Padrao_de_Cores();

	var cht = document.getElementById("myChart");
	var ctx1 = cht.getContext("2d");


	window.myChart = new Chart(ctx1 , {


	//var ctx = document.getElementById("myChart").getContext(''2d'');
	
	//var myChart = new Chart(ctx, {
	type: ''bar'',
	data: {
		labels:MatrizSArea,

		datasets: [{label:"Área(s) - AA",
		//data: MatrizSPontos,
		data: MatriszCor1,
		backgroundColor:''rgb(255, 0, 0)'',
		},{

			label:"Área(s) - A",
			//data: MatrizSPontos,
			data: MatriszCor2,
			backgroundColor:''rgb(191, 143, 0)'',
				
		},{

			label:"Área(s) - B",
			//data: MatrizSPontos,
			data: MatriszCor3,
			backgroundColor:''rgb(255, 255, 0)'',
		},{

			label:"Área(s) - C",
			//data: MatrizSPontos,
			data: MatriszCor4,
			backgroundColor:''rgb(0, 176, 80)'',	
		
		}],	
	},
		options: {

			title:{
				display:true,
				text:$(''#Depto'').val(),
			},
			tooltips: {
				mode: ''index'',
				intersect: false
			},
			responsive: true,
			scales: {
				xAxes: [{
					stacked: true,
				}],
				yAxes: [{
					stacked: true,
					ticks: {
					beginAtZero:true,
					bounds:false,
					}
				}]
			}
		}
	});
}
Valdecir Renkaveski

Valdecir Renkaveski

Curtidas 0
POSTAR