Google Charts: Bar chart labels are reversed - google-visualization

I create dinamically a chart for a website. I have a key/value map, I sort the values descending, and then create the url:
http://chart.googleapis.com/chart?
chs=400x200&cht=bhs&chbh=a&chdlp=l&chg=25,0&chma=0,0,0,5&chtt=Chart+test&
chxr=0,0,8,1&chds=0,8&chxt=t,y&
chd=t:8,5,3&
chxl=1:|Label_8|Label_5|Label_3
The values are set by chd=t:8,5,3, and the labels are set by chxl=1:|Label_8|Label_5|Label_3. However, in the chart image the labels are reversed.
I searched the documentation, but I didn't get why it is like this. Is it because I didn't set a value correctly, or is this the desired functionality?
I could reverse the label texts in chxl from code to be displayed how I want. Is this the right way?

i haven't found any mention about it either, but just made a try with -1 and it works. So use it like:
chxl=-1:|Label_8|Label_5|Label_3

Related

Extract column value using REGEXEXTRACT with ARRAYFORMULA

I have a column in Google Sheets with values like 1(current), 2(current), etc. I am getting these values from google form response.
I want to extract only the integer from cell value as 1,2,3.. so on.
I am able to use SPLIT(A2, "(current)") for cells. But this does not get applied for new values from form response.
I found that ARRAYFORLMULA can be used for applying a formula to new responses from forms, but somehow it isn't working. I tried them as mentioned below, but I am not sure if I am using it correctly.
=ArrayFormula(QUERY( SPLIT(E2:E,"(current)")))
=ArrayFormula(SPLIT(E2:E,"(current)"))
Can someone help with how to achieve above answer with REGEXEXTRACT?
try like this:
=ARRAYFORMULA(IFNA(REGEXEXTRACT(E2:E, "\d+")))

Checking cells for exact match

Long story short, we have a list of products on our website in CSV. All the product variants are assigned a colour. To save dev time, we've got it set up so that the background-color is the same is the variant name. Eg. background-color: red.
I'm wanting to take our list of products and say highlight all the ones that already have valid HTML colors. I've been able to do this by doing the following:
=regexmatch(C1,"Indianred|Lightcoral|Salmon|Darksalmon|Lightsalmon|Crimson|Red|Firebrick|Darkred|Pink|Lightpink|Hotpink|Deeppink|Mediumvioletred|Palevioletred|Lightsalmon|Coral|Tomato|Orangered|Darkorange|Orange|Gold|Yellow|Lightyellow|Lemonchiffon|Lightgoldenrodyellow|Papayawhip|Moccasin|Peachpuff|Palegoldenrod|Khaki|Darkkhaki|Lavender|Thistle|Plum|Violet|Orchid|Fuchsia|Magenta|Mediumorchid|Mediumpurple|Rebeccapurple|Blueviolet|Darkviolet|Darkorchid|Darkmagenta|Purple|Indigo|Slateblue|Darkslateblue|Mediumslateblue|Greenyellow|Chartreuse|Lawngreen|Lime|Limegreen|Palegreen|Lightgreen|Mediumspringgreen|Springgreen|Mediumseagreen|Seagreen|Forestgreen|Green|Darkgreen|Yellowgreen|Olivedrab|Olive|Darkolivegreen|Mediumaquamarine|Darkseagreen|Lightseagreen|Darkcyan|Teal|Aqua|Cyan|Lightcyan|Paleturquoise|Aquamarine|Turquoise|Mediumturquoise|Darkturquoise|Cadetblue|Steelblue|Lightsteelblue|Powderblue|Lightblue|Skyblue|Lightskyblue|Deepskyblue|Dodgerblue|Cornflowerblue|Mediumslateblue|Royalblue|Blue|Mediumblue|Darkblue|Navy|Midnightblue|Cornsilk|Blanchedalmond|Bisque|Navajowhite|Wheat|Burlywood|Tan|Rosybrown|Sandybrown|Goldenrod|Darkgoldenrod|Peru|Chocolate|Saddlebrown|Sienna|Brown|Maroon|White|Snow|Honeydew|Mintcream|Azure|Aliceblue|Ghostwhite|Whitesmoke|Seashell|Beige|Oldlace|Floralwhite|Ivory|Antiquewhite|Linen|Lavenderblush|Mistyrose|Gainsboro|Lightgray|Silver|Darkgray|Gray|Dimgray|Lightslategray|Slategray|Darkslategray|Black")
However, that's not finding the exact match. For example, it's returned things like Black/ White as having a match, which obviously wouldn't work as a HTML color. It's also found things like 'Swedish Blue', presumably because it's found the Blue.
If your list is in the format as shown and you have another list, say in ColumnI, of valid HTML colours then select ColumnC and: Format > Conditional formatting..., Format cells if... Custom formula is and:
=match(trim(mid(C1,19,len(C1))),I:I,0)
with highlighting of choice and Done.

Hide Chart.js bubble points based on filtering

I am using Chart.js 2.5.0 and wondered if anyone could give me some pointers on the following functionality requirement.
I have a bubble chart that for arguments sake contains tweets.
I have a list view next to the chart that display the tweets. Connected to this is the ability to filter, so it will only display tweets with specific string value the user inputs.
What I would like to do is when the user utilities the filter, it only shows the bubbles corresponding to the filtered result. I am passing the pointIndex and the datSetIndex into my table. However, I am really struggling in working out how to update the chart so it hides the bubbles that are not matching the current filter output.
Any suggestions?
This doesnt solve my entire issue as Im using Vue which seems to be causing issues with updating the chart. However if you are using plain chart.js the blow fiddle gives one way to hide specific or all points
`https://jsfiddle.net/prmw1bm2/12`
it may help someone somewhere

Dygraphs equivalent for GViz setVisibleChartRange?

On our website http://tradingderivatives.eu/DAX-root.html, you can select a part of the tables and the graph will respond by zooming; the table event handers call the setVisibleChartRange method of the graph. Is there something similar for the graphs by Dygraphs?
I tried,among others, to google for "setVisibleChartRange Dygraphs" but nothing useful appears.
You do this by calling updateOptions. If you want to set the y-axis range, set valueRange. If you want to set the x-axis range, use dateWindow:
g.updateOptions({
dateWindow: [minDateInMillis, maxDateInMillis],
valueRange: [yAxisMin, yAxisMax]
});

Hide tooltip for Google Visualization API GeoChart

I am creating a markers-based Geochart to display the location of schools. I have my data in a Google docs spreadsheet. I'm using 3 columns: lat, long and marker size. Currently, the tooltips display lat and long. Ideally, they would display information about each school instead but removing them would be fine, too. See what I have so far on jsfiddle.
Some of the other Google visualizations seem to allow a trigger:'none' option for tooltip (e.g., Pie Chart). Am I correct that there is no such thing for GeoChart?
It seems there's an experimental feature that allows assigning a tooltip role to a particular data column. I tried to use that to no avail.
I tried finding and hiding the tooltip div but I couldn't figure out how to access any elements in the iframe that contains the map. I'd be perfectly happy with this kind of solution if I could get it to work!
I realize this is not exactly what Geochart seems meant for but I'm using other Geochart region maps on the same page and would like to keep the same aesthetic.
I know this is an old question, but maybe it can still help.
Check out this example:
data.addColumn('number', 'Lat');
data.addColumn('number', 'Long');
data.addColumn('string','tooltip');
data.addColumn('number','Example');
data.addRows([[41.151636,-8.569336,'Portugal',{v:0,f:'test PT'}]]);
data.addRows([[ 39.059575,-98.789062,'USA',{v:1,f:'test US'}]]);
You can now also disable the tooltip adding, which was not previously available:
tooltip.trigger:'none';
Here is an example: http://jsfiddle.net/cmoreira/njB6m/