Hi Nick, Thanks for your message.
We currently don't have any way of exporting trendline data. The entire purpose of this thread was to figure out what data people actually wanted. However, it seemed to me that the thread didn't reach consensus, and some of the posts were just flatout off-topic. So to answer your questions, you currently cannot extract the trendline data from a chart. If you need this today and are unwilling to wait for us to implement the trendline retrieval API (which could take a while), you would have to implement your own linear regression <https://en.wikipedia.org/wiki/Linear_regression>, and compute the trendline yourself. As for your second question, we have not given any thought to piecewise trendlines. We will consider this feature for inclusion in the API when we start work on implementing multiple trendlines for the same series. On Fri, Jan 22, 2016 at 11:07 AM <[email protected]> wrote: > Hi Sergey, > I wanted to resuscitate this thread because I had a couple of questions. > > Firstly, what is the current official method for exporting trendline data? > I know that your API stores the information because it appears in the > trendline tooltip. Suppose I want to get that information in an array? Or > how would I go about generating a series of trendline data points that I > can plot separately? This is important to me in a current application where > I need to store scatter chart trendlines from mulitple datasets in their > own dataTable which I can use separately to generate line charts. > > The second question is whether you have given any thought to including > spline fitting functionality in your trendlines. Here the use scenario > might be that I want to use a cubic polynomial for data domain X: {0,10} > and a linear trendline for X>10, with a spline fit to join them together. > > All feedback appreciated. > > Nick > > > On Tuesday, October 28, 2014 at 6:33:35 PM UTC, Sergey wrote: >> >> Dearest Google Charts users, >> >> >> We have been working hard on improving charts, and now need your input. >> We are considering adding a few methods to our corecharts to help you get >> data about your trendlines, such as the r^2 value. However, we're not quite >> sure how you’ll want to use them. We know that we want a method to get the >> trendline r^2 value, and we think that getting an evaluator function for a >> trendline would be useful as well; but we also want to give you the ability >> to pull out the trendline expression. Here's where things get a bit blurry. >> >> >> We could do the simple thing, and simply create a method that returns the >> plaintext equation. This would allow you to show the equation elsewhere on >> the page. You might also parse it, but parsing can be hard, so we’ll >> provide some utilities to help with that. Some alternatives to mitigate >> this issue would be: >> >> - >> >> to return a JSON form an abstract syntax tree >> <http://en.wikipedia.org/wiki/Abstract_syntax_tree> of the equation, >> an example might be: >> - >> >> y = 2x + 1: {operation: '=', operands: ['y', {operation: '+', >> operands: [{operation: '*', operands: [2, 'x']}, 1]}]} >> - >> >> to return a Lisp/Scheme-like abstract syntax tree, using arrays and >> prefix notation. An example of that might be: >> - >> >> y = 2x + 1: ['=', 'y', ['+', [2, 'x'], 1]] >> - >> >> to return an array of coefficients, possibly with the type of the >> trendline: >> - >> >> 2x + 1: {type: 'linear', coefficients: [2, 1]} >> - >> >> exp(5x + 3): {type: 'exponential', coefficients: [5, 3]} >> >> >> We can also return an abstract syntax tree as well as a plaintext form, >> though that is getting a bit redundant. So, what are your thoughts here? >> Your opinions are most welcome. >> >> >> Happy Coding, >> >> Sergey and the rest of the Google Charts Team >> >> >> -- > 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/3d24532b-df2b-4894-a0dc-c6bf6e4db97e%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/3d24532b-df2b-4894-a0dc-c6bf6e4db97e%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/CAEwwup7OG0Posdw15p5HEs58Ri5o7acFu8SiLz3VWNbtU%2BHytQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
