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.

Custom tick and label formatter (Bar chart)

See original GitHub issue

Is there a way to format tick and label values? I noticed there is sliceLabel and radialLabel which can be a function in pie charts. Can we have a similar option for bar chart? The tick and label values I have is high 1000s. So I would like to display them with a K suffix. For example. 130K instead of 130000 which it would display by default

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:24 (6 by maintainers)

github_iconTop GitHub Comments

25reactions
plouccommented, Oct 4, 2017

Yes you can, for example:

<Bar
    // formatting labels
    labelFormat=".0s"
    // formatting axis tick value
    axisLeft={{ format: v => `${v}%` }}
/>

You can also pass a function to labelFormat, and if a string is given it uses d3-format.

13reactions
SachaGcommented, Dec 20, 2017

That would be really helpful to have in the docs 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom tick formatter for time series - Matplotlib
Custom tick formatter for time series#. When plotting daily data, e.g., financial time series, one often wants to leave out days on which...
Read more >
8.8 Changing the Text of Tick Labels - R Graphics Cookbook
Scatter plot with automatic tick labels (left); With manually specified labels ... to this format, rounding to the nearest second (it can be...
Read more >
Specify Axis Tick Values and Labels - MATLAB & Simulink
Customize the tick values and labels along an axis, such as editing the tick value placement or modifying the tick label text and...
Read more >
Labeling Axes - Chart.js
The category axis, which is the default x-axis for line and bar charts, uses the index as internal data format. For accessing the...
Read more >
xAxis.labels.formatter | highcharts API Reference
The axis labels show the number or category for each tick. ... To add custom numeric or datetime formatting, use {value} with formatting, ......
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