Comments (15)
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.
I am a developer not a plugin registry π
from chartist-plugin-legend.
Does import legend from 'chartist-plugin-legend';
work? If not, could you try import * as legend from 'chartist-plugin-legend';
?
from chartist-plugin-legend.
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.
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.
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.
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.
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.
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.
Can you provide me a piece of advice to overcome this issue?
from chartist-plugin-legend.
@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.
@tarekis Is there a alternative plugin(s) which can be achieve similar functionalities?
from chartist-plugin-legend.
Will investigate and test shortly.
from chartist-plugin-legend.
@tarekis, whatβs the status?
from chartist-plugin-legend.
@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)
- Not able to add data whilst series are hidden from the legend HOT 4
- Internet Explorer has stopped working HOT 5
- Hiding a line is not persistent with data changes HOT 6
- Site doesn't work on firefox HOT 3
- Fix ESLint errors HOT 1
- Breaks Chartist's labelInterpolationFnc() option HOT 1
- Hide legend key for emptyValues if ignoreEmptyValues is true?
- chart and legend colors don't match after clicking on label HOT 1
- Not an Issue(Misleading): Styling HOT 1
- Variable series revert to their old values on hiding a line
- Plugin output js
- Select/Deselect legend items through options
- This plugin is not compatible in charts with aspectRatio
- this plugin does not render inside the SVG chart
- Legends with axis offset
- Add left and right as positions
- Dynamically Changing Legend Color
- Cannot assign the color to the legend
- Can't figure out where to plug this when using moment to generate chart HOT 1
- How to change Text Color?
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 chartist-plugin-legend.