-
AuthorPosts
-
April 29, 2014 at 12:54 pm #257588
hi!
I do use the insert-html-snippet plugin as mentioned here in this forum to generate javascript charts. It works well on “static” elements, but the same snippet used in the content slider doesn’t generate the graph.I appreciate your help! many thx. fri_z
————————-
Snippet code
<div id="containerix01" style="min-width: 310px; height: 200px; margin: 0 auto"></div> <script language="JavaScript" src="http://code.highcharts.com/highcharts.js"></script> <script language="JavaScript" type="text/javascript"> var chart = new Highcharts.Chart({ chart: { renderTo: 'containerix01' }, xAxis: { type: 'datetime' }, series: [{ data: [0, 25, 0, 25, 0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], pointStart: Date.UTC(2012, 0, 1), pointInterval: 24 * 3600 * 1000, }] }); </script>
Code in Slider Element
[xyz-ihs snippet="img1"]
* plugin “Use Google Libraries” is required as well
April 30, 2014 at 7:58 pm #258448Hey fri_z!
I’m not sure there is anything that we can do with that. Using the plugin is a workaround for trying to insert in content that isn’t meant for a content area.
If we can see the site and section live we can try inspecting the implementation but it may be something that is best handled with a custom shortcode or small plugin to make the scripts pulled in correctly.
Best regards,
DevinApril 30, 2014 at 8:14 pm #258471may I send u the login credentials per mail, address?
April 30, 2014 at 11:36 pm #258582Hey!
We just need the site URL, post it here as a private reply (only you and mods will see it).
Best regards,
JosueMay 1, 2014 at 7:01 am #258762This reply has been marked as private.May 1, 2014 at 8:02 pm #259025Hey!
I don’t see any content slider in that page, no JavaScript errors either.
Regards,
JosueMay 1, 2014 at 8:10 pm #259026This reply has been marked as private.May 2, 2014 at 7:17 am #259215Hey!
The error (Uncaught Highcharts error #16) is happening because Highcharts already defined in the page, you’d need to refactor your code:
http://stackoverflow.com/questions/17364172/highcharts-error-16-charts-not-showing-on-the-same-pageRegards,
JosueMay 2, 2014 at 10:57 am #259297You’re right! I didn’t take care because it worked for two charts, but it obviously does not for another one.
Charts are now OK, no javascript error at all. Still there’s an issue that the rendering of the charts in the slider doesn’t work properly… Guess this is something I need to check out with HighCharts.
Many thanks for your help!May 2, 2014 at 7:09 pm #259518You are welcome, glad we could help :)
Regards,
Josue -
AuthorPosts
- The topic ‘Content slider with html/javascript’ is closed to new replies.