Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
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