Get 2024 Templates Mega Bundle!19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets
Get for 99$

Connecting 3 Amcharts bar graph with different placeholder data


Hi there,

I want to create 3 bar graphs on one page that all display different data but when I reuse the same graph and change the ID and create separate JS files for them, one keeps disappearing.

Im using the Js file found in "src/js/widgets/charts/widget-15.js" and created 3 different Js files with 3 different IDs and connected each script in the bottom. But I can only mange to get 2 to stay while the 3rd one keeps disappearing

Thank you for your help


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi,

Can you please share your code(html, js) via https://gist.github.com/ ?
Do you have any js error in your browser console? You can share your screenshots via https://imgur.com/

Also double check the ID and make sure you use the same ID in the JS code(avoid extra space, etc in the ID string).

Regards.



Hi there, thanks so much for your response.

I added the source code to github like you requested, here is the link:
https://gist.github.com/J-brandon/11f6fad946d1bc250136e7195215d9e9

I do have an error it gives but I sadly do not understand it, here is the screen shots:
https://imgur.com/a/H4btnqF

One thing I want to mention is that when you add the 3rd script for the 3rd bar graph the 1st bar graph info disappears and becomes blank but as soon as you delete the 3rd script for the 3rd graph the 1st graph will start working again

Thanks again for your assistance, I really appreciate the help



Hi,

I see that you have 2 KTChartsWidget15 classes in your code. Please make sure each class has a unique name.

Regards.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(