Comments (3)
Hi @deepaksinghrb 👋
The text labels along the Y-axis can be given any custom style using the yAxisTextStyle
prop.
Along the X-axis, you can even pass your own custom component!
Here's an example (for styling the Y-axis labels -
<BarChart
yAxisLabelTexts={['$0', '$250', '$500', '$750']}
yAxisTextStyle={{color: 'red', fontSize: 11, fontStyle:'italic'}}
data={data}/>
Hope it helps. 🤗
from react-native-gifted-charts.
Hi @deepaksinghrb Thanks for pointing it out.
For Pie and Donut charts, till now we didn't have any way to add custom font-family or font-weight or font-style
But, I have added these features in version "0.1.14"
Here's an example-
<PieChart
showText
textColor="white"
radius={120}
showValuesAsLabels
fontStyle="italic"
textSize={20}
font="Cursive"
fontWeight="bold"
data={[
{value: 54, color: '#177AD5'},
{value: 40, color: '#79D2DE'},
{value: 20, color: '#ED6665'},
]}
/>
The props - font, fontWeight, fontStyle, textSize, textColor, etc can also be passed separately to each data item.
Cheers. 🎉
from react-native-gifted-charts.
@Abhinandan-Kushwaha What about Pie Chart?
I'am using something like below:
<PieChart data = {[
{value: 20, color: '#003E9C', text: 'tag', textColor: 'white', textSize: 16, shiftTextY: -20, shiftTextX: -10},
{value: 30, color: '#A14E00', text: 'someTag', textColor: 'white', textSize: 16, shiftTextY: -30, shiftTextX: -10},
{value: 25, color: '#9C0000', text: 'someTag', textColor: 'white', textSize: 16, shiftTextX: 10},
{value: 25, color: '#B51CA5', text: 'someTag', textColor: 'white', textSize: 16, shiftTextX: -10},
]}
donut
showText
radius={150}
innerRadius={60}
/>
Do we have textStyle for this as well?
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.