Coder Social home page Coder Social logo

Comments (15)

MansiSaini avatar MansiSaini commented on August 17, 2024 11

A bit late to the party but if you import it using ES6 format:import legend from 'chartist-plugin-legend, then in chartist options object you can say:plugins: [ legend() ] and that worked for me!

from chartist-plugin-legend.

tarekis avatar tarekis commented on August 17, 2024 8

I am a developer not a plugin registry πŸ˜›

from chartist-plugin-legend.

SpaceK33z avatar SpaceK33z commented on August 17, 2024 1

Does import legend from 'chartist-plugin-legend'; work? If not, could you try import * as legend from 'chartist-plugin-legend';?

from chartist-plugin-legend.

PuneethReddyV avatar PuneethReddyV commented on August 17, 2024

I have tried both the options, none of the is working. This is a similar issue to #21. Not sure how to make a import statement for legend on the package.

from chartist-plugin-legend.

tarekis avatar tarekis commented on August 17, 2024

Correct me if i'm wrong but isn't that ES6 export/import syntax? And i haven't seen any ES6 export statements in the plugin.. just a thought on this.

from chartist-plugin-legend.

PuneethReddyV avatar PuneethReddyV commented on August 17, 2024

That import statement is from meteor . Which is very similar to ES6. As mentioned above this import statement is not working only for two plugins(legend, tooltips) where as it works for others(threshold, barlabels, pointlabels).

from chartist-plugin-legend.

SpaceK33z avatar SpaceK33z commented on August 17, 2024

Meteor probably uses CommonJS with compatibility for ES6 modules. In this case, the plugin returns Chartist as you can see here: https://github.com/CodeYellowBV/chartist-plugin-legend/blob/master/chartist-plugin-legend.js#L11.

This is a bit weird. We could change this to return the plugin instead. That would be a breaking change btw. A PR is welcome for this.

from chartist-plugin-legend.

PuneethReddyV avatar PuneethReddyV commented on August 17, 2024

Thank you for that effort. Would it be possible for you to give a file which have fixes. So that I can wrap it my project?

from chartist-plugin-legend.

tarekis avatar tarekis commented on August 17, 2024

The returning of chartist might in fact be the source of this error.

According to OP, this occurs for chartist-plugin-legend and chartist-plugin-tooltips, whereas chartist-plugin-barlabels, chartist-plugin-pointlabels and chartist-plugin-threshold do not throw any Errors.

While chartist-plugin-legend and chartist-plugin-threshold return Chartist, the other ones do not, as you can se here:

chartist-plugin-legend
chartist-plugin-tooltips

chartist-plugin-barlabels
chartist-plugin-pointlabels
chartist-plugin-threshold

Why isn't really obvious to me right now, as all export functionalities seem to use Chartist, but this seems to be the problem.

from chartist-plugin-legend.

PuneethReddyV avatar PuneethReddyV commented on August 17, 2024

Can you provide me a piece of advice to overcome this issue?

from chartist-plugin-legend.

tarekis avatar tarekis commented on August 17, 2024

@PuneethReddyV I never really worked with meteor, so i can't really reconstruct or test anything right now. AFAIK all you can try is to refactor the plugin's structure to the structure the working ones use.

from chartist-plugin-legend.

PuneethReddyV avatar PuneethReddyV commented on August 17, 2024

@tarekis Is there a alternative plugin(s) which can be achieve similar functionalities?

from chartist-plugin-legend.

tarekis avatar tarekis commented on August 17, 2024

Will investigate and test shortly.

from chartist-plugin-legend.

sanmai-NL avatar sanmai-NL commented on August 17, 2024

@tarekis, what’s the status?

from chartist-plugin-legend.

tarekis avatar tarekis commented on August 17, 2024

@sanmai-NL I started looking into this, but I basically have no time on my hands because of work and other stuff I have to do really and this is probably gonna be a complete rewrite. Might be able to squeeze some time out for this this weekend.

from chartist-plugin-legend.

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.