0

I'm looking at grasping the meaning of Google Visualisations series property. So for example whats the meaning of the series statement below with regards to the dummy data I placed after the text.

    series: {2: {type: "line"}}

Using the data below does the above mean plot a line graph using data in the final column.

Dummy Datatable:

data.addRow(["Set 1", 900, 450, 50]);
data.addRow(["Set 2", 700, 550, 40]);
data.addRow(["Set 3", 500, 350, 30]);
data.addRow(["Set 4", 300, 100, 20]);
data.addRow(["Set 5", 150, 50, 10]);

OR

Using the above datatable does series: {1: {type: "line"}} mean plot a line graph using column two data?

ANM
  • 65
  • 1
  • 4
  • 11
  • The number in `series: {2: {type: "line"}}` and `series: {1: {type: "line"}}` is the zero based index of a column in the data that, in this case, will be graphed as a line in a combo chart. – drs9222 Apr 19 '15 at 00:15
  • I should also point out that the first value in the array for each row is the x-axis value. So you have one x-axis value and 3 y-axis values indexed 0-2 as series. – drs9222 Apr 19 '15 at 00:21

1 Answers1

0

Here is an updated example. This is the same as your other question but using the data provided in this one.

In this case I used series: {1: {type: "line"}} so the first value of each row of data ('Set *') will be the x-axis. The second value of each row of data (900,700,...) will be the series with index 0 and will be drawn as a bar. The third value of each row of data (450,550,...) will be the series with index 1 and will be drawn as a line. The forth value of each row of data (50,50,...) will be the series with index 2 and will be drawn as a bar.

Output

See the official DataTable documentation for more info.

Community
  • 1
  • 1
drs9222
  • 4,448
  • 3
  • 33
  • 41
  • Really appreciate the help .. dunno how I would have figured out how to add independent line graphs into a combo chart .. I built on your fiddle here it is: jsfiddle.net/dr5eaevq/5 – ANM Apr 19 '15 at 13:26
  • The next step for me is creating and linking individual Y-axis with each line related series. – ANM Apr 19 '15 at 13:28