Take a measure description or full name from a chart and write it to a text box

// Get the first measure from the chart
var measure = Chart_1.getMeasures(Feed.ValueAxis)[0]; 
// Get all available measures from the data source
var measureList = Chart_1.getDataSource().getMeasures();        
// Loop through the measure list to find the measure description that matches the one in the chart
for (var i = 0; i < measureList.length; i++) {    
    if (measureList[i].id === measure) {
        // Apply the measure's description to the text widget
        Text_1.applyText(measureList[i].description);         
        // Exit the loop when a match is found
        break;      
    } }
Code language: JavaScript (javascript)
var measure = Chart_1.getMeasures(Feed.ValueAxis)[0]; 
Text_1.applyText(measure);
Code language: JavaScript (javascript)
measure desc and name
Scroll to Top