Okay
  Public Ticket #1069176
High charts
Closed

Comments

  •  2
    federico started the conversation

    Hi.

    I need to make some modifications to a HighCharts scatter graph, that I canĀ“t make through the wizard, for example:

    1) Fixed axis order. Everytime I sort the table, the order of the values in the y-axis changes. 

    2) Add a best fit line

    3) Adaptative min and max

    How can I do this?

    Thanks

     

  • [deleted] replied

    Hi Federico,
    Thank you for the purchase.

    1. This is happening because you have enabled Follow Table Filtering feature for this chart. Because of that when you sort the table or filter it it will change values on the Y-Axis. You can make it in right order if you make Precio column Default sort column and set Descending or Ascending for it. 

    2. Can you explain what do you mean by best fit line?

    3. You can set Minimum and Maximum Y-Axis value in Chart Wizard when you are editing or creating chart under Axes tab.

  •  2
    federico replied

    1) I understand. But, one thing is filtering and another thing is sorting. Sorting should not have any effect on the table, as the axis always follow a numerical order. How can I detach the table sorting from the graph?

    2) http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/combo-regression/

    3) I want the graph to adapt the min and max values according to the data. For example min y value= 10% below of the value of the minimum entry, max y value = 10% over the value of the maximum entry.

    4) Edit the information in the popup window over each entry. Look at attached image. Edit the name of the axis, add the id of entry as title, add a link, show x-value. 

    5) Make the title of the chart the chosen "marca" field. 

    Thanks

  •   federico replied privately
  • [deleted] replied

    Hi Federico,

    1. Unfortunately something like that is not possible. This event is added on every table draw and in draw are included both sorting and filtering.

    2. 3. 4. None of these options are possible out of the box. You can find all available chart options in Chart Wizard in the tabs and on this link from our documentation - link. All options that are not included can be added with wpDataChart callback function. You can take a look at usage and examples of this callback at this link.

    5. I didn't understand it quite well can you explain it in more details? 

  •   federico replied privately
  • [deleted] replied

    Hi Federico,

    1. Unfortunately not, because it is datatables library event that on that we attach. So I think that this would not be possible even with the custom coding. Table is recognizing every interaction with it as a new draw, and on that draw event is attached a function that is used to recreate the chart based on new table data.

    2. What do you mean by linking points with entries in the table? Can you explain me in more details? 

  •  2
    federico replied

    Hi Milos,

    Where do I add the jquery snippet for the wpDataChart callback?

    Thanks

  • [deleted] replied

    Hi Federico,

    The best practice is to add it on the page where your chart is located between <script></script> tags.

  •  2
    federico replied

    Ok, I added:

    <script type="text/javascript">
    jQuery(window).load(function(){
        if( typeof wpDataChartsCallbacks == 'undefined' ){ wpDataChartsCallbacks = {}; }
        wpDataChartsCallbacks[1] = function(obj){
            obj.options.chart.backgroundColor = '#AB3176';
            obj.options.tooltip = {
                formatter: function () {
                var s = '<b>$' + this.y + '</b>';
                return s;
                }
            }
        }
    });
    </script>

    to my page: http://catersoft.henlein.com.ar/index.php/observauto/?preview_id=35&preview_nonce=7d19bb71ae&_thumbnail_id=-1&preview=true

    But it does not work. 

    And it does not work in your tutorial page either: https://wpdatatables.com/documentation/information-for-developers/wpdatacharts-callbacks/

    What's the problem?


  •  2
    federico replied

    Hi. Any update?

    Regards

  • [deleted] replied

    Hi federico,

    Please send me the link of the page with the chart and please send me your login crednetials so I can take a look at the issue? You can write credentials here, just check PRIVATE so nobody can see it except us.

    We have fixed the issue on our documentation page. Thank you for reporting this.

  •   federico replied privately
  • [deleted] replied

    Hi Federico,

    I have added jQuery snippet on this page - Link with wpdatachart with ID 1 and changed background color. You can take a look and use it as an example how to use wpDataChart front-end callback function.