Category / Section
How to remove axis from AxisElementBuilder within PivotClient?
This KB illustrates that how to remove axis from AxisElementBuilder within PivotClient.
Solution:
Removing the AxisElementBuilder - Column, Row and Slicer axes can be achieved through the following code examples with respective to JS, ASP and MVC platforms.
JavaScript
<script type="text/javascript">
$(function () {
$("#PivotClient1").ejPivotClient({ url: "../wcf/OlapClientService.svc", title: "OLAP Browser", chartLoad: "removeAxes" });
});
function removeAxes(args) {
//To remove axis individually
$(".axisHeader, .categoricalAxis, .slicerAxis , .rowAxis ").remove();
//To remove axes completely
$(".cubeTable tr td:last").remove();
}
<script/>
MVC
@Html.EJ().Pivot().PivotClient("PivotClient1").Url(Url.Content("~/wcf/OlapClientService.svc")).Title("OLAP Browser").ClientSideEvents(oEve => { oEve.ChartLoad("removeAxes"); })
<script type="text/javascript">
function removeAxes(args) {
//To remove axis individually
$(".axisHeader, .categoricalAxis, .slicerAxis , .rowAxis ").remove();
//To remove axes completely
$(".cubeTable tr td:last").remove();
}
<script/>
ASP
<ej:PivotClient ID="PivotClient1" runat="server" Url="../wcf/OlapClientService.svc">
<ClientSideEvents ChartLoad=" removeAxes" />
</ej:PivotClient>
<script type="text/javascript">
function removeAxes(args) {
//To remove axis individually
$(".axisHeader, .categoricalAxis, .slicerAxis , .rowAxis ").remove();
//To remove axes completely
$(".cubeTable tr td:last").remove();
}
<script/>