Okay
  Public Ticket #897245
Multiple graphs in one chart
Closed

Comments

  •  2
    David started the conversation

    Hello,

    One of my clients wants to show monthly production over the past three years with a bar graph. Easy enough to do with a regular excel-document just shoved into wpDataTables. (As seen in my Related URL)

    The thing is that the client wants me to add some kind of marker for "expected production" per month.

    I know that in excel you can pick a column in a bar graph and just change the graph type to something else, like a line graph, and it'll be overlayed on top of the bar graph. Is it possible to something similar in wpDataTables?

    Example found in this youtube-video:


    Big thanks in advance!

    Regards,

    David


  • [deleted] replied

    Hi Dave,

    We do not have option like this built in but you can try to specify chart type for different chart series with callback function. 

    Here is the example for Highchart and you should enter this code in text tab of the page editor which contains that chart.  

    <script type="text/javascript">
    jQuery(window).load(function(){
    if( typeof wpDataChartsCallbacks == 'undefined' ){ wpDataChartsCallbacks = {}; }
    wpDataChartsCallbacks[1] = function(obj){ 
     obj.options.series[0].type = 'column',
     obj.options.series[1].type = 'spline'
    }
    });
    </script>
    
    
    [wpdatachart id=1]
    
    
    

    You just need to adjust this for you chart id by changing 1 to your chart id in 

    wpDataChartsCallbacks[1]
    

    and check that series numbers  and column types are appropriate ones. 

    This way you should be able to combine multiple chart types on in one chart and your result should be similar to this example

  •  2
    David replied

    Miljko,

    I could not have asked for a better reply to my ticket! This is exactly what I was looking for. Thank you!

    Have a great day!

    Regards,

    David

  • [deleted] replied

    David, 

    I'm glad that I could help. 

    If you like our plugin and support please rate our plugin at CodeCanyon on this link. It means a lot to us. Thanks.