As you can see the chart displays with yaxis and axis but the value for xaxis is not shown. My data looks like this,
Array
(
[series] => Array
(
[0] => Array
(
[answer_option_group_id] => 0
[name] => All
[data] => Array
(
[999] => 1
[172] => 1
[173] => 0
[174] => 77
[194] => 6
)
)
[174] => Array
(
[answer_option_group_id] => 174
[name] => Does Not Meet
[data] => Array
(
[1459dcb35a7888ab4ff3dd89c07d679e] => 7
[c424759c02fd0900e3ec7c58c745138c] => 1
[e789fa7486d59950d382b8c395de166a] => 2
[b6c632c0a07b9feaa1eefe547a1a6aa8] => 4
[2ecfa0fc3d3990a2ff30009bea9b8ae0] => 2
[b6a52c346ad6a9f4cc58ddfe3c83939e] => 8
[36894aa1fcc16e360813d1ef430bb8fa] => 6
[4284ce3f8523823a457602fe5997fcfa] => 5
[e45e137a7da3e3fe5dc3785d7d628e44] => 11
[fb9bd545acc9397e0c84a8ff5d1a3b92] => 3
[1bcace373da4bb1e821158e3a5fa80a4] => 7
[88928dea322b243c18082e23aa9bc7a4] => 1
[2e9cf454d6eb69e69e744fcc15287f49] => 3
[eaa42f3a7bf5e5f2ac3198d5f8d487a4] => 3
[690463148302dc63a0dfd327ab5253f9] => 1
[325795fe2d5f5a22136b2362ee863be4] => 4
[18bb150bdbf978e058b44ba52d836591] => 1
[418702f6d334d6531e9ac4883a690adb] => 7
[c1ebb58ebb59c5bc6bb87a567c763cfe] => 1
)
)
)
)
I used console.log() to check if I got the data right and the result looked like this,
["All", "Does Not Meet"]
[85, 77]
I tried this on having a jsfiddle and it worked but on my server it didn't. I also dont think this is about the including of scripts since it already displays the chart only that the values are not shown. Any help would be appreciated. Thanks.
Related
I'm trying to get videos from my channel using search function. Response include only nextPageToken, but no prevPageToken. prevPageToken is null always, even if I'm listing other pages using nextPageToken. I use an access_token param from Google Oauth.
My request:
$searchResponse = $youtube->search->listSearch('snippet', array(
'forMine' => 'true',
'order' => 'date',
'pageToken' => $pageToken,
'type'=>'video',
'maxResults' => '10',
'q' => $searchQuery,
));
Result:
Google_Service_YouTube_SearchListResponse Object
(
[collection_key:protected] => items
[etag] => "XXX"
[eventId] =>
[itemsType:protected] => Google_Service_YouTube_SearchResult
[itemsDataType:protected] => array
[kind] => youtube#searchListResponse
[nextPageToken] => Cib3-ZrgSf____9uWHdEYVNIVnlOVQD_Af_-blh3RGFTSFZ5TlUAARAPIbmtEhE6-iWlOQAAAAC2H2UGSAFQAFoLCdIYcGeU2-YsEAJgyOjNygE=
[pageInfoType:protected] => Google_Service_YouTube_PageInfo
[pageInfoDataType:protected] =>
[prevPageToken] =>
[regionCode] =>
[tokenPaginationType:protected] => Google_Service_YouTube_TokenPagination
[tokenPaginationDataType:protected] =>
[visitorId] =>
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[pageInfo] => Google_Service_YouTube_PageInfo Object
(
[resultsPerPage] => 5
[totalResults] => 55
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
)
Thank you for your ideas!
Petr
UPDATE
This problem is only if is set param forMine. But I need show only my videos...
I am getting array data from a function ReportsController::getStudentYearwiseAvgHeightsProvince() in the below format:
Array ( [0] => Array ( [name] => Baluchistan [data] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 ) ) [1] => Array ( [name] => KPK [data] => Array ( [0] => 56 [1] => 58 [2] => 58 [3] => 0 [4] => 0 [5] => 0 [6] => 60 ) ) [2] => Array ( [name] => Punjab [data] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 78 [4] => 90 [5] => 90 [6] => 0 ) ) [3] => Array ( [name] => Sindh [data] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 ) ) )
ReportsController::getStudentYearwiseAvgHeightsProvince() function is:
public function getStudentYearwiseAvgHeightsProvince() {
$result = Yii::$app->db->createCommand ( '
SELECT temp.name AS name,
GROUP_CONCAT(IFNULL(temp.height,0) order by year) AS data
FROM ( SELECT years.year AS year, p.name AS NAME, FLOOR(AVG(sd.height)) AS height
FROM (
SELECT DISTINCT year FROM student_detail ORDER BY year
) years
cross join province p
left join student_detail sd on years.year = sd.year and sd.province_id = p.id
GROUP BY years.year, p.name
ORDER BY years.year )
AS temp
GROUP BY name; ' )->queryAll ();
$i = 0;
foreach ($result as $innerArray) {
$result[$i]['data'] = explode(",", $result[$i]['data']);
//$result[$i]['name'] = $innerArray['name'];
$i++;
}
//$result = array_map(function($var){ return (int) $var['data']; }, $result); // extraction from 2 level associative arry to 1-d associative array
print_r ( $result );
return $result;
}
and I am setting highcharts component as follows:
echo Highcharts::widget([
'scripts' => [
'modules/exporting',
'themes/grid-light',
],
'options' => [
'title' => ['text' => 'Student Province-wise Yearly Avg Heights'],
'plotOptions' => [
'column' => [
'depth' => 25
]
],
'xAxis' => [
'categories' => ReportsController::getDistinctCols("student_detail", "year")
],
'yAxis' => [
'min' => 0,
'title' => ['text' => 'Avg Height']
],
'series' =>
ReportsController::getStudentYearwiseAvgHeightsProvince()
]
]);
No graph is generated :(
I fixed the graph not showing issue by just converting the STRING ARRAY to INTEGER ARRAY which is returned by EXPLODE in my function getStudentYearwiseAvgHeightsProvince()
by editing the code inside FOREACH LOOP as:
foreach ($result as $innerArray) {
$result[$i]['data'] = explode(",", $result[$i]['data']);
$temp = array();
foreach ($result[$i]['data'] AS $index => $value)
$temp[$index] = (int)$value;
$result[$i]['data'] = $temp;
$i++;
}
Below is the data I'm getting from wsdl response... I need to get the separate value for example how to get the firstname from this array...Please anyone help me...
GetReportResponse Object ( [GetReportResult] => MBPeopleSearchRs_Type Object ( [MsgRsHdr] => MsgRsHdr_Type Object ( [RqUID] => {4DB2AD23-228A-465F-938D-BE072CED61C4} [Status] => Status_Type Object ( [StatusCode] => 0 [ServerStatusCode] => [Severity] => Info [StatusDesc] => OK [AdditionalStatus] => ) ) [Subject] => Subject Object ( [RefNum] => [PersonInfo] => PersonInfo_Type Object ( [PersonName] => PersonName_Type Object ( [LastName] => JANARDHANAN [FirstName] => SENTHINBABU [FullName] => [MiddleName] => [TitlePrefix] => [NameSuffix] => [Nickname] => [LegalName] => [MaidenName] => [OfficialTitle] => [Source] => MB [EffDt] => 2013-05-24 ) [ContactInfo] => ContactInfo_Type Object ( [ContactPref] => [PhoneNum] => [ContactName] => [EmailAddr] => [URL] => [PostAddr] => PostAddr_Type Object ( [PreDirection] => [Addr2] => [PostDirection] => N [Addr3] => [StreetType] => AVE [Addr4] => [StreetName] => LEXINGTON [Apt] => APT 4203 [StreetNum] => 4150 [Addr1] => [City] => SAINT PAUL [StateProv] => MN [PostalCode] => 55126-6131 [County] => RAMSEY
I suggest using a framework for this. CXF is a good choice if you write Java.
http://cxf.apache.org/
edit: since you work with php, take a look here: PHP SOAP client Tutorial/Recommendation?
i have this code in executeIndex action:
$pager = new sfPropelPager('News',5);
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(NewsPeer::ID);
$c->addSelectColumn(NewsPeer::TYTUL);
$c->addSelectColumn(NewsPeer::SLUG);
$c->addSelectColumn(NewsPeer::TEKST);
$c->addSelectColumn(NewsPeer::UTW);
$c->addSelectColumn(NewsPeer::WYSWIETLENIA);
$c->addDescendingOrderByColumn(NewsPeer::UTW);
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter("p", 1));
$pager->init();
$this->pager=$pager;
as you can see, im selecting 6 columns from 9column table.
When i want to print UTW column in indexSuccess it print nothing. when i do: print_r($news), im getting this:
[id:protected] => 64
[tytul:protected] => Limit
[slug:protected] => limit
[tekst:protected] => text.....
[pelnytekst:protected] => 2011-12-22 08:54:07
[stan:protected] => 42
[utw:protected] =>
[zmi:protected] =>
[wyswietlenia:protected] =>
and it should be:
[id:protected] => 64
[tytul:protected] => Limit
[slug:protected] => limit
[tekst:protected] => text.....
[pelnytekst:protected] =>
[stan:protected] =>
[utw:protected] => 2011-12-22 08:54:07
[zmi:protected] =>
[wyswietlenia:protected] => 42
So, its ok, when i select columns with same order as in table, but when i skip one, values get messed up. How to fix this?
You need to set the PeerMethod to 'doSelectStmt'.
$pager->setCriteria($c);
$pager->setPeerMethod('doSelectStmt'); // add this
$pager->setPage($this->getRequestParameter("p", 1));
$pager->init();
$this->pager=$pager;
I have a link on a view like this
Save Playlist
However, when it is clicked I am redirected to
/playlists/add/video[]=0&video[]=4&video[]=1
and the output of $this->params['url'] is
Array ( [url] => playlists/add/video[]=0 [video] => Array ( [0] => 4 [1] => 1 ) )
instead of
Array ( [url] => playlists/add/ [video] => Array ( [0] => 0 [1] => 4 [2] => 1 ) )
I can't work out why the firs parameter is always read as part of the url, nor why the leading ? is removed
Try playlists/add?video -> playlists/add/?video
Or just write properly formatted URLs like
$this->Html->link('Save Playlist', array('controller' => 'playlists', 'action' => 'add', 'values[0]'=>3, 'values[1]'=>2, 'values[2]'=>23)); ?>