Multiple values per column with line chart

365 views
Skip to first unread message

Helen

unread,
Sep 21, 2011, 6:04:55 AM9/21/11
to Google Visualization API
Hello all,

I'm just getting started with the visualization API and I'm
investigating what I can and can't do.

I'd like to produce a line chart for a data set which spans 7 days.
Within the data set, there may be values missing for some days.
According to the documentation, I should be able to smooth this using
the interpolateNulls configuration option. The next problem that I
have is that for each day within the data set, there may be more than
one value. For example, Monday may have a value of 110, Tues 120 and
105, Wed 112, Thurs nothing, Fri 99 and 104 etc.. So for some days I
need to show more than one point in the same column. Is it possible
to produce a line chart given this data set?

Many thanks,

Helen

asgallant

unread,
Sep 21, 2011, 9:01:08 AM9/21/11
to google-visua...@googlegroups.com
Whether you can produce such a line chart or not is dependent on how you want your points connected.  Do you want a single line connecting all points (even when one day has multiple points), or do you want several lines, each connecting to no more than one point per day?

If you want multiple lines, then the LineCharts (http://code.google.com/apis/chart/interactive/docs/gallery/linechart.html) are what you want to use.  If you want a single line that passes through all points, then you might be able to get what you want using the ScatterCharts (http://code.google.com/apis/chart/interactive/docs/gallery/scatterchart.html).

asgallant

unread,
Sep 4, 2012, 12:43:02 PM9/4/12
to google-visua...@googlegroups.com
Then you want to use a scatter chart.  Make a DataTable with 4 columns: 1 for time, 1 for "today", 1 for "yesterday", and 1 for "week".  Then enter your data points, something like this: http://jsfiddle.net/asgallant/JDLuv/ 

On Tuesday, September 4, 2012 7:23:59 AM UTC-4, Ali wrote:
Hello all,

I want to draw line chart just like functionality of scatter chart. e.g i have 24 values in x-axis for a day like 0 to 23.And i have 3 column for today ,yesterday and week along y-axis.And i want to display 12 values for each column mean 36 values for 1 point of x-axis.Like if i have 6 hour then 36 values will be displayed for it 12 each for today,yesterday and week.

   Note: i have max 12 values for (y-axis) today ,week and yesterday it may be 7,6,9 along every hour of x-axis.

Many thanks,

   Kashif Ali

kashif ali

unread,
Sep 6, 2012, 3:51:47 AM9/6/12
to google-visua...@googlegroups.com
Hi Asgallant ,

Thanks for your reply you guide me that how i can draw this chart, But i have mentioned i need this functionality with line charts.
Is it possible?

Many Thanks,
Kashif Ali


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/lnQIT74yoJ0J.

To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

asgallant

unread,
Sep 6, 2012, 9:32:21 AM9/6/12
to google-visua...@googlegroups.com
ScatterCharts have a "lineWidth" option that you can set to a non-zero value to make the points connect with lines, which would look like this: http://jsfiddle.net/asgallant/JDLuv/1/.  Maybe that's what you're looking for, but I suspect you actually want something else.  Is this more what you're looking for: http://jsfiddle.net/asgallant/JDLuv/2/?
To unsubscribe from this group, send email to google-visualization-api+unsub...@googlegroups.com.

asgallant

unread,
Nov 5, 2012, 12:31:06 PM11/5/12
to google-visua...@googlegroups.com
Sorry, but multiple data points in a tooltip is not supported in ScatterCharts, unless you implement custom tooltips (using the "tooltip" column role).

If you can get away with using LineCharts instead (ie, you don't have multiple points in a single series for a single x-axis value), then you can use those and set the "focusTarget" option to "category".  Set the "lineWidth" option to 0 and the "pointSize" option to something larger than 0 to make the charts look like ScatterCharts.

On Monday, November 5, 2012 6:47:00 AM UTC-5, kanak chopra wrote:
I am having a similar problem. Even in this(http://jsfiddle.net/asgallant/JDLuv/) example if all the three categories have same count ([new Date(0, 0, 0, 0), 44, 44, 44],). It is showing only Week in the tol tip. How can I indicate mulitple categories are present at this point.

Thanks,
Kanak


Reply all
Reply to author
Forward
0 new messages