Giter Site home page Giter Site logo

Comments (11)

vaibhavgadekar avatar vaibhavgadekar commented on May 2, 2024 7

add font name in propsForLabels this works for me

chartConfig={{
    propsForLabels:{
    fontFamily:'MontserratBold',
    },
...
  }}

from react-native-chart-kit.

c0mm4nDer avatar c0mm4nDer commented on May 2, 2024 5

You can add fontFamily property to Text into react-native-chart-kit.
for example : in pie-chart.js - line 47 add this code:
fontFamily={c.item.fontFamily}
Now you can set fontFamily in your data entities.

but react-native-svg can't render all font type!

from react-native-chart-kit.

SrBrahma avatar SrBrahma commented on May 2, 2024 5

Just found out by accident while reading someone else code:

Under chartConfig prop, there is the propsForLabels prop. You may enter the fontFamily there and other texts properties.

from react-native-chart-kit.

cyeksan avatar cyeksan commented on May 2, 2024

@c0mm4nDer worked like a charm. Thanks a lot!

from react-native-chart-kit.

sreuter avatar sreuter commented on May 2, 2024

Should we create a PR for this?

from react-native-chart-kit.

SrBrahma avatar SrBrahma commented on May 2, 2024

Any update?

from react-native-chart-kit.

ozgurbayram avatar ozgurbayram commented on May 2, 2024

add font name in propsForLabels this works for me

chartConfig={{
    propsForLabels:{
    fontFamily:'MontserratBold',
    },
...
  }}

Thanks, it worked for me :)

from react-native-chart-kit.

3abdawy avatar 3abdawy commented on May 2, 2024

inside data object

{
    legendFontColor: colors.white,
    legendFontSize: 8,
}

from react-native-chart-kit.

Shahekta51995 avatar Shahekta51995 commented on May 2, 2024

{ legendFontColor: colors.white, legendFontSize: 8, } @3abdawy Where we can put this?

from react-native-chart-kit.

mamadoo123 avatar mamadoo123 commented on May 2, 2024

It pretty easy you can add ### propsForLabels to the config props

<BarChart
chartConfig={{
...chartConfig,
propsForLabels: {
fontSize:12,
fontFamily: "roboto-regular",
}
}}
/>

from react-native-chart-kit.

husseinpenart avatar husseinpenart commented on May 2, 2024
    propsForLabels:{fontFamily :'iransans'},

this work just fine

from react-native-chart-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.