Thursday, 15 July 2010

javascript - Display modal on clicking a Morris pie segment -



javascript - Display modal on clicking a Morris pie segment -

am creating pie charts , donut charts using morrisjs this have modal pop when click segment in charts.

am used doing modals way

<!-- link shw modal --> <a href="#modal-id" class="btn btn-success" data-toggle="modal" > click show modal</a> <!-- modal --> <div class="modal fade" id="modal-id" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> ... </div>

now in morris pie charts, dont have id elements hence unable accomplish modal. there way can it?

add click event handler end of donut or pie chart

charts.donut({ element: _element, data: _data, colors: _colors, }).on('click', function (i, row) { $('#id_modal').modal({ show: true }); });

javascript html modal-dialog morris.js

No comments:

Post a Comment