All shortcode parameters

All shortcode parameters

Here is the list of all shortcode parameters, briefly described, see examples for further explanations:

  • gf_form_id : expects the form ID in Gravity Forms (defaults to first form : id=1)
  • type : is the type of graph, at the moment only line,pie,doughnut,bar,horizontalBar,radar available (defaults to pie)
  • include : expects the field ids to include (example : include="1,3,4")
  • exclude : expects the field ids to exlude (example : exclude="2,4,6")
  • colors : to use your custom colors : a list of coma separated hex colors
  • color_set : expects the name of the color set : blue,green,red,orange,purple (defaults to a standard color set including different colors). See extended colors for more options.
  • color_rand : expects true or false and randomizes colors in color set if true (defaults to false)
  • height : set height of graph(s) in pixels (height="250px"), width will be adjusted automatically
  • position : (defaults to none) can be float (sets float:left property to graph div container, and allow multiple column display) or center (to center graphs inside container)
  • maxentries : by default, maximum 200 entries are retrieved from the gravity forms database, increase at your own risk (performances). Example here.
  • chart_js_options : JSON like string like : title: {display: true, text: 'My Funky Chart Title'}. Use to surround string parameters. See here for more informations, and there for some examples.
  • tooltip_style : Control tooltip content, SUM displays total count of answers, PERCENT the % ratio among all answers, and BOTH displays both
  • data_conversion : Set to “%” in order to convert in % all values. Previous parameter tooltip_style is disabled in this case.
  • case_insensitive : set it to “true” in order to count form answers values in a case insensitive way. For ex. : mYAnswer and myansWER will be count as same user answers.
  • custom_search_criteria : provide custom search criteria for gf submission query, for example custom_search_criteria='{"status":"active","field_filters":{"0":{"key":"created_by","value":"current"}}}'
  • no_entries_custom_message : custom message to show to user if no entries found
  • datasets_invert : Invert data set for survey add-on
  • group_fields : will first check that all include fields are of the same type. Then get value of each (only works with number fields at the moment) to create a new dataset. Result is a chart with one dataset per field. Need to create custom title
  • gf_entry_id : will select a specific entry based on its unique id, if last set, will get the latest filled form (in time). You can use GF merge tag in order to show current user answer on confirmation page: gf_entry_id="{entry_id}"
  • count_answers=”1″ : will make a total of all answers (must be number field type) instead of counting each type

About The Author

Comments (28)

  • Joe Black

    Custom Search Criteria – Filter by Field Values – conditional logic

    I need to display (conditional logic) results: display only if form field {email:3} entries equals current user’s username.
    I was trying something like this, but is not working (I was just guessing 🙂

    custom_search_criteria='{“field_filters”:{“0”:{“key”:”email”,”value”:{“current_user”:”user_email”}}}}’

    Thank you for your help

  • admin

    There is no conditional logic on showing the graph or not, it will always display unless there is an error.
    However, you can show answers for current user only by filtering like the example above :
    custom_search_criteria='{“status”:”active”,”field_filters”:{“0”:{“key”:”created_by”,”value”:”current”}}}'
    This will show stats for forms submitted by current user only.

  • Joe Black

    I did not explain myself correctly, sorry.
    I want the graph to show all the time, but only the values if they are from ”current” and the ”user_email” = form field {email:3}

    Thank you 🙂

  • Casper

    Math?

    Could I have a bar chart with user input value in one bar and calculations in an other?

    Like bar #1 user input value
    bar #2 User input * 2
    Bar #3 user input * 4 – 3

    ?

    Awesome work mate!👍

    • Gravity Forms Charts Reports

      At the moment, no, it is not possible, but your suggestion is interesting and i will think about it quickly and go back to you.

    • Gravity Forms Charts Reports

      Can you explain a bit more what you want ? A text (number?) filed as input in the form ?
      Then calculations made on this only value entered by user ?
      Thanks

    • MaxiCharts

      Done here : https://maxicharts.com/calculations-with-gf-formula/

  • Jet0o

    hello,
    I used gravityforms + survey addon + maxichart.
    On survey I have 4 answers for each question ((1)Very Happy / (2)Happy / (3)Angry / (4)Very Angry)
    On maxichart there randomly sorted the answers.. very angry or happy are sorted on first
    Question : How can I sorted the answers ? ( 1 / 2 / 3 / 4 ) not ( 4/2/1/3 )

    thank you

    • MaxiCharts

      Hi @jet0o
      You mean that maxicharts should just display answers in the same order as each question inside corresponding field, right ?
      You are totally right, that seems quite a bug !
      Thanks for your feedback, we’ll come back to you here after fix.

  • gerian

    Hello,

    I am creating a Pie Chart and the Segment Labels appear in random order (similar to above problem). Is there a shortcode to remove this or is this a bug? My chart corresponds with a colour scale, so I cannot have the colours randomly matched to segment labels…. how can I fix this?

    • MaxiCharts

      Hi @gerian,
      Can you please provide the URL to the page concerned and the shortcode you are using ?
      Also make sure you updated to lastests versions of MaxiCharts
      Thanks

  • gerian

    https://directbed.ca/product/cambridge-suite/

    midway down the page there is a pie chart. You will notice if you refresh page a few times, it will randomly and unexpectedly change the ordering of the colors / segment labels

    • MaxiCharts

      I refreshed about 10x the page and the colors are always : red : medium, black :soft, yellow : firm.
      Do you see something else ?

      • gerian

        https://directbed.ca/product/hamilton-suite-soy-foam-mattress/

        Try this page, it has the same chart. If you refresh, it will constantly randomize the colours & segments. I do have the latest version of maxi charts, as far as I know. I have set the short code parameter color_rand=”false” if that has anything to do with it…. but it has not helped.

        I really like this chart, would be a shame to not be able to display it.. any help would be appreciated.

        Thank you

        • MaxiCharts

          Sorry Gerian, i hadn’t seen your answer.
          No chart displayed on the page now…

  • kaviani.online

    Hi, many thanks for your useful plugins. I really appreciate your job.

    I have added this code to a page in the website:
    [gfchartsreports gf_form_id="2" include="90,96,95,94,93,92,91" type="bar"]

    Please find the result here:
    https://drcrm.ir/fa/clinicchart/

    As you can see there are 7 separate charts! But I need one chart with 7 bars.
    What is wrong in my shortcode?

    Regards
    Ali

    • MaxiCharts

      Hi Ali,

      Nothing is wrong, this is the normal behavior for MaxiCharts, intended to create report for a complete form with a quick shortcode.
      You can nevertheless group fields to make them appear on the same chart, but they need to be of the same type and coherent, unless you’ll get strange results : https://maxicharts.com/group-several-fields-on-one-graph/

      Cheers

  • kaviani.online

    I really appreciate your quick reply. I reviewed that link. But it still seems complicated to me. All the fields which I have used in this shortcode [gfchartsreports gf_form_id="2" include="90,96,95,94,93,92,91" type="bar"] are number fields. I just need the correct syntax of shortcode to show them in one graph.

    • MaxiCharts

      Yes, but what do you want to show ? You can try just adding the group_fields parameter:

      Something like this : [gfchartsreports gf_form_id="2" group_fields="1" include="90,96,95,94,93,92,91" type="bar"]

  • kaviani.online

    I added group_fields=”1″. The new code is: [gfchartsreports gf_form_id="2" group_fields="1" include="90, 96, 95, 94, 93, 92, 91" type="bar"]. Unfortunately the result is: No data available for fields

    When I remove group_fields=”1″, it shows seven separate bars line by line without any error message. I just need to show all 7 bars together as one chart 🙂

    • MaxiCharts

      Ok give us a couple of days to test this.

  • kaviani.online

    Thanks a lot. I really appreciate your patience and support.

    • MaxiCharts

      After more investigation, the most probable is that all included fields are not of the same type… Can you please upgrade both MaxiCharts and MaxiCharts Gravity Forms Add-on, and it should give you a bit more details about the problem.

  • kaviani.online

    Thank you friends. I updated plugins. Now it said that fields are not same. But all fields are numbers.

    Then I created a very simple form with three numbers. Then I added this shortcode in a page: [gfchartsreports gf_form_id="3" group_fields="1" include="1, 2, 3" type="pie"] (The entered numbers or 1, 2, 3).

    This screenshot shows the result:
    https://prnt.sc/lnfmn4

    🙂

    • MaxiCharts

      Ok, first you have a chart showing, so the problem with the first shortcode may be a type problem.
      Can you export your chart from gravity forms and send it us using the contact form : https://maxicharts.com/contact/

  • kaviani.online

    Sure. It shows your kindness. But please consider the main reason that we use charts, is to visualize a group of numbers in one picture. That is why most of people use charts. I believe (and probably most of users) that the default output of your plugin must show all data in one chart. If you do that, I am sure so many people install and use your plugin. You have surrely spent hundreds of hours for your plugins. Please think about my suggestion. People do not like seperate single charts, because simply it is not useful. 🙂

    • MaxiCharts

      Thanks for your feedback!
      We try to answer our customers needs everyday, and yes, you are right we are not answering all currently! But we still have more than 600 users around the world, which is a good start. 🙂
      Please send you form so as we can understand what’s going wrong.

Leave Comment