Skip to content

Tag: django

Trouble when parsing JSON string

I’m dumping JSON in Django view and then parsing JSON in JS to get the data. My view.py (Django) The ibm variable output in Django template is: My index.html (JS inside) The issue is: I’m having to JSON.parse double times to get the JS object. The variable mydata, despite the JSON.parse, is string…

Plotly.js for tidy data – Bar color

I’m new to plotly JS, but I have good experience with python – I want to get the same results as the following: Essentially to use the data value to add distinct colors to my bars, is there any easy way to obtain that results?, obviously I have a tidy dataset What I want to do is to color the