Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style customization should be more straightforward #3

Open
jaraco opened this issue Nov 10, 2013 · 6 comments
Open

Style customization should be more straightforward #3

jaraco opened this issue Nov 10, 2013 · 6 comments

Comments

@jaraco
Copy link
Owner

jaraco commented Nov 10, 2013

Originally reported by: Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco)


The current implementation makes it very difficult to customize the styles of the charts. The current graph interface is very limited.

It should be very easy, for example, to change the color scheme for the lines in a graph.


@shaun-ba
Copy link

shaun-ba commented Nov 4, 2016

The docs don't work, and i can't figure out how i'm supposed to use the CSS module? How do i style a line chart?

@jaraco
Copy link
Owner Author

jaraco commented Nov 4, 2016

The docs don't work.

This library does have some rough edges. If you have a specific concern, please elaborate on it and perhaps investigate and send a pull request with a proposed improvement.

How do I style a line chart?

If the docs don't get you started, then read the code, which is what I just did. Looks like you can subclass your Line chart and merge your styles into the stylesheet like so:

class StyledLine(svg.charts.line.Line):
    def get_stylesheet(self):
        ss = super(StyledLine, self).get_stylesheet()
        my_styles = load_my_styles() # returns a cssutils style sheet.
        ss.add(my_styles)
        return ss

Then use that class to generate your line chart.

I acknowledge that the style customization interface is clumsy, which is why this ticket exists. This project is very generous with accepting user contributions, so do please if you can think of a better way, please share it and we'll get it into the next release.

@shaun-ba
Copy link

shaun-ba commented Nov 4, 2016

I'll take a look at the method you propose, but i'm looking for a working library unfortunately, i don't have time to code it myself.

As for the docs, its not a suggestion, they simply don't work on the page linked from pypi, and readthedocs is empty for this module https://svgcharts.readthedocs.io/en/latest/svg.charts.html#module-svg.charts.css

best,
shaun

@jaraco
Copy link
Owner Author

jaraco commented Dec 23, 2016

they simply don't work on the page linked from pypi

That's right. The support for pythonhosted got removed. I've updated the link in e5d0e00.

@pedromorgan
Copy link

Re Documentaion // its easy when u know how..

  • readthedocs and pythonhosted docs are crap... anyway imhp
  • gitlab-ci+pages is the best of breed ... having been around the houses over last decade +++

Pyspread is probably a good example as it required pyqt5 installation to even generate the docs..
https://pyspread.gitlab.io/pyspread/

It uses sphinx which is a pain in the butt, but the only effective way to do it also..

Note github actio is probably similar to gitlab.ci.. havent looked at it as I dont used github that much..

@jaraco
Copy link
Owner Author

jaraco commented Dec 1, 2020

@pedromorgan If you wish to change the way that docs are hosted, please file a bug and/or submit a PR to jaraco/skeleton in such a way that all projects can adopt the strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants