DataGrid with Dynamic Charts
I didn’t mean to but I ended up playing with DataGrids for a few hours last Saturday. Starting out I just wanted to display PieCharts in a DataGrid column. It’s easy, just create a component and then declare that as the itemRenderer of the DataGridColumn.
Having Charts is cool but I wanted them to be dynamic. So in the next column over I added a component that creates NumericSteppers for each of the dataPoints in the chart. Changing the value of a NumericStepper updates the value in the PieChart.
| view source |
To do the updating I had to cheat a little. Actually I’m not cheating. I’m doing it the way that I’d create an event in any application that I build by using a class I created called Zion. Zion is basically my personal event manager.
One problem that I noticed is that sorting doesn’t work properly at all. Try clicking on the Title header and watch that sometimes you end up with the same dataPoints being charted twice. I’m not sure if there’s something that I didn’t account for or if there is a bug with the DataGrid.
If something here has proved valuable to you then feel free to drop a couple of bucks in the tip-jar.






