Python Forum
Thread Rating:
  • 2 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Highcharts: JS to Python
#3
Thank you for your in depth response; my response may be a misunderstanding of your response to please forgive me if I am wrong. My question was not about how to have Highcharts JS interact with Flask; I know how to do this (if not clumsily :P) to send data back and forth between JS and Flask and vice versa. When I said I "downloaded" I meant that I "pip installed" Highcharts Python and tried to run the python scripts from their provided demo files in my Virtual Environment and found that I did not know how to output/display the data.

I have TWO completely separate questions related to TWO completely different versions of Highcharts. I did not want to flood the forum with TWO different posts covering similar topics so I placed it all in one, let me rephrase the first question:

(1) How do I take Charting tools in Python and visually display them; what tools do I need and what process would there be for being able to visually display charts with tools like Highcharts python or even matplotlib. I used Highcharts Python as an example because I'm not sure how or where to display it.

(2)

My second question was basically asking: Can someone help me with the proper way to convert the JS code to Python, and to understand what I've been doing wrong. As it turns out I was trying to convert JS line for line into Python line for line and they have two completely different ways of handling data. I did not need the 'while condition' as I thought, the for loop on it's own was sufficient, and I needed to handle the Python code as a dictionary. I'm still fiddling with it but this code appears to do what I was trying to do with datalength dropped:
 for extract in self.data:
            self.ohlc = self.data['values']
I suspect a better way to have tried to convert JS over to Python would have been to explore what it was trying to do in JS and then understand Python works completely different and focus on how I would express the same concepts in Python with no interference from how I think JS would have solved it.

I tried to be as detailed as possible; walking through my attempts to solve the problem so as to make clear I was not being lazy asking for help and was trying. I thought this information would be relevant, but perhaps not so much :D
Reply


Messages In This Thread
Highcharts: JS to Python - by Leaf - Nov-01-2017, 10:46 PM
RE: Highcharts: JS to Python - by snippsat - Nov-02-2017, 02:41 PM
RE: Highcharts: JS to Python - by Leaf - Nov-03-2017, 10:47 AM
RE: Highcharts: JS to Python - by snippsat - Nov-03-2017, 01:05 PM
RE: Highcharts: JS to Python - by Leaf - Nov-03-2017, 02:13 PM
RE: Highcharts: JS to Python - by snippsat - Nov-03-2017, 03:32 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020