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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Pyramid Chart with DataSource

Thread ID:

Created:

Updated:

Platform:

Replies:

118324 Feb 25,2015 11:21 AM UTC Feb 26,2015 07:15 AM UTC ASP.NET MVC 1
loading
Tags: Chart
Andrea Perazzolo
Asked On February 25, 2015 11:21 AM UTC

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


Jayavigneshwaran [Syncfusion]
Replied On 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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;