Control order the series are displayed in a Combo Chart

61 views
Skip to first unread message

thesweetbloodhound

unread,
Apr 21, 2017, 5:03:17 PM4/21/17
to Google Visualization API
I had a Combo chart that had two series: a line type and an area type.  I had the line chart series listed first in the options, and then the area chart series.  This made the line appear behind the area which is what I wanted.  Basically the z-index for the line was lower than the area.

I now need to add a third series, another line.  
series: {
0: {lineDashStyle:[10,5], lineWidth: 2, color: '#888', pointSize:0, enableInteractivity: false},
1: {type: 'area', lineDashStyle:[0]},
2: {lineDashStyle:[2,2], lineWidth: 2, color: '#888', pointSize:0, enableInteractivity: false}
},

I know that if we put series 2 before series 1 in the above code, this "should" give me what I want.  But because of the complexity of the data and the rest of the code, we are running into problems we don't have when we have the series in the above order.

Is there a way to set the z-index, or s order, or similar for each series, so that I can make the Area chart appear in front of both lines?  Right now, the series 2 line appears in front and we don't want that.

Daniel LaLiberte

unread,
Apr 21, 2017, 5:21:28 PM4/21/17
to Google Visualization API
We don't have any series ordering options, though we probably should. 
 
You may want to look into using a DataView to change the order of the columns while you leave your incoming DataTable as it is.

I'm actually surprised to hear that the area type series covers the line type series, because I thought we would always draw the lines above the areas, but I guess they are considered to be at the same level so the order of the series matters.

--
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+unsub...@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/c8219fac-3835-450d-96a6-b084fa6d9ed5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages