s3rvac / pygal-toggle-graphs Goto Github PK
View Code? Open in Web Editor NEWToggle the visibility of graphs in a pygal chart by clicking on the legend.
Toggle the visibility of graphs in a pygal chart by clicking on the legend.
I should note I haven't grabbed an older version of Pygal to try this with, but when I use your javascript (and thanks, by the way, for making this!), I can't toggle lines. Maybe it's relevant that I'm using a DateY graph?
custom_style = Style(
background='transparent',
plot_background='transparent',
foreground='#000000',
foreground_light='#585858',
foreground_dark='#383838',
opacity='.6',
opacity_hover='.9',
transition='400ms ease-in',
colors=('#FF6600', '#9900CC', '#FF66FF'))
js = [
'http://kozea.github.com/pygal.js/javascripts/svg.jquery.js', # Original
'http://kozea.github.com/pygal.js/javascripts/pygal-tooltips.js', # Original
'http://rawgit.com/s3rvac/pygal-toggle-graphs/master/pygal-toggle-graphs.js'
]
datey = pygal.DateY(x_label_rotation=20,
title = 'Stuff',
x_title = 'Datetime',
include_x_axis = True,
print_values = False,
js = js,
style = custom_style)
Hi!
The toggle idea is fantastic! Many thanks! I haven't encountered a problem with Firefox nor Opera. So far only Chrome has let me down.
Chrome 40.0.2214.91 m
Windows 7 64 bit
Thanks!
So I have secondary Y-axis enabled (i.e. pygal.add('SomeLabel', data_point, secondary=True)) and some of the tooltips for certain data points are showing up as 'None' when you hover over them.
This doesn't happen when I add data points with the default Y-axis setting. I am using pygal-toggle-graphs as per your 'Usage' section in the md file. Do you know what is going wrong here?
Thanks for extending pygal with this very sorely needed functionality by the way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.