BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
DimensionElement newDimension = new DimensionElement();However, since the key we are using to fetch the vendor is an ID number, the label and legend text will display something along the lines of: "1~ProductA, 1~ProductB, etc..." With more dimensions, this becomes even more unintelligible.
newDimension.Name = "Vendors";
newDimension.AddLevel("ID", "ID");
newDimension.Hierarchy.LevelElements["ID"].Add("1");
newDimension.Hierarchy.LevelElements["ID"].IncludeAvailableMembers = true;
olapReport.CategoricalElements.Add(newDimension);
Hi Matthew,
Thanks for using Syncfusion Products.
For customizing the Legend labels, kindly use the event “LegendItemRendering”, in which the names of all the legends could be customized individually. Similarly for customizing the Axis labels, the event “AxesLabelRendering” lets to rename the legends as per our requirement.
Please find the code snippet below for achieving both the scenarios mentioned above.
Code Snippet (~.cshtml)
<script>
function OnAxisLabelRendering(args) {
if (args.data.label.Text == "YourLabel")
args.data.label.Text = "CustomLabelText";
}
function OnLegendItemRendering(args) {
if (args.data.legendItem.Text == "YourLegend")
args.data.legendItem.Text = "CustomLegendText";
}
</script>
<div>
@Html.EJ().Olap().OlapChart("OlapChart1").Url(Url.Content("~/wcf/OlapChartService.svc")).ClientSideEvents( oEve => { oEve.AxesLabelRendering("OnAxisLabelRendering").LegendItemRendering("OnLegendItemRendering"); })
</div>
Please let us know if you require any further assistance.
Regards,
Narendhran M.