Hi there Ben
I have installed your awesome Peity Charts.
I have encountered an issue where i have added two updating line charts to the same web page. Since adding the second updating line chart to the same page, i have lost the functionality on the first one. It renders graphically but has stopped animating.
Following guidance on your documentation, i have added the following code to my web page:
Updating Chart One HTML:
<span class="updating-chart">5,3,9,6,5,9,7,3,5,9,6,5,9,7,3,5,2</span>
Updating Chart One JavaScript:
var updatingChart = $(".updating-chart").peity("line", { width: 64 })
setInterval(function() {
var random = Math.round(Math.random() * 10)
var values = updatingChart.text().split(",")
values.shift()
values.push(random)
updatingChart
.text(values.join(","))
.change()
}, 1000)
Updating Chart Two HTML:
<span class="updating-chart-two">5,3,9,6,5,9,7,3,5,9,6,5,9,7,3,5,2</span>
Updating Chart Two JavaScript:
var updatingChart = $(".updating-chart-two").peity("line", { width: 64 })
setInterval(function() {
var random = Math.round(Math.random() * 10)
var values = updatingChart.text().split(",")
values.shift()
values.push(random)
updatingChart
.text(values.join(","))
.change()
}, 1000)
The reason for me running two updating line charts is because i would like to style the two updating line charts differently.
I am not that experienced with JavaScript, so i am hoping you would be kind enough to help resolve my issue.
Thanks ever so much, and thanks for such a great data chart solution. Its really appreciated.
Regards