Google Charts: chxl and bhg - charts

http://chart.apis.google.com/chart?cht=bhg&chd=t:3771.5,3220|5508.25,5366.75&
chs=400x200&chds=0,9000&chxt=x&chxr=0,0,9000&
chm=N*cUSD2s*,000000,0,-1,11|N*cUSD2s*,000000,1,-1,11&chco=4D89D9,C6D9FD
How to put label for each group?
chxl=1:|Mean|Median - should do something like this, but result is nothing
By groups I mean this numbers: 1 = { 3771.5, 5508.25 }, 2 = { 3220, 5366.75 }

Try appending this:
&chxt=x,y,r&chxl=2:|Mean|Median|
It might not be exactly what you want, but it works fine when I tried it.

Related

getting issue in Dart

addorRemCcToList(EmployeeList item) {
print('add or');
print(_ccToListSelected.length);
print(_tempccToListSelected.length);
if (_tempccToListSelected.contains(item)) {
_tempccToListSelected.remove(item);
} else {
_tempccToListSelected.add(item);
}
print(_tempccToListSelected.length);
print(_ccToListSelected.length);
notifyListeners();
}
so this is a method through which i'm adding or removing items in _tempccToListSelected this list but the issue is when i make changes in _tempccToListSelected this list this _ccToListSelected list get the same changes and i didn't event touched it
as you can see in the picture it is the terminal showing the print result
You certainly have a line like this:
_tempccToListSelected = _ccToListSelected;
or the opposite.
This line don't copy list into another one but make a pointer to the other list (like in numerous language).
If you want to copy (duplicate) the liste use spread operator:
_tempccToListSelected = [..._ccToListSelected];
If you have code like this:
list1 = [];
list2 = list1;
this error is normal. You need give more information about this issue.

How to insert an option value into a select tag with CasperJS?

Well, the question is very self-explanatory.
Right now, I'm front of a form which has a select tag with a couple of options already. But I must insert a new one, with a different value that I will receive from a .json file.
The thing is: I haven't been able to find a suitable solution from the CasperJS documentation.
I've tried something like this:
this.fill('form.coworkerdiscountcode', {
'CoworkerDiscountCode.DiscountCode': ['Value1']
});
But no results. Any ideas?
Thanks in advance.
You can execute any javascript code by passing it to casper.evaluate like this:
casper.evaluate(function() {
var x = document.getElementById("coworkerdiscountcode");
var option = document.createElement("option");
option.text = "Kiwi";
x.add(option);
});

mysqli get something WHERE

So I only want to get items from userSubscriptionLevel WHERE the id is anything but 4 or 6. What's the best way to give this exclusions?
function getUserLevelMapping() {
global $mysqli;
$userLevels = $mysqli->get('userSubscriptionLevel');
$userLevelMapping = array();
foreach($userLevels as $userLevel) {
$userLevelMapping[$userLevel['code']] = $userLevel['id'] ;
}
return $userLevelMapping;
}
Look at IN and NOT IN - both super useful methods for looking for (or excluding) specific records.
In your case, a NOT IN query is what you want, and it would look like so:
Select ... WHERE userSubscriptionLevel NOT IN(4, 6)
(query all records excluding userSubscriptionLevel that is 4 or 6)

Typo3/Typoscript: indexed_search doesn't work with rootPidList

I want to use indexed_search in Typo3 4.6 but I have problem.
My page has a few main trees and I only want to search in the current tree.
The indexing works fine, seaching in all trees works too. But if I set the rootPidList to the id of my root page of the tree I want to search, then I got no results. :(
Any ideas?
page.config.index_enable = 1
plugin.tx_indexedsearch.search {
rootPidList = 1234
page_links = 10
}
plugin.tx_indexedsearch {
templateFile = typo3/sysext/indexed_search/pi/indexed_search.tmpl
_DEFAULT_PI_VARS.results = 10
}
I created a solution that worked for me. If somebody else has the same problem, her my solution:
plugin.tx_indexedsearch {
_DEFAULT_PI_VARS.sections=rl1_1234
search {
rootPidList = -1
}
}
Restriction of the section 1234 which is my tree I want to search in

KRL and Yahoo Local Search

I'm trying to use Yahoo Local Search in a Kynetx Application.
ruleset avogadro {
meta {
name "yahoo-local-ruleset"
description "use results from Yahoo local search"
author "randall bohn"
key yahoo_local "get-your-own-key"
}
dispatch { domain "example.com"}
global {
datasource local:XML <- "http://local.yahooapis.com/LocalSearchService/V3/localsearch";
}
rule add_list {
select when pageview ".*" setting ()
pre {
ds = datasource:local("?appid=#{keys:yahoo_local()}&query=pizza&zip=#{zip}&results=5");
rs = ds.pick("$..Result");
}
append("body","<ul id='my_list'></ul>");
always {
set ent:pizza rs;
}
}
rule add_results {
select when pageview ".*" setting ()
foreach ent:pizza setting pizza
pre {
title = pizza.pick("$..Title");
}
append("#my_list", "<li>#{title}</li>");
}
}
The list I wind up with is
. [object Object]
and 'title' has
{'$t' => 'Pizza Shop 1'}
I can't figure out how to get just the title. It looks like the 'text content' from the original XML file turns into {'$t' => 'text content'} and the '$t' give problems to pick().
When XML datasources and datasets get converted into JSON, the text value within an XML node gets assigned to $t. You can pick the text of the title by changing your pick statement in the pre block to
title = pizza.pick("$..Title.$t");
Try that and see if that solves your problem.
Side notes on things not related to your question to consider:
1) Thank you for sharing the entire ruleset, what problem you were seeing and what you expected. Made answering your question much easier.
2) The ruleset identifier should not be changed from what AppBuilder or the command-line gem generate for you. Your identifier that is currently
ruleset avogadro {
should look something more like
ruleset a60x304 {
3) You don't need the
setting ()
in the select statement unless you have a capture group in your regular expression
Turns out that pick("$..Title.$t") does work. It looks funny but it works. Less funny than a clown hat I guess.
name = pizza.pick("$..Title.$t");
city = pizza.pick("$..City.$t");
phone = pizza.pick("$..Phone.$t");
list_item = "<li>#{name}/#{city} #{phone}</li>"
Wish I had some pizza right now!