Valdecir Posted September 6, 2018 at 01:40 PM Report #611779 Posted September 6, 2018 at 01:40 PM Criei um gráfico de barra, mas quando clico na legenda a coluna some mas os valores não. function ChartQuantMes() { StatusMesGT.length = 0; StatusMesG.length = 0; CarregarQuantMes(); var chttT = document.getElementById("myChartQuantMes"); var ctx100 = chttT.getContext("2d"); window.myChartQuantMes = new Chart(ctx100, { type: 'bar', data: { labels: ['JAN', 'FEV', 'MAR', 'ABR', 'MAI', 'JUN', 'JUL', 'AGO', 'SET', 'OUT', 'NOV', 'DEZ'], datasets: [ { label: 'Etiqueta', data: StatusMesG, backgroundColor: '#1E90FF', }, { label: 'Cartão', data: StatusMesGT, backgroundColor: '#ADD8E6', }], }, options: { plugins: { datalabels: { anchor: function (context) { var value = context.dataset.data[context.dataIndex]; return value > 1 ? 'end' : 'end'; }, align: function (context) { if (context.dataset.label == "Etiqueta") { var value = context.dataset.data[context.dataIndex]; return value > 1 ? 'end' : 'end'; } else { var value = context.dataset.data[context.dataIndex]; return value > 1 ? 'end' : 'end'; } }, color: function (context) { var value = context.dataset.data[context.dataIndex]; return value.v < 50 ? context.dataset.backgroundColor : 'black'; }, font: function (context) { var width = context.dataset.data; return { size: 18 }; }, }, }, responsive: true, title: { display: true, text: "Quantidade Mensal de Etiquetas / Cartão - Depto " + $('#Depto').val(), lineHeight: '5', fontSize: 20, }, responsive: true, legend: { display: true, position: 'bottom' }, scaleShowHorizintalLines: false, scales: { xAxes: [{ stacked: false, display: true, }], yAxes: [{ stacked: false, ticks: { beginAtZero: false, bounds: false, display: false, mirror: true, max: MatrizC1 + 10, }, gridLines: { display: false, }, }] }, } }); }
M6 Posted September 7, 2018 at 08:47 AM Report #611782 Posted September 7, 2018 at 08:47 AM Tens de ler a documentação da bilbioteca que estás a usar. 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar."
Valdecir Posted September 12, 2018 at 12:14 PM Author Report #611811 Posted September 12, 2018 at 12:14 PM Em 07/09/2018 às 05:47, M6 disse: Tens de ler a documentação da bilbioteca que estás a usar. Mas não encontrei nada que ajudasse. Você teria uma saída para este problema?
M6 Posted September 12, 2018 at 02:04 PM Report #611813 Posted September 12, 2018 at 02:04 PM Já verificaste se é um bug e se a biblioteca tem uma versão mais recente com essa questão resolvida? 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar."
Valdecir Posted September 13, 2018 at 02:36 PM Author Report #611831 Posted September 13, 2018 at 02:36 PM Em 12/09/2018 às 11:04, M6 disse: Já verificaste se é um bug e se a biblioteca tem uma versão mais recente com essa questão resolvida? Eu utilizo estas bibliotecas para a configuração dos indicadores: <script type="text/javascript" src="../SiteAssets/js/Form/Chart.js"></script> <script type="text/javascript" src="../SiteAssets/js/Form/Chart.min.js"> <script type="text/javascript" src="../SiteAssets/js/Library/chartjs-plugin-datalabels.js"></script> <script type="text/javascript" src="../SiteAssets/js/Library/chartjs-plugin-datalabels.min.js"></script> Você conhece alguma delas?
M6 Posted September 13, 2018 at 04:29 PM Report #611833 Posted September 13, 2018 at 04:29 PM Assim pelo nome dos ficheiros não. 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar."
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now