Giter VIP home page Giter VIP logo

Comments (10)

nagix avatar nagix commented on May 17, 2024 2

@osterland @efriandika Regarding Angular, if you are using this plugin with ng2-charts, it does not work because a color scheme is applied only when no colors are defined in a chart config but ng2-charts has default colors. In order to workaround this, I have added the override option in 20c60e5, which enables to override the existing color settings with the specified color scheme. This change will be available in the next v0.4.0 release.

from chartjs-plugin-colorschemes.

blockjon avatar blockjon commented on May 17, 2024 1

🤔 answered my own question: If I add this at the top of my file, it works:

import * as name from "chartjs-plugin-colorschemes";

from chartjs-plugin-colorschemes.

blockjon avatar blockjon commented on May 17, 2024

I must be doing something wrong.. not importing something correctly etc. Are there any examples of how to use this in es6 with react?

from chartjs-plugin-colorschemes.

nagix avatar nagix commented on May 17, 2024

Good to know that you have already solved the issue. For React, just import 'chartjs-plugin-colorschemes'; is fine.

from chartjs-plugin-colorschemes.

osterland avatar osterland commented on May 17, 2024

do you know by any chance how to import colorschemes for an angular2+ project?
I got many errors every way i try

Thank you very much in advance

from chartjs-plugin-colorschemes.

nagix avatar nagix commented on May 17, 2024

import 'chartjs-plugin-colorschemes'; works in an Angular 2+ project as well.

from chartjs-plugin-colorschemes.

osterland avatar osterland commented on May 17, 2024

thank you for your answer - i tried this ofc but no luck.

Iam starting to think - is this maybe for linecharts only? ;)

from chartjs-plugin-colorschemes.

efriandika avatar efriandika commented on May 17, 2024

yes same here..
It does not works in angular 7.x
I use pie chart..

Any idea ?

from chartjs-plugin-colorschemes.

felipefialho avatar felipefialho commented on May 17, 2024

thanks @nagix

from chartjs-plugin-colorschemes.

alanhyue avatar alanhyue commented on May 17, 2024

Had the same issue when using with Vue.js. @blockjon 's solution works.
import * as name from "chartjs-plugin-colorschemes";

But I do not understand why the instruction import "chartjs-plugin-colorschemes" doesn't work. It seems to be a difference in the mechanism of importing modules. I am still new to JS, I would love to hear if anyone have identified the reason.

from chartjs-plugin-colorschemes.

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.