Okay
  Public Ticket #1271949
Reversing Y-Axis in Data Charts
Closed

Comments

  •  6
    titusraj started the conversation

    Hi

    We are using your the highcharts option in WpDataCharts, and the following code in the theme functions.php to reverse the Y-Axis of the front-end table.

    function add_script_footer() {
        if (is_page('Triathlon Race Results')){ ?>
            <script type="text/javascript">
                jQuery(window).load(function(){
                    if( typeof wpDataChartsCallbacks == 'undefined' ){ wpDataChartsCallbacks = {}; }
                    wpDataChartsCallbacks[1] = function(obj){
                        obj.options.chart.yAxis.reverse = true;
                    }
                });
            </script>
        <?php }
    }
    add_action('wp_footer', 'add_script_footer');

    This was working until the latest theme update.  The theme update removed the code above.  When I reinserted the code into updated theme function.php, both the data table and chart do not load [Please see attached screenshot].  I would like to know the following:

    1) What is wrong with my code, and how do I get the chart to load with a reversed y-axis?

    2) Where can I place this code such that theme updates do not delete it?

    Thanks

    Navin

  •  1,846
    Miloš replied

    HI Navin,
    Thank you for your purchase.

    As I can see this code should not affect the table if you have trouble loading table please try to see there are any js errors on that page.

    You can put all js code on the every post page and in text tab and put your code between script tags and it should work.

    Best regards.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables