• This may be a somewhat unique scenario, but basically what I’m trying to do is provide a drop-down box filled with data from ACF (Advanced Custom Fields) data. When the user chooses one of the options, a chart will show how many of our clients use the vendors of the chosen solution.

    To make a long story short, the only part that I can’t seem to get to function correctly is the display of the chart.

    The pieces I’ve created in order to try this out are :

    1. A custom plugin in php, along with an associated shortcode that gathers the data for the drop-down box containing the ACF data. The drop-down box has all the data that it’s supposed to. This part works flawlessly.

    2. A javascript file to handle the drop-down on-change functionality. This part also works flawlessly. I have set up breakpoints and console.log output so I know this bit is fine. In this file, there is a jQuery ajax call that connects to another php plugin that I’ve created (see the next bullet), sending the chosen value from the drop-down box.

    3. Another custom php plugin that takes the chosen value from the drop-down box and gets the data from the set of ACF data. I think this is also working fine .. until we get to doing the shortcode for wp_charts. The DOM is being updated. I can inspect it and see that the canvas has been added. I can also see there’s a script that is also inserted with the parameters for the chart to be created.

    Unfortunately, though, with all the above info in mind, the chart just simply does not display. I do a ‘do_shortcode’ command with all the required information in the plugin mentioned in #3 above. I even just printed the resulting code that would make up the shortcode for the chart I’m trying to select and it works like a charm. So I know my php code is constructing the shortcode string correctly.

    I’m working from a local instance of WordPress, so I can’t share a link.

    I’ve seen quite a few unanswered threads about the charts not displaying.

    I guess what I’m looking for is .. maybe another way to test/figure out what *should* be happening after the DOM is updated. Is there some javascript that’s supposed to run? Is there a repaint() function I can use?

    If anyone has any suggestions, I’d love to hear them. I’m more than willing to share any information I can to resolve this; it would be pretty sweet to get it to show the requested chart.

  • The topic ‘My chart is not rendering’ is closed to new replies.