Skip to main content
Inspiring
March 17, 2016
Question

cfchart yaxis2 title

  • March 17, 2016
  • 1 reply
  • 998 views

Hello,

how do I set the title of a second yaxis?

There is no attribute like yaxis2title in <cfchart>  tag.

I'm working on ColdFusion 11  Standard.

regards

Claudia

    This topic has been closed for replies.

    1 reply

    Legend
    March 17, 2016

    Go over the CFChart documentation and you'll find an attribute for yaxis2 that requires a "JSON string representation".

    Adobe makes no mention of how to actually build this JSON string.  The answer is here:

    Docs | JSON Attributes | Graph Objects | Scale-Y, Scale-Y-N | ZingChart

    biene22Author
    Inspiring
    March 17, 2016

    Thank you, I know the ZingChart docs.

    I think my main problem is the "JSON string representation" syntax inside the cfchart attribute.

    I try this, but it does not work.

    yAxis2= #[{"label":{

            "text":"Label Text",

            "font-size":"20px",       

            "font-color":"red"}}]#

    Legend
    March 17, 2016

    I think your JSON formating is wrong.  Here's an example I did a while back.  It doesn't affect the Y axis you're looking for but should point you in the right direction:

    <cfset plotarea ={

                        "adjustLayout"=true,

                        "alpha"=1,

                        "margin-top"=5,

                        "margin-right"=5,

                        "margin-left"=5,

                        "margin-bottom"=0

                    }>

            <cfset title = {

                        "visible"=false,

                        "backgroundColor"="##dcdcdc"

                    }>

            <cfset border = {

                        "borderColor"="none"

                    }>

            <cfset legend = {

                        "visible"=false

                    }>

            <cfset plot = {

                        "highlight"=false,

                        "value-box"={

                            "placement"="out",

                            "connected"=false,

                            "text"="%t",

                            "font-color"="##5A5A5A",

                            "type"="all"

                        }

                    }>

    <cfchart

                databackgroundcolor="##dcdcdc"

                backgroundColor="##dcdcdc"

                plotarea="#plotarea#"

                title="#title#"

                border="#border#"

                legend="#legend#"

                plot="#plot#"

                chartwidth="460"

                chartheight="260"

                show3d="yes"

                name="ret.pieChartchartImg"><!--- style="#prodJSONFile#" --->

                <cfchartseries type="pie">

                    <cfloop query="myqry">

                        <cfchartdata item="#numberFormat(myqry.perc,'___._')#%" value="#myqry.perc#">

                    </cfloop>

                </cfchartseries>

    </cfchart>