Jump to content
  • How to get data from series item contributors for usage in a function like yAxis.stackLabels.formatter


    ghudson_1
    • Features: Charts Version: v6.3 Product: JasperReports® Server

    Issue Description

    A customer wants to use values from series item contributors in the highcharts api function yAxis.stackLabels.formatter. https://api.highcharts.com/highcharts/yAxis.stackLabels.formatter

    Their attempts fail for anything other than totals, like: function() {return this.total;}

    Resolution

    Within the highcharts object the data model is complex due to the "stacking". So you need to iterate thru the individual items of the objects in our function. For example, if  fruit is setup as the series contributor like:

    seriescapture.jpg.7a5fb2db55c01c7942133d0b007aed26.jpg

    Then a function could be:

    <![CDATA["function() {var list = '', x = this.x, series = this.axis.chart.options.series, s; for (s = 0; s < series.length; ++s) if (series[s].data[x].y != null) list += series[s].data[x].fruit + ' '; return list;}"]]>
    

    Ref. Case 01525594

    seriescapture.jpg.235e98866f352fe437036eabb150935a.jpg


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...