Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
prabhuappu
Contributor II

Visualization Failed to Render : Qliksense SDK

Hi,

I couldn't create chart object using .Net SDK in QLiksense. I'm getting "Visualization Failed to Render". Below is the code,

Can anyone help on what i'm missing in the code.

var myLibraryDimension = application.CreateDimension("Dim2",new DimensionProperties

                                                                  {

                                                                      Dim = new NxLibraryDimensionDef { FieldDefs = new[] { "Country" } },

                                                                      Title = "Dimension1",

                                                                     

                                                                  });

var myLibraryMeasure = application.CreateMeasure("Sum([SalesAmount])", new MeasureProperties

                                                               {

                                                                   Measure = new NxLibraryMeasureDef { Def = "Sum([SalesAmount])" },

                                                                   Title = "Measure1"

                                                                  

                                                               });

   

var barChart = sheet.CreateBarchart("MyNewChart", new BarchartProperties

  {

  Title = "MyBar",

  HyperCubeDef = new Qlik.Sense.Client.Visualizations.VisualizationHyperCubeDef{

  Dimensions = new List<HyperCubeDimensionDef> { new HyperCubeDimensionDef {

  LibraryId = myLibraryDimension.Info.Id

  }

  },

  Measures = new List<HyperCubeMeasureDef> { new HyperCubeMeasureDef {

  LibraryId = myLibraryMeasure.Info.Id

  }

  }

  }

  });

Thanks,

Prabhu Appu

Tags (2)
1 Solution

Accepted Solutions
Not applicable

Re: Visualization Failed to Render : Qliksense SDK

Hi,

I order to be able to render the visualization you need the data. By setting InitialDataFetch data will be returned when you get the object.

Ex.

sheet.CreateBarchart( "MyNewChart", new BarchartProperties {

...

...

InitialDataFetch = new List<NxPage> { new NxPage {  Height = 500, Left = 0, Top = 0, Width= 2 } }.ToArray()

}

You should also set the sort order of the columns in the hypercube. Columns are separated by comma.

Ex

sheet.CreateBarchart( "MyNewChart", new BarchartProperties {

...

...

InterColumnSortOrder = new[] {0,1},

InitialDataFetch = new List<NxPage> { new NxPage {  Height = 500, Left = 0, Top = 0, Width= 2 } }.ToArray()

}

So by adding InterColumnSortOrder and InitialDataFetch your visualization should render.

Best regards

Lars-Göran Book

2 Replies
Not applicable

Re: Visualization Failed to Render : Qliksense SDK

Hi,

I order to be able to render the visualization you need the data. By setting InitialDataFetch data will be returned when you get the object.

Ex.

sheet.CreateBarchart( "MyNewChart", new BarchartProperties {

...

...

InitialDataFetch = new List<NxPage> { new NxPage {  Height = 500, Left = 0, Top = 0, Width= 2 } }.ToArray()

}

You should also set the sort order of the columns in the hypercube. Columns are separated by comma.

Ex

sheet.CreateBarchart( "MyNewChart", new BarchartProperties {

...

...

InterColumnSortOrder = new[] {0,1},

InitialDataFetch = new List<NxPage> { new NxPage {  Height = 500, Left = 0, Top = 0, Width= 2 } }.ToArray()

}

So by adding InterColumnSortOrder and InitialDataFetch your visualization should render.

Best regards

Lars-Göran Book

prabhuappu
Contributor II

Re: Visualization Failed to Render : Qliksense SDK

Thanks alot Lars-Göran

Community Browser