Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to change the bar values? #36

Closed
marcelod opened this issue Jun 6, 2020 · 2 comments
Closed

Is it possible to change the bar values? #36

marcelod opened this issue Jun 6, 2020 · 2 comments

Comments

@marcelod
Copy link

marcelod commented Jun 6, 2020

It is shown every 10, but I would like to be able to configure and add the percent sign.

The first image is how I would like to leave it and the second is how it looks. They have different data, but just exemplify the markings in the bar

Captura de tela de 2020-06-05 22-24-08
Captura de tela de 2020-06-05 22-22-43

@marcelod marcelod changed the title Futuras mudanças no histórico Em breve, o histórico de traduções só estará disponível depois que você fizer login e poderá ser gerenciado na página Minha atividade. O histórico anterior será apagado durante o upgrade, então salve as traduções de que quer se lembrar para facilitar o acesso. Ok É possível alterar os valores da barra? É apresentado de 10 em 10, mas gostaria de poder configurar e adicionar o sinal de percentual. 135/5000 Is it possible to change the bar values? It is shown every 10, but I would like to be able to configure and add the percent sign. Enviar feedback Histórico Salvas Comunidade Is it possible to change the bar values? Jun 6, 2020
@y-takey
Copy link
Owner

y-takey commented Jun 6, 2020

Hi @marcelod :)

You can use the ticks option. (it is general option of chart.js)
like this:

new Chart(document.getElementById("my-chart"), {
  type: "horizontalBar",
  data: {},
  options: {
    scales: {
      xAxes: [{ ticks: { stepSize: 25, callback: (val) => `${val}%` } }], # **here**
    },
    plugins: {
      stacked100: { enable: true },
    },
  },
});

@marcelod
Copy link
Author

marcelod commented Jun 6, 2020

Hi @y-takey , thanks a lot for the help and the plugin is very good

@marcelod marcelod closed this as completed Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants