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 (47)

  • 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.

  • Kyle.P

    I notice that on the Pie chart, in the legend/key, it shows all options with the corresponding colors. But on Bar charts, it just shows the topic with the first color. This could be a little confusing. Is there a way to either A) show all options and colors on bar charts like on the pie charts, or B) hide the legend/key altogether?

    Thank you!

  • jamesp

    Wow! Five hours later and still “No data available for fields”…Impressive!

    • MaxiCharts

      Thanks for your feedback, can you please detail you problem ? Send the URL concerned and the shortcode used.

  • shirinchart

    How to show chart values without hover ( fixed and static)? Now the chart information is displayed in tooltip.

    • MaxiCharts

      Hi, it is not possible right now, but we could easily add an option to disable it totally if you need it.

      • shirinchart

        Would you please add that option? It is very important for me to show the statistics always not on hover or tooltip.

        • MaxiCharts

          Yes, it is added on our roadmap.

  • Jonathan Sharp

    I cannot seem to work out how to get fields on the same chart! I am designing a repayments calculator and want to create a bar chart with all of the end of year amounts on one chart.

    Extra years are added based on the amount of time until retirement.

    The form and chart is here: https://www.noallco.com.au/retirement-calculator-2/

    Don’t need to fill in name or email but put amounts in to the top section (even where they default – still have to put them in).

    Once in – don’t hit submit but the charts should appear below. As you will see they all appear separate.

    Here is the shortcode I am playing with:

    [gfchartsreports height="400px" colors="#ffa12c,#fd6a45,#f24242,#bd2754,#6d2976" center="true" type="bar" gf_entry_id="last" group_fields="23,26,32" include="23,26,32" width="63%" gf_form_id="3"]

    The form ID is 3 and at the moment the 3 fields I am trying to get on the same chart are 23, 26 and 32. I also want the labels to reflect the $ amount.

    Think I have been playing with it too long and my eyes are just missing what I am doing wrong.

    Please help.

  • Jonathan Sharp

    OK, I am further down this field now and discovered a theme issue that wasn’t letting me get the charts in properly.

    The form and chart is here: https://www.noallco.com.au/retirement-calculator-2/ with the bar chart only visible once submit is hit ( I have disabled the need for name and email for now). Note: if you do try it only 10 years are created so far – you need to put your age within ten years of desired retirement age to show the chart.

    Question 1 is: The bar chart is pulling the correct data but all bars are the same size as it is showing as a % I think
    Question2: How do I get rid of the “Year 1 – End” legend and instead put a label below each bar?

    Thanks

    • Jonathan Sharp

      Here is my shortcode by the way: [gfchartsreports gf_form_id="3" type="bar" chart_js_options="title: {display: true, text: 'Your Retirement Value over Time'}" gf_entry_id="last" group_fields="1" include="23,48,53,58,60,77,95,101,107,113"]

  • Jonathan Sharp

    Any help? I managed to hide the “Year 1 – End” label but still cannot work out how to put a better label to each bar and display the bars as a $ value instead of all the same height as a %! Help!

    • MaxiCharts

      Hi @Jonathan,
      The bar label is linked to the data, so you cannot set it manually unless you implement de hook dedicated for that: mcharts_filter_chart_labels
      I tried your form, but i see only one bar at the end, could you send a screenshot or something else to understand what you need ?
      Cheers

  • Jonathan Sharp

    Sure. So the link to the form is: https://www.noallco.com.au/retirement-calculator-2/.
    Enter in the details as I have in the screenshot: https://snag.gy/k9502O.jpg
    Don’t worry about filling in the name or email address.
    Scroll down and tick the box saying “Show me the Summary” – the screen extends down to show your interest over time: https://snag.gy/06Snaq.jpg
    Note the fields on the far right saying Year 1 – End, Year 2 – End etc

    Now, scroll all the way down to the bottom and hot the Submit button.
    The next screen shows a written summary plus a chart that is supposed to show the growth over time: https://snag.gy/qwRMGs.jpg

    Those bars are linked to the fields you looked at before – “Year 1 – End”, “Year 2 – End”. But the amount calculated is showing as the label for each and every bar is the same size!

    • MaxiCharts

      >> The next screen shows a written summary plus a chart that is supposed to show the growth over time: https://snag.gy/qwRMGs.jpg

      Where have you seen this is supposed to show the growth over time ? Unfortunately, this feature does not exists at the moment. Please contact us if you need a quote for that. Thanks

  • Jonathan Sharp

    All I am trying to do is create a bar chart that shows :

    First bar (label year 1), value $1000
    Second bar (label year 2), value $1800
    Third bar (label year 3), value $2600 etc based on the value in the fields.

    What part of this is not possible?

Leave Comment