ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: dagarwal on December 01, 2016, 04:05:02 am
-
My Angular controller looks like this (only a snippet)
$scope.ajaxData = [];
$scope.fetchData = function() {
$http.get("/getdata").success(function(data) {
$scope.ajaxData = data;
});
}
.
.
.
myApp.directive('chart', function(){
return{
restrict: 'E',
link: function(scope, elem, attrs){
scope.$watch('ajaxData', function(dataset){
// Draw Flot chart
}
}
}
.
.
$scope.gridOptions = getPQGrid();
My other javascript looks like:
function getPQGrid() {
var pqGridObj = {
width: "80%",
height: 800,
resizable: true,
title: "Angularjs grid",
scrollModel: { autoFit: true },
dataModel: { data: 'ajaxData' },
colModel : getColumnModel()
};
return pqGridObj;
}
function getColumnModel() {
var cols = [
{ title: "Instance", width: 100, dataType: "String", dataIndx: "inst" },
{ title: "Trend", width: 150, template: "<chart ng-model='ajaxData' type='line'><div class="mychart" style='width:170px;height:35px'></div></chart>' "
}
];
return cols;
}
I get the table populated but charts are not coming. If I use simple table (without pqgrid) charts are coming. So, I am guessing I am missing something.
-
Can you share this via attachment or jsfiddle, so that I can check it on my end.
-
Can you set this up for the run of http://paramquery.com/pro/demos/ng_grid
I tried but it is showing some module error. If you help me setting up this jsfiddle I will update it with my code.
http://jsfiddle.net/abwh7Lkx/1/
-
Please use this jsfiddle:
http://jsfiddle.net/0g0psuo7/1/
-
http://jsfiddle.net/0g0psuo7/3/
You would see the following code. It's getting correct data. So, chart is correctly populated and elem is also correct. But Trend column is empty.
var chart = jQuery.plot(jQuery('#achart_'+id),
[evseries],
options
);
elem.show();
-
A more simple approach http://jsfiddle.net/0g0psuo7/5/
Looks like the issue is I am unable to plot on pqgrid. See how I can plot on #test but not on #achart_1
-
Please use either virtualX: true or don't use the number column. The reason being that in non-virtual mode, grid creates 2 tables, and flot is rendered in the hidden one.
http://jsfiddle.net/0g0psuo7/9/
-
Thank you so much. Could you please provide the pro version of 3.3.4
-
Thank you so much. Could you please provide the pro version of 3.3.4
I don't see Pro Downloads under my menu bar. Probably because my account is not associated with my enterprise acccount. Can you tell me what should I do in order to see the Pro Downloads