Giter VIP home page Giter VIP logo

Comments (15)

rakannimer avatar rakannimer commented on May 14, 2024 1

Hey !
Thanks for using the library and reporting this.

@koppert, could you try to install nwb.

npm install -g nwb

and then build with it:

nwb build

I'm very happy to accept a PR for this. And will try to do it in the weekend if no PR is submitted.

So @Nevraeka you should be covered for your upcoming release.

Thanks @koppert for digging in the code, if you still get build errors submit a PR with some example code that you'd like to work and I'll try it on my machine.

Cheers !

from react-google-charts.

koppert avatar koppert commented on May 14, 2024 1

@rakannimer It works. Just do not compiled the demo, but no problem. Thanks.

@Nevraeka Correct. That's right. All options available in NumberFormat.

I have not had time to test. But the changes are these:

https://github.com/koppert/react-google-charts/commit/5c15e7c522a2c9ff91608ac7d1b4eacf701ebf7c

from react-google-charts.

Nevraeka avatar Nevraeka commented on May 14, 2024

I am running into the same issues

from react-google-charts.

Nevraeka avatar Nevraeka commented on May 14, 2024

@rakannimer I tried to wrap this with a formatter with no luck. I am happy to pair on this or submit a PR since I need this for a project releasing soon. What code would need to be adjusted to make this happen?

from react-google-charts.

koppert avatar koppert commented on May 14, 2024

I think we could transfer NumberFormat config ({prefix: '$', negativeColor: 'red', negativeParens: true}) via props and execute formatter.format on buildDataTableFromProps.
I will try.

from react-google-charts.

koppert avatar koppert commented on May 14, 2024

I made the change, but I can not compile.

$ npm run build

> [email protected] build C:\Users\bruno.barros\Desktop\Apps\react-google-charts
> nwb build

nwb: clean-module
nwb: build-module (es5)
ReferenceError: [BABEL] C:\Users\bruno.barros\Desktop\Apps\react-google-charts\src\components\Chart.js: Unknown option: C:\Users\bruno.barros\Desktop\Apps\react-google-charts\.babelrc.presets

from react-google-charts.

Nevraeka avatar Nevraeka commented on May 14, 2024

Many Thanks @rakannimer & @koppert . This should cover percentage decimal formatting as well, correct?

from react-google-charts.

rakannimer avatar rakannimer commented on May 14, 2024

Thanks @koppert I integrated your code change. Can one of you guys try out the master branch and let me know if it works for your use case ?
Cheers !

from react-google-charts.

claudiowilson avatar claudiowilson commented on May 14, 2024

@rakannimer @koppert wouldn't this change only allow for 1 column to be formatted?

from react-google-charts.

koppert avatar koppert commented on May 14, 2024

I would like to apologize for my absence.

NumberFormat would not solve my problem. I wanted to format vaxis in a column chart. Only then I realized that it should be used in table chart.

@claudiowilson You're right. I will modify the code to pass an array in the props.

from react-google-charts.

darioodiaz avatar darioodiaz commented on May 14, 2024

Hi guys ! Did you make the PR? because in the code this feature is missing

from react-google-charts.

itshallrun avatar itshallrun commented on May 14, 2024

As far as I can see, it is still not possible to format more than one column at once. Any chance this will attract any attention?

from react-google-charts.

itshallrun avatar itshallrun commented on May 14, 2024

There seems to be an issue. When trying to use formatters I get this error:

TypeError: _this4.applyNumberFormat is not a function
Seems the issue is somewhere here:

this.props.formatters.forEach(({ type, column, options }) => {
      switch (type) {
        case 'NumberFormat':
          this.applyNumberFormat(column, options);
        case 'DateFormat':
          this.applyDateFormat(column, options);
        default:
          console.log('Unkown formatter type: ' + type);
          break;
      }
    });

from react-google-charts.

Michto8 avatar Michto8 commented on May 14, 2024

Hello aikonplus ,I have the same error.
I solved by mooving the 2 scoped functions applyNumberFormat and applyDateFormat into class Chart method (for matching 'this' in the context of the call).

I have also add some break; into the swith case and now it s seem to work correctly.
Cordially.

from react-google-charts.

itshallrun avatar itshallrun commented on May 14, 2024

@Michto8 Could you please make a pull request for that?

from react-google-charts.

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.