javascript - Dynamically changing chart data using Django and Highcharts? -


How can I allow a user to change the status of the graph and update it on the page?

For example, allows a user to adjust the size of a graph without having to re-administer it.

I am using high charts in Django, which I thought of doing is this. Send all the data up, and set a default size so that there is something to show. Then a dropdown or some addition that allows the user to increase the size of the graph. When a user selects one of them, I somehow slice the data to increase the size.

Example, the list is sent to L = [1,2,3,4,5,6,7,8,9,10], but the default size is 5. Therefore only L [: 5] has been displayed. The user chooses the size of 6, so it reloads so that El [: 6] is displayed.

Example graph:

example graph

< P below is the code snippet of my class based view. A user searches the reddit user who wants to analyze -> data is collected, fun things are done and all charts are set ->

  def post (self, requested): ... top_chart_series = Consolidated user data, ready to be parsed in JS. # Currently I'm only sending the default size of the data (top 10 words) # But what I want to do is send all the data and after that it settles in JS. Submit Return (Request, & lt; htmlpage.html & gt;, ... lots of variables, {'top_chart_series': top_chart_series ...}) .... Send to JS # So this is where I I'm a bit confused. # At this point, the page is being loaded and the charts are being installed through JS: # So my question is, how can I allow the user to adjust the size of the graph without reposting it without # ? # I lack the knowledge of JS, so that's probably why I can reach it. Anyway, what I was thinking, once all the data is sent, I first chart a graph with the original size (10 words), and then if the user decides to adjust the data # then I Run the function again (?) With the selected size # Here are JS which I currently use, I have not mentioned anything I described. The variables sent by top-word (targets, titles, categories, data) of the function {// parameters: DNS / EG, top_words ('# top_church', 'top word', '{{top_chart_series.categories | secure}}' Are, '{{top_chart_series.data | safe}}'); Var seriesation = JSON.parse (data); Var categories = JSON Paragraph (categories); (Title: {text: null}, categories: categories}, yAxis: {title: {text: $ {target}} {title: {text: {type: 'bar'}, title: {text: null} XAxis: 'Receivable'}}, Export: {Enabled: False}, Credit: {Enabled: False}, Plot Options: {Bar: {showInLegend: false}}, series: seriesoption});  


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -