How can I get Google Charts to display multiple colors in a scatter chart? - google-visualization

I would like to display multiple colors (and potentially shapes and sizes) of data points in a Google Chart scatter chart. Does anyone have an example of how to do so?

I answered my own question after waiting SECONDS for an answer here :-)
You can indeed have different colors for different data elements. For example:
http://chart.apis.google.com/chart?chs=300x200&cht=s&chd=t:1,2,3|6,5,4&chds=1,3,0,10&chxt=x,y&chxl=0:|0|1|2|1:|0|10&chm=d,ff0000,0,0,8,0|a,ff8080,0,1,42,0|c,ffff00,0,2,16,0
It's the chm= that does the magic. I was trying to have multiple chm= statements. You need to have just one, but with multiple descriptions separated by vertical bars.

You can only use one dataset in a scatter plot, thus only one color.
http://code.google.com/apis/chart/#scatter_plot
From the API description:
Scatter plots use multiple data sets differently than other chart types. You can only show one data set in a scatter plot.

You could effectively fake a multi-color scatter plot by using a line plot with white lines and colored shape markers at the points you want to display.

Here's another example: twitter charts. I'm hoping to do the same thing. Need to find out how to do the concentric circles.

Related

How to create a bar chart with one x axis and two paralel y axes in PowerBI

I am new to PowerBI so sorry in advance. I would like to reproduce the plot below (created in Tableau) in PowerBI.
I need the two plots to be sorted by the values of the first one.
In PowerBI I can generate two such plots, but I do not manage to use the values of the first plot to sort the second one.
How can I do that?
Plot with an x-axis that is shared by two bar chart plots

Is it possible to develop the line charts with multiple colors in powerbi?

I developed the few Line charts for BMP280 sensor data in powerbi. This is one of the line chart for displaying the temperature value by time and device id.
But I want same line chart with different Color like this below image, whenever temperature value suddenly changes.
Can you please tell me is it possible to develop the Line chart with multiple colors?
If you're willing to consider a vertical bar chart instead of a line chart, you would be able to create a calculation for each row that determines whether the change is significant, potentially by comparing an aggregate of recent measurements to specific thresholds.
Once you do that, you would use this column's value as a legend for your visualization. So if a row has a value of "Significant Positive Change" (or something like that), the bar or bars showing that change can be red.
Your other alternative is to use an R-based visual, of which there are surely examples of this type of visualization. I'll update this answer if I find one that looks promising.
Instead of tending 1 data series, you can split it into 2 data series e.g. one with normal temperatures and one with high temperatures. Then you can just plot these in different colours. Just make sure that the ranges are same i.e. cannot be 'Auto'.

Plotting/finding perimeter of data on a scatter plot

Regarding the included graph (It's been ListLinePlotted to show the data sets more clearly),
1: How would I find and or plot the perimeter of each data set; ideally in List form, so it will scale when I plot it using LisLogPlot alongside the original data. (Similar to FindCurvePath, but for a non-round shape)
2: How would I fill the entire area encompassed by the data set on the ListPlot. i.e. the resulting graph would have four block color areas in the shape of each region.
Essentially I'm just trying plot graphs which clearly show the different regions. If there are better ways then I'd be open to suggestions!
P.S. the regions will never intersect for this particular plot.

Google charts API - multiple charts on the same image

Is there a way to display multiple charts on the same image using Google Charts api?
To elaborate:
I have one data series which I want to display as bar chart.
I have another data set which has nothing to do with the first one (well they are correlated but the values are hundred times bigger).
X-axis is for dates.
I want to have second data set displayed as line chart with Y-axis on the left.
I found something similar in "Compound charts" section but as far as I understand markers are calculated based on already displayed data set - and I want to have them independent.
In other words - is it possible to make image like this:
http://chart.apis.google.com/chart?cht=bvg&chm=D,0033FF,1,0,5,1&chs=200x150&chd=t1:30,10,20|60,40,50&chxt=y
but with the line being independent and their values axis being on the right.
I'm sorry I'm not familiar with the terminology - I'm sure there is a name for what I'm trying to achieve.
Thanks!
Only 2 years behind the curve but just to let you know that I have achieved your objective of displaying 2 datasets (one a bar chart, the other a line chart) against 2 different axis scales.
The devil is in the scaling parameter &chds and explicit axis values using &chxr. Essentially, I defined the explicit scales for the x-axis, y-axis and r-axis. and then instructed the scaling parameter to scale each dataset differently.
So for an r dataset between 0 - 10 and a y dataset between 0-2 I would write;
&chds=0,2,0,10 (y then r defined in my axis parameter, i.e. &chxt=y,r)
...and...
&chxr=0,0,2|1,0,10
Let me know if you need more detail!
I've looked into something similar to this before and have used the google chart API a lot. I'm 90% sure the answer is no. Sry :(
Yep it is possible.
Here is an example of two datasets displayed on the same axes. 1 is a bar chart the other is a line graph....
This line - chd=t1:95,1,1,3,10,3,77|95,52,44,24,11,2,1 - allows for the two datasets.
slothistype

How do I specify multiple data sets to an XY-scatter plot using the Google Chart API?

Why doesn't this Google Chart API URL render both data sets on this XY scatter plot?
http://chart.apis.google.com/chart?cht=lxy&chd=t:10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200|0.10,0.23,0.33,0.44,0.56,0.66,0.79,0.90,0.99,1.12,1.22,1.33,1.44,1.56,1.68,1.79,1.90,2.02,2.12,2.22|0.28,0.56,0.85,1.12,1.42,1.68,1.97,2.26,2.54,2.84,3.12,3.40,3.84,4.10,4.53,4.80,5.45,6.02,6.40,6.80&chco=3072F3,ff0000,00aaaa&chls=2,4,1&chs=320x240&chds=0,201,0,7&chm=s,FF0000,0,-1,5|s,0000ff,1,-1,5|s,00aa00,2,-1,5
I've read the documentation over and over again, and I can't figure it out.
First a point of clarification. You talk about a "XY scatter plot", but these are actually 2 distinct chart types in the Google Chart API. Your URL refers to cht=lxy parameter which is an XY line chart.
The first problem with your URL is your data parameter (chd). Since it is an XY line chart, data sets must be defined in pairs but I see an odd number of data sets (3).
Christian D's response is incorrect. There is no percentage requirement.
You may be better off using a wrapper API which abstracts away many of these ugly details.
I think it actually does render both data sets, but you can only se one of them because there's only one scale on the y axis. (In other words, 0.10 is too small to show.)
And, you should really be using percentages. 100 is the highest accepted value:
Where chart data string consists of positive floating point numbers from zero (0.0) to one hundred (100.0)