2 Replies Latest reply: Jan 19, 2015 12:29 PM by prabhu appu RSS

    Visualization Failed to Render : Qliksense SDK

    prabhu appu

      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

        • Re: Visualization Failed to Render : Qliksense SDK
          Lars-Goran Book

          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