Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
prabhuappu
Creator II
Creator 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

1 Solution

Accepted Solutions
Not applicable

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

View solution in original post

2 Replies
Not applicable

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
Creator II
Creator II
Author

Thanks alot Lars-Göran