Skip to main content

Integration, Extension & APIs

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

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for 
Search instead for 
Did you mean: 
prabhuappu
Creator II
Creator II

Help Needed to Create Treemap using Qliksense SDK !!!

Hi All,

I'm trying to create Treemap using Qliksense SDK. I'm using the below code,

var LibraryDimension = application.CreateDimension("Dim2", new DimensionProperties { Dim = new NxLibraryDimensionDef { FieldDefs = new[] { "Year" } }, Title = "Dimension1 " });

var LibraryExpression = application.CreateMeasure("Sum(SalesAmount)", new MeasureProperties { Measure = new NxLibraryMeasureDef { Def = "Sum(SalesAmount)" }, Title = "Measure1" });

var treeChart = Sheet.CreateTreemap("MyNewChart", new TreemapProperties { Title = "MyBar" });

treeChart.SuspendLayout();

treeChart.Properties.HyperCubeDef = new Qlik.Sense.Client.Visualizations.VisualizationHyperCubeDef

{

  Dimensions = new List<HyperCubeDimensionDef>(){

  new HyperCubeDimensionDef(){

  LibraryId=LibraryDimension.Info.Id, IncludeElemValue=false, NullSuppression=true

  }

  },

  Measures = new List<HyperCubeMeasureDef>(){

  new HyperCubeMeasureDef(){

  LibraryId=LibraryExpression.Info.Id,

  }

  },

  InterColumnSortOrder = new[] {1, 0},

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

};

treeChart.ResumeLayout();

But i'm not getting the chart. I'm able to create other charts using the same code, just by changing the Createchart method.

Is there any Properties i'm missing for TreeMap?

Thanks in Advance

Prabhu Appu

1 Solution

Accepted Solutions
Not applicable

Hi Prabhu,

you have to set the NxHypercubeMode of the VizualizationHyperCubeDef. In your example it would be

                InterColumnSortOrder = new[] {1, 0},

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

                Mode = NxHypercubeMode.DATA_MODE_PIVOT_STACK

Best Regards,

Helene

View solution in original post

2 Replies
Not applicable

Hi Prabhu,

you have to set the NxHypercubeMode of the VizualizationHyperCubeDef. In your example it would be

                InterColumnSortOrder = new[] {1, 0},

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

                Mode = NxHypercubeMode.DATA_MODE_PIVOT_STACK

Best Regards,

Helene

prabhuappu
Creator II
Creator II
Author

Thanks Helene,

It is working now. And I need to set "AlwaysFullyExpanded=true" option. Otherwise it is not showing the Second dimension.

Regards,

Prabhu Appu