How to expand all the members in JavaScript PivotChart?
This KB illustrates that how to expand all the members in the JavaScript Pivot Chart.
Solution:
By using DrillState enumeration, you can expand all the members in the PivotGrid. You can refer to the following code example.
C#
OlapReport olapReport = new OlapReport() { Name = "Default Report" }; olapReport.CurrentCubeName = "Adventure Works"; MeasureElements measureElement = new MeasureElements(); measureElement.Elements.Add(new MeasureElement { UniqueName = "[Measures].[Customer Count]" }); DimensionElement dimensionElementRow = new DimensionElement(); dimensionElementRow.Name = "Date"; dimensionElementRow.AddLevel("Fiscal", "Fiscal Year"); dimensionElementRow.DrillState = DrillState.ExpandAll; olapReport.SeriesElements.Add(dimensionElementRow); olapReport.CategoricalElements.Add(measureElement); return olapReport;
VB
Dim olapReport As OlapReport = New OlapReport() With {.Name = "Default Report"} olapReport.CurrentCubeName = "Adventure Works" Dim measureElement As MeasureElements = New MeasureElements() measureElement.Elements.Add(New MeasureElement With {.UniqueName = "[Measures].[Customer Count]"}) Dim dimensionElementRow As DimensionElement = New DimensionElement() dimensionElementRow.Name = "Date" dimensionElementRow.AddLevel("Fiscal", "Fiscal Year") dimensionElementRow.DrillState = DrillState.ExpandAll olapReport.SeriesElements.Add(dimensionElementRow) olapReport.CategoricalElements.Add(measureElement) Return olapReport
Conclusion
I hope you enjoyed on how to expand all the members in PivotChart.
You can refer to our JavaScript Pivot Chart feature tour page to know about its other groundbreaking feature representations. You can also explore our documentation to understand how to present and manipulate data.
For current customers, you can check out our JavaScript components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our JavaScript Pivot Chart and other JavaScript components.
If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!