-
AuthorPosts
-
September 3, 2014 at 8:04 pm #313078
Hi,
we want to use highcharts. When i try to implement it 1:1 like in the fiddle:
http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/line-basic/it doesn’t work. Even with jQuery(function() it doesn’t work.
where is the trick or what do i have to change?regards
celevra
September 3, 2014 at 8:41 pm #313096Hey celevra!
That isn’t really something we could answer for you here at support. You could try stack exchange or maybe a freelance developer but debugging custom code is beyond the scope of support.
Cheers!
DevinSeptember 3, 2014 at 9:56 pm #313109Hi Devin,
it’s not about debugging, its about using standard jquery based code.
This code is definitly working but not in enfold so there must be something i have to keep in mind and thats what i want to know ;-)regards
celevra
September 4, 2014 at 2:00 pm #313376Hi,
as it seems no jquery plugin is working. What is the magic bit to include jquery plugins?
regards
celevra
September 5, 2014 at 11:50 am #313955Hey!
Not sure why it doesn’t work for you but I just used a “Code Block” element on this page: http://test.inoplugs.com/impressum/ and it worked for me. I used following code:
<script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/modules/exporting.js"></script> <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div> <script> (function($) { $(function () { $('#container').highcharts({ title: { text: 'Monthly Average Temperature', x: -20 //center }, subtitle: { text: 'Source: WorldClimate.com', x: -20 }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, yAxis: { title: { text: 'Temperature (°C)' }, plotLines: [{ value: 0, width: 1, color: '#808080' }] }, tooltip: { valueSuffix: '°C' }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', borderWidth: 0 }, series: [{ name: 'Tokyo', data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6] }, { name: 'New York', data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5] }, { name: 'Berlin', data: [-0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0] }, { name: 'London', data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8] }] }); }); })(jQuery); </script>
Regards,
PeterSeptember 5, 2014 at 12:57 pm #313983Hi Peter,
works like a charm, thank you very much, so the solution is to run the code like you would do in this funktion:
(function($) { })(jQuery);
thank you again
September 6, 2014 at 3:54 am #314299Hey!
Exactly, you need to wrap your code with that in order to make any custom jQuery ($) code work in WordPress (it wasn’t a theme issue):
http://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/Best regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.