Category / Section
How to change text in axis element builder in JavaScript PivotClient?
This KB illustrates that how to change the label text in AxisElementBuilder.
Solution:
In order to change the label text in AxisElementBuilder from "Series" and "Categorical" to "Row" and "Column", you can use the following code example at the sample level.
JavaScript
<script type="text/javascript">
$(function () {
$("#PivotClient1").ejPiovtClient({ url: "../wcf/OlapClientService.svc", title: "OLAP Browser", chartLoad: "OnChangeAxisName" });
});
function OnChangeAxisName(args) {
$($(".axisHeader span")[0]).text("Catogorical");
$($(".axisHeader span")[1]).text("Series");
$($(".axisHeader span")[2]).text("Slicer");
}
<script/>
MVC
@Html.EJ().Pivot().PivotClient("PivotClient1").Url(Url.Content("~/wcf/OlapClientService.svc")).Title("OLAP Browser").ClientSideEvents(oEve => { oEve.ChartLoad("OnChangeAxisName"); })
<script type="text/javascript">
function OnChangeAxisName(args) {
$($(".axisHeader span")[0]).text("Catogorical");
$($(".axisHeader span")[1]).text("Series");
$($(".axisHeader span")[2]).text("Slicer");
}
<script/>
ASP
<ej:PivotClient ID="PivotClient1" runat="server" Url="../wcf/OlapClientService.svc">
<ClientSideEvents ChartLoad="OnChangeAxisName" />
</ej:PivotClient>
<script type="text/javascript">
function OnChangeAxisName(args) {
$($(".axisHeader span")[0]).text("Catogorical");
$($(".axisHeader span")[1]).text("Series");
$($(".axisHeader span")[2]).text("Slicer");
}
<script/>