Access a data of a chart component from a helper function


#1

I’ve a chart.MetricsHistogram that I want get access its data from a custom mappingHelper function. I’ve end up doing this:

var environment = this.get("environment");
var tabPanel = environment.findComponent('ApplicationId.PageId.ComponentId');
var componentManager = tabPanel.get('componentManager');
var items = componentManager.get('items');
var histogram = items.filter(function(item) {return item.get('histogramMetric')})[0];
var chart = histogram.chart;
var xAxis = chart.axes.filter(function(ax) {return ax.horiz})[0];
var yAxis = chart.axes.filter(function(ax) {return !ax.horiz})[0];

Is there an easier way?

What I want to achieve get the rank of the x-axis labels to add it in a KendoGrid column.


#2

I think this is the only way to access the MetricsHistogram right now.