Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8009315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:24:40+00:00 2026-06-04T18:24:40+00:00

Hi I am setting some variables for highcharts in a Zend Report controller script

  • 0

Hi I am setting some variables for highcharts in a Zend Report controller script like so:

    $chartOptions = array(
        "chart"=> array(
            //chart type
            "type" => "bar",
                    "spacingBottom" => 25
        ),
        "height"=>1,
        "title" => array(
            "text" => $spm->getFullName()
        ),

etc.

the json I want to end up with also has this in:

exporting: {
    buttons: {
        exportButton: {
            menuItems: [{
                text: 'Export to PNG (with text)',
                onclick: function() {
                    this.exportChart({},{
                        labels: {
                            items:[{
                                html: "System: x.x.x, Date/Time: 30:05:2012 14:32:00",
                                style: {
                                    left: '50%',
                                    top: '250px'
                                }                                            
                            }]
                        }
                    });
                }
            }, {
                text: 'Export to PNG (default)',
                onclick: function() {
                    this.exportChart();
                }
            },
            null,
            null
            ]
        }
    }
}

So I need to setup the PHP array like so:

$chartOptions = array(
    "chart"=> array(
        //chart type
        "type" => "bar",
        "spacingBottom" => 25
     ),
    "height"=>1,
    "title" => array(
        "text" => $spm->getFullName()
    ),
    "exporting" => "buttons" =>

and so on. But I’m not sure how to do it because of the javascript function. The Zend report controller copies all the variables to the view script and I have no idea how it converts the php to json, but it does and it works :/ Sorry I can’t be more helpful.

All I want is the outputted json to contain the javascript above, thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:24:41+00:00Added an answer on June 4, 2026 at 6:24 pm

    It seems it is possible to encode javascript call backs in to json data with Zend. More information here: http://framework.zend.com/manual/en/zend.json.advanced.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a shell script where I'm setting some variables, but I'd like to
I have some variables that I am setting withing a function. When inside the
Possible Duplicate: Declaring Multiple Variables in JavaScript I was setting some variables in jQuery
What is the preferred way of setting some View variables which values depend on
I'm having trouble with setting variables for some opening and closing menus. I need
I am setting some permanent environment variables via a batch file. Is it possible
I need to tweak some variables (only in a development setting) without having to
I'm setting some global configuration variables in the following manner: $yaml = file_exists('config.yml') ?
In my jsp on readyfunction i am setting value for some variables $(document).ready(function() {
I'm setting some environment variables by some windows batch commands in the pre-build steps

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.