How to change values format
See original GitHub issueExpected Behavior
allow to change values format
Actual Behavior
I’m trying to change a Pie chart values format to currency, but after I add the scales
option it throws an error:
and this is the code:
import { Pie, mixins } from 'vue-chartjs'
// import { toCurrency } from 'utils/formatter.util'
const { reactiveProp } = mixins
export default {
extends: Pie,
mixins: [reactiveProp],
props: ['options'],
mounted () {
// Overwriting base render method with actual data.
this.renderChart(this.chartData, {
responsive: false,
maintainAspectRatio: false,
legend: {
display: false
},
scales: {
yAxes: [{
ticks: {
callback: function (value, index, values) {
console.log(value, index, values)
return '' + value
}
}
}]
}
})
}
Environment
- vue.js version: 2.5.2
- vue-chart.js version: 3.2.1
- npm version: 5.6.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Change numbers with text format to number format in Excel for ...
Change numbers with text format to number format in Excel for the web · Select the cells that have the data you want...
Read more >Number Formatting in Excel: Step-by-Step Tutorial (2022)
1. Select the cell to format. 2. Go to Home > Number. 3. From the menu, go to More Number Formats. 4. Go...
Read more >How to change the format of numeric values - Trifacta
In the top Search box, enter 'Numformat' and search. Select the resulting NUMFORMAT option. This transform converts the value you provide to a...
Read more >How to change Excel date format and create custom formatting
Select the cell with a date in Excel, press Ctrl+1 to open the Format Cells window and switch to the General tab. If...
Read more >7 Amazing Excel Custom Number Format Tricks (you Must ...
With custom number formatting in Excel, you can change the way the values in the cells show up, but at the same time...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://codepen.io/apertureless/pen/LQKmYN?
Oh sorry, did not saw that you are talking about the Pie chart. Well the Pie and Doughnut Charts do not have Y / X Scales. So there is no reason to pass in the
scales
object. So what you’re trying to do is change to tooltip right?Then you have only to pass in the tooltip object.
@oswaldofreitas Well its not in the docs per se, but it’s kind of clear that the doughnut and pie charts, do not have X / Y axis. As their data is neigher linear nor logarithmic nor time based.
So there is no X or Y scale to style there.