Comments (8)
Hi @duc562000 π
You can use the topLabelComponent
property inside data objects.
Here's an example-
const data = [
{value: 20},
{value: 30},
{value: 50, topLabelComponent: () => <Text style={{color:'red',fontSize:18,marginBottom:6}}>50</Text>},
{value: 40},
{value: 30},
];
return (
<View style={{flex:1,justifyContent:'center',alignItems:'center'}}>
<BarChart width={300} data={data} />
</View>
);
Hope it helpsπ€
from react-native-gifted-charts.
okey Thanks
from react-native-gifted-charts.
Any option to show value directly as topLabelComponent.
from react-native-gifted-charts.
Hi @kholusoft π
From version 1.3.23
onwards we can show values directly as topLabelComponent, using the showValuesAsTopLabel
prop.
I have added the props- showValuesAsTopLabel
, topLabelContainerStyle
and topLabelTextStyle
to Bar charts.
Here's an example-
The code for the above chart is-
const data = [{value: 6}, {value: 8}, {value: 5}, {value: 5}, {value: 8}]
return <BarChart
data={data}
showValuesAsTopLabel
topLabelTextStyle={{color:'brown', fontWeight:'bold'}}
/>
from react-native-gifted-charts.
from react-native-gifted-charts.
from react-native-gifted-charts.
from react-native-gifted-charts.
Thanks a lot. Is there any way to reduce bottom margin below bar chart. I find high margin below charts
β¦
On Sat, Nov 25, 2023 at 4:44β―AM Abhinandan Kushwaha < @.***> wrote: Hi @kholusoft https://github.com/kholusoft π From version 1.3.23 onwards we can show values directly as topLabelComponent, using the showValuesAsTopLabel prop. I have added the props- showValuesAsTopLabel, topLabelContainerStyle and topLabelTextStyle to Bar charts. Here's an example- topLabel.png (view on web) https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/assets/20596944/1de7294a-31e7-46ff-996a-cadb17bee4e9 The code for the above chart is- const data = [{value: 6}, {value: 8}, {value: 5}, {value: 5}, {value: 8}] return <BarChart data={data} showValuesAsTopLabel topLabelTextStyle={{color:'brown', fontWeight:'bold'}}/> β Reply to this email directly, view it on GitHub <#99 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIBDHHSJK3P4REIORYNCIDYGES6VAVCNFSM5PUS62LKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBSGYYTGMRVG44A . You are receiving this because you were mentioned.Message ID: </issues/99/1826132578@ github.com>
@kholusoft Are you still facing this issue (margin bottom below the bar) in the latest version 1.3.24
?
from react-native-gifted-charts.
Related Issues (20)
- Add support to control the backgroundColor of each section of the yAxis individually HOT 1
- Does gifted charts support zoom implementation? HOT 1
- BarChart secondaryData is completely ignored
- [BUG] LineChart not displaying dataPointLabelComponent and dataPointText properly on RTL Layouts.
- Having trouble with pointerConfig - scrolling over data HOT 3
- secondary line data not aligning with secondary y axis HOT 2
- When I run in Android device that i am getting this issue HOT 4
- How do we add border radius to semi circle pie charts? HOT 5
- Animate piechart/semi circle HOT 2
- innerCircleBorderWidth not being applied
- Line chart - Multiple lines
- Line chart spacing
- RulesType at LineChart does not work HOT 1
- [BUG]:You specified `onScroll` on a <ScrollView> but not `scrollEventThrottle`. You will only receive one event
- How to achieve Multiple Circular Progressbar using this library? HOT 3
- PieChart focusOnPress stops working when onPress prop is provided HOT 1
- dynamic timestamp for xaxis
- date-time xaxis for react native HOT 1
- Pointer Config and Pointer Label component is not responsive in line graph. HOT 1
- first and last xAxisLabel are cut-off
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-gifted-charts.