We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Pyramid Chart with DataSource

Hi,
I have seen the Example with Pyramid Chart, where the DataLabels are the Property Text of the Points data.
I'd like to do the Same, but using the DataSource, XName and YName functions to retrieve the Data, but with this method, the Data Labels are the Y values and not the Texts.
There is a way to have an equivalent result (showing a text instead of value in DataLabels)  even with DataSource data specified in the Serie?

     Thanks in advance

    Andrea Perazzolo


1 Reply

JA Jayavigneshwaran Syncfusion Team February 26, 2015 07:15 AM UTC

Hi Andrea,

Thanks for using Syncfusion product.

We have analyzed this. The text in data labels can be customized by triggering the “displayTextRendering” event in chart.

The below code snippet shows this

[ASPX]

     .DisplayTextRendering("textRendering")

In this method, code should be done for changing the text of the point. The text can be bind from an array or a data source field

The below shows this

[JS]

   function textRendering(sender) {

             var text = ["First point", "Second point", "Third point", "Fourth point", "Fifth point"];  // array/data source

             var pointIndex = sender.data.pointIndex;          // point index

             sender.data.text = text[pointIndex];              // modifying text

         }

We have also made a sample to illustrate this. Find it from the below location

 
MvcApplication47.zip

The below shows the output of the attached sample

Please let us know if you have any concern.

Thanks,

Jayavigneshwaran



Loader.
Live Chat Icon For mobile
Up arrow icon