question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tickFormat does not format the displayed values

See original GitHub issue

Hello everybody, I’m using a ‘discreteBarChart’ with: showValues: true, yAxis: { tickFormat: function(d) { return myLocale.numberFormat('.,4f')(d); } } ‘myLocale’ has the following attributes: var myLocale = d3.locale({ decimal: ',', thousands: '.', ... }); The values on the yAxis are well formated and displayed with ‘,’ as decimal separator, but the Y values on the top of the bars are not formatted and displayed with ‘.’ as decimal separator and ‘,’ as thousands separator. Do you have an idea how can I get the Y values on the top of the bars formatted as I want? Thank you! unformatted y values on the top of the bars

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
krispocommented, Mar 9, 2016

add one more option

chart: {
  valueFormat: function(d){
    return myLocale.numberFormat('.,4f')(d);
  }
}
0reactions
rkdhanyakulacommented, May 19, 2017

Dear @krispo Here I am trying to remove the decimals every where on the chart. I tried the above , But I Cannot.

For Example : 11.0000 to only 11

Here is my Code :

$scope.regUsersChartOptions = {
			            chart: {
			                type: 'pieChart',
			                height: 500,
			                x: function(d){return d.monthName;},
			                y: function(d){return d.monthFreq;},
			                showLabels: true,
			                "showLegend": false,
			                duration: 500,
			                labelThreshold: 0.01,
			                labelSunbeamLayout: true,
			                legend: {
			                    margin: {
			                        top: 5,
			                        right: 35,
			                        bottom: 5,
			                        left: 0
			                    }
			                }
			            }
			        };
Read more comments on GitHub >

github_iconTop Results From Across the Web

Format tick values in D3 - Stack Overflow
This works just fine for me in your fiddle. yAxisR = d3.axisRight(y3).tickFormat(d3.format(".2f")). Make sure that you add more of a margin ...
Read more >
Formatting ticks in Python - Plotly
How to format axes ticks in Python with Plotly. ... If "linear" , the placement of the ticks is determined by a starting...
Read more >
D3.js axis.tickFormat() Function - GeeksforGeeks
Parameters : This function accepts the following parameter. format: These parameters are format to set the tick format function. Return Value: ...
Read more >
SVG Axes - Axis - D3 wiki
If the specified orientation is not one of the supported values, the axis ... tickFormat(d3.format(",.0f")) will display integers with comma-grouping for ...
Read more >
Date formatted tick labels - MATLAB datetick - MathWorks
datetick selects a label format based on the minimum and maximum limits of the specified axis. The axis data values should be serial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found