Chart inside data grid cell


#1

I’m putting my chart inside of a ShinobiDataGrid cell…so basically I’m showing a sparkline.

The chart gets set in the dataGridDataSourceHelper:populateCell:withValue:forProperty:sourceObject method, so the cell has already been created.  I gave the cell type as my custom class that draws the chart, and in that class I override the initWithReuseIdentifier: method…that’s where the chart is alloc/init’d.  The issue I’m having though is that when the initWithReuseIdentifier: method is called, the cell doesn’t yet have a frame size.  

How do I know what to set the frame of the chart to then?


#2

Hi,

Whenever you put a view inside of a cell it will automatically change the size of the view to be the size of the cell. You can find out more information about this here:

http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiGrids/2.0/Standard/Normal/Classes/SGridCell.html#//api/name/fitSubviewsToView

Regards,
Chris