Open templargin opened 4 years ago
What is the template rendering looking like? Can you tell me what you see when you load the url in your browser?
I am having the exact same problem, any solution? an example of how to do it properly would be great
I'm curious if this works for anyone. It does not appear that there's even a way to set the colors on the bar chart (there's not a get_colors()
like there is for BaseLineChartView
, and chart.js expects a datasets
in the JSON object, but one isn't defined in the context.
I have hacked together something that seems to work, and I can make a PR but I'm not sure this repo is even maintained, or if this would break things for existing users.
Hello @iragm feel free to provide a PR. It would be great not to break to many things for existing users but I believe we can make it work.
That is the code that is working on my system. I am brand new to both chart.js and this project, so feedback is welcome.
Something I can't seem to figure out about this project is why there isn't a generic Chart class in base.py that has functions like get_colors()
-- a good chunk of the code in my PR is just copied from lines.py with slight edits and it would make sense to have a base class that has the common functions.
My view:
My url:
Template:
Line chart works fine, but just a simple change to implement a bar chart just returns a grid with 1.0 max on Y axis.