highcharts formatter assistance



  • Hiya

    Been years since I have done any front end dev, so hopefully I am just missing some simple concepts :) Trying to get my company to move across to jsreports. When using highcharts everything works well except for setting of a formatter. It being an anonymous function.

    https://playground.jsreport.net/w/jacques-atlas/6nTOHKTO

    Maybe my approach to create an object and then return JSON.stringify(object) is not the ideal way. In the first chart its being created in html script and that works.

    In the second I am trying to do this in a function where I would populate everything. I create an object and then return it as a JSON string. This does not work for the formatters.

    Anyone have any ideas or a better approach

    Thanks



  • JSON.stringify doesn't serialize functions.
    What is the reason for putting the highcharts definition into helpers function?
    Do you wan't to reuse it in multiple charts in the same template?
    You can put such function directly in the <script> tags.



  • Correct, it is being reused multiple times with different charts in the same template.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.