Refresh Data on PivotGrid and PivotChart together

Hi, i'm work on PivotGrid (server-mode) and i have a question. When I change row, column and add filter there is a way to refresh also PivotChart? I'd rather use not client event and I can't use PivotClient. Thank you.

2 Replies

SA Scintilla Arul Jothi Raj Syncfusion Team March 15, 2018 04:59 PM UTC

Hi Simone,  

Thanks for the using Syncfusion Products. 

Currently, we don’t have an option to refresh PivotChart information on server-side. Meanwhile we have prepared sample workaround solution to achieve your requirement. Please find the sample in the below link. 
 
Sample: http://www.syncfusion.com/downloads/support/forum/136432/ze/SyncfusionMvcApplication4-1382641481 
 
Code Snippet: 
 
CSS: 
        #PivotChart1 { 
            height: 400px; 
            width: 600px; 
        } 
 
 
JS: 
OnAfterServiceInvoke = function (args) { 
  if (args.action == "initialize") { 
  var PivotSchemaDesigner = $("#PivotSchemaDesigner").data('ejPivotSchemaDesigner'); 
  if (PivotSchemaDesigner.model.pivotControl == null) { 
     PivotSchemaDesigner.model.pivotControl = this; 
     PivotSchemaDesigner.model.enableWrapper = true; 
     PivotSchemaDesigner.model.layout = "excel"; 
     PivotSchemaDesigner._load(); 
          } 
     } 
 
  var temp = JSON.parse(args.customObject); 
  $("#PivotChartControl").find("#PivotChart1").remove(); 
  $("#PivotChartControl").append("<div id=\"PivotChart1\"></div>") 
 
  $("#PivotChart1").ejPivotChart({ 
  url: "https://js.syncfusion.com/ejservices/wcf/PivotChart/Olap.svc", serviceMethodSettings: { initialize: "Initialize", drillDown: "Drill" }, 
type: ej.PivotChart.ChartTypes.Column, commonSeriesOptions: { enableAnimation: true, type: ej.PivotChart.ChartTypes.Column, tooltip: { visible: true } }, 
  size: { height: "460px", width: "100%" }, 
  afterServiceInvoke: function (args1) { 
  this.setJSONRecords(temp.JsonRecords); 
  this.setOlapReport(temp.OlapReport) 
  this.model.analysisMode = "pivot" 
           } 
        }); 
    } 
 
 
 
Regards, 
Scintilla A 



SA Scintilla Arul Jothi Raj Syncfusion Team March 16, 2018 01:08 PM UTC

Hi Simone, 
 
Sorry for the inconvenience caused. 
 
Please find the modified (revised) sample in the below link. 
 
 
Regards, 
Scintilla A. 


Loader.
Up arrow icon