I would like an array of coefficients. Its much easier to understand to me than the other two options. Currently I calculate the trendline myself (3rd - 6th order polynomial) and store the resulting coefficients in an array. I then have to create a dataset using the equation to graph over the original dataset to check the fit visually (I think. I'm still working on this). The trendline function is then used in later calculations.
Getting the equation output directly from the trendline option would save me a bunch of work. On Tuesday, October 28, 2014 at 2:33:35 PM UTC-4, 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 http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
