What Charting API / Tool is this? [closed] - api

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
What Charting API / Tool is this?
http://wordpress.org/extend/plugins/multiple-post-thumbnails/stats/
The pie chart at least is an svg canvas inside of an iframe. i am confused what they are using, but I like it.
image http://img38.imageshack.us/img38/6513/picturets.png

google.load("visualization", "1", {packages: ["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
jQuery.getJSON('http://api.wordpress.org/stats/plugin/1.0/multiple-post-thumbnails?callback=?', function (data) {
draw_graph(data, 'version_stats', 'Active Versions');
});
}
function draw_graph(versions, id, title) {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Version');
data.addColumn('number', 'Usage');
var count = 0;
jQuery.each(versions, function (key, value) {
if (Number(value) > 1) {
data.addRow();
data.setValue(count, 0, key);
data.setValue(count, 1, Number(value));
count++;
}
});
var chart = new google.visualization.PieChart(document.getElementById(id));
chart.draw(data, {width: 360, height: 240, title: title});
}
It looks like they are using Google's charting API: http://code.google.com/apis/chart/interactive/docs/index.html

Related

why can i not call a function of my vue component in my callback [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
i am use datatables and jquery in vue and
> <script>
> export default {
> methods: {
> ddd() {
> alert(44444444);
> },
> },
> mounted: function () {
> let table = new DataTable("#tbl", {});
> $("#tbl tbody").on("click", "tr", function () {
> this.ddd();
> });
> },
> };
> </script>
why ddd() is not work please help me
Your issue is lexical scoping. the callback method you're provided is an anonymous function which redeclares the value of this. To solve it, use a fat arrow.
$("#tbl tbody").on("click", "tr", () => {
this.ddd();
});

Get DevExtreme DropDownBox Selected Values [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I use multi select DevExtreme DropdownBox in View and fill it from model
but I can't get selected values in controller on Post method
how I can read selected values?
I got a #Html.HiddenField then filled the hiddenfield value in below js function:
function getSelectedItemsKeys(items) {
var result = [];
items.forEach(function (item) {
if (item.selected) {
result.push(item.key);
}
if (item.items.length) {
result = result.concat(getSelectedItemsKeys(item.items));
}
});
$("#myHF").val(result);
return result;
}
then send hidden field to controller by view model.

more elegant way to set state [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
In the following function is there a more elegant or best practice way to setState?
startStop(){
if(this.state.start === 'Start') startStop = 'Stop'
else startStop = 'Start'
this.setState({start:startStop})
}
for the flag, instead of string Start/Stop use true-false,
Eg:-
constructor(props){
this.state={
start:false
}
}
startStop(){
this.setState({start:!this.state.start})
}
render(){
return<Text>{this.state.start?'Running':'Stopped'}</Text>
}
If you had something like:
state = {
keepGoing: false,
}
Then you could do the following to toggle:
this.setState({ keepGoing: !this.state.keepGoing });
this.setState({start:this.state.start==='Start' ? 'Stop' : 'Start'})

Google feed api deprecated, How can i find rss feed of web site? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I used Google Feed API for finding rss feeds of special keywords or websites, now this api deprecated, so i need alternative way for finding rss of website, I google it but i cannot find any good way..
Find rss from parsing html of website is not good for me because i want to find all rss from any subdomains of it.
For example in the past when with using Google Feed API i give ieee.org and get all rss like:
http://www.ieee.org/rss/index.html?feedId=News_Release
http://spectrum.ieee.org/rss/fulltext
http://spectrum.ieee.org/rss/blog/automaton/fulltext
and ....
So, Is there any api or services that i can find all of rss feeds of website?
Feedly's API could fit your requirements. See https://developer.feedly.com/v3/search/
Pass the site's domain name as query parameter and you'll get rss feed matches:
https://cloud.feedly.com/v3/search/feeds/?query=ieee.org
You can use rss2json API to get feed data same as google feed API did.
var url = "http://www.espncricinfo.com/rss/content/feeds/news/8.xml"; //feed url
var xhr = createCORSRequest("GET","https://api.rss2json.com/v1/api.json?rss_url="+url);
if (!xhr) {
throw new Error('CORS not supported');
} else {
xhr.send();
}
xhr.onreadystatechange = function() {
if (xhr.readyState==4 && xhr.status==200) {
var responseText = xhr.responseText;
var result = JSON.parse(responseText);
console.log(result);
}
}
function createCORSRequest(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
xhr = new XDomainRequest();
xhr.open(method, url);
} else {
xhr = null;
}
return xhr;
}

How to write html custom attribute in less use Mixins [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
how to write html custom attribute in .less Use Mixins for example
[margin="2"]{margin:2px;}
You should explain why you want to use Less in this situation. Notice that Less only compiles static CSS.
You can use a Less mixin to dynamically built your CSS rules:
.createmargins(#i) {
& when (#i > 1) {
.createmargins(#i - 1);
}
[margin="#{i}"] { margin: unit(#i,px); }
}
.createmargins(100);
outputs:
[margin="1"] {
margin: 1;
}
[margin="2"] {
margin: 2;
}
[margin="3"] {
margin: 3;
}
and so on......
Demo: http://codepen.io/anon/pen/yyXEgg
The above possible generates a lot of unused CSS classes. Alternatively consider using jQuery (or jvascript) on DOM ready:
$("[margin]").each(function(){
$(this).css('margin',$(this).attr('margin') + 'px');
});
Demo: http://codepen.io/anon/pen/rawKjz