Hi, The Line Chart will always scale your data to fit the chart. So if you have a lot of data, then it will just all be squished into the chart, instead of having a certain part no longer be visible (Column Charts have slightly different behavior). If that's the behavior you want, then you will have to analyze the range of your data and set the chart's view window appropriately. You'll then want to hook up 'explorer' mode in order to enable drag-to-move on the chart (to be able to explore the older data).
On Tue, Feb 23, 2016 at 4:49 AM beginnerGG <[email protected]> wrote: > Dear Users, > > I have the following code to draw a graph from a DB query in my html-body: > > <div id="chart_neo_div"> > <script> > function drawChart() { > var jsonData = $.ajax({ > url: "Antwortzeiten_.php?seite=Neo", > dataType:"json", > async: false > }).responseText; > > // Create our data table out of JSON data loaded from server. > var data = new google.visualization.DataTable(jsonData); > > // Instantiate and draw our chart, passing in some options. > var chart = new google.visualization.LineChart(document. > getElementById('chart_neo_div')); > chart.draw(data, {width: 1000, height: 240}); > } > window.setTimeout(drawChart(), 10000); > </script> > </div> > > The width is 1000 fixed. The source of the data is a database, that is > growing. Thus the amount of data points to be displayed is increasing each > time the LineChard is drawn. > > 1. To display more and more data points in this graph its width should > dynamically grow with the data. > 2. As the width of the html-page is limited, I need a scroll-bar for this > at some limit. > 3. Ideally the y-axis label and the legend is fixed outside the > scroll-able area, so that this information is always seen (When I make the > whole div scroll, the legend and the x-axis is also shifted out of the > displayed area). > > I would be pleased, if you have some hints how to do this, as I am a total > beginner in this field. > > Best regards and thank you! > > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to > [email protected]. > Visit this group at > https://groups.google.com/group/google-visualization-api. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-visualization-api/67f7eeba-2a0c-4456-bb6e-940e092a38b0%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/67f7eeba-2a0c-4456-bb6e-940e092a38b0%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- *[image: unnamed.gif]• Sergey Grabkovsky• Software Engineer• Google, Inc• [email protected] <[email protected]>* -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAEwwup4RFvtfT%3DyDgfZqS4XVE%3D%2BwLBqUrWfXwTKm4f5y-VgeBg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
