<nvd3 options="row.entity.spark.options" data="row.entity.spark.data"></nvd3>I am wondering if any of you had any experience with injecting a graph into a ui-grid. What I am doing, is I have a row defined as follows: { name:'Column Name', cellTemplate: '<spark-line-chart values="grid.appScope.valuesStacked"></spark-line-chart>'}Spark-line-chart directive is responsible for creating a D3 chart (actually, nvd3 to be precise). This creates svg graph.Now, each time I am trying to sort my table, all of the values within the table get sorted, apart from the graphs. So far, I am mocking up data, and use one array of values for all of the graphs. Anyone had similar issues, and knows the answer to this question? 解决方案 At first which kind of Angular module for nvd3.js are you using?If you use angular-nvd3 you can check this example:http://plnkr.co/edit/XESqEPwfXF3ulQkfuBOEPay attention that in your cell templates you must wrap the nvd3 graphic inside a <DIV> with .ui-grid-cell-contents CSS class:<div class="ui-grid-cell-contents"> <nvd3 options="row.entity.spark.options" data="row.entity.spark.data"></nvd3></div> 这篇关于连续的 Angular UI-Grid 和 D3 图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-25 03:07