The only way we have currently to smoothen the data is to aggregate it,
using the data.group function.  See documentation at
https://developers.google.com/chart/interactive/docs/reference#google_visualization_data_group

You would specify a key with a custom modifier function that changes values
within an hour to a whole hour,
and then in the 'columns', specify an aggregation by averaging all the
values that have the same hour.

Another way to think about smoothing is a moving average, where instead of
one-hour discrete buckets, you would use a sliding window over the
preceding hour.  We don't have a way of computing such a moving average, so
you would have to do that on your own.  But you could do that a little more
simply with a DataView and a calculated column, using the setColumns method.

On Sun, Jun 10, 2018 at 2:34 AM nadavs <sarussina...@gmail.com> wrote:

> I've been working on a project with google charts for a while now. I have
> lots and lots of data points and i want to smooth it out.
>
> I'm generally looking for this:
> https://developers.google.com/chart/image/docs/gallery/line_charts#data-granularity
>  but
> with the current version of google charts.
>
> this is how a graph the represents a *day* looks like: [image: enter
> image description here] <https://i.stack.imgur.com/m5ymh.png>
>
> this is how a graph the represents an *hour* looks like: [image: enter
> image description here] <https://i.stack.imgur.com/5rU69.png>
>
> I use ChartRangeFilter to "zoom" in and out on the graph but I want to
> smoothen the lines so it would look more reasonable.
>
> I know i can do this manually by averaging the data but it feels like an
> overkill. any suggestions?
>
> thanks!!!
>
> --
> 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 google-visualization-api+unsubscr...@googlegroups.com.
> To post to this group, send email to
> google-visualization-api@googlegroups.com.
> 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/7e73820e-dcf0-45f7-9abc-88079623b975%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/7e73820e-dcf0-45f7-9abc-88079623b975%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
dlalibe...@google.com <dlalibe...@google.com>   5CC, Cambridge MA

-- 
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 google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
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/CAOtcSJOCagS-0dBH_2Dfgw18U7iUJ1nebwL6yGuk92G2GBM5Fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to