Hi, Your view model should have a property that describes the chart, i.e. contains all needed information. Register a ComponentFactory (e.g. with ServiceLoader) that creates a component/Panel for the type of the view model. The component should render the chart by using the provided data ( ViewModel#getObject()) On Mar 7, 2015 1:41 PM, "sunand p" <sunandonl...@gmail.com> wrote:
> Hi Dan, > > Just to clarify a little more my question is more of inside a view model > instead of rendering the chart by an Action (which means at click of a > button) can i render the chart in the view itself. If it is related to the > second question you mentioned in the email please throw some light on it as > to how to achieve it. > > - Sunand > > On Sat, Mar 7, 2015 at 4:30 PM, sunand p <sunandonl...@gmail.com> wrote: > > > Thanks Dan, for the quick response my question was with respect to the > > first one, will reply to this thread if I manage to render a chart in the > > Home Page. > > > > - Sunand > > > > On Sat, Mar 7, 2015 at 4:04 PM, Dan Haywood < > d...@haywood-associates.co.uk> > > wrote: > > > >> Isis basically just invokes the action that is annotated with @HomePage. > >> This action could return anything... a scalar, a list of objects, a > single > >> entity, a view model, and it'll be rendered as normal. > >> > >> Most likely you should create a view model for your dashboard, and have > >> the > >> @HomePage action return that. The todoapp in isisaddons uses this > >> technique [1] > >> > >> ~~~ > >> There's then a separate but related question of how to have the view > model > >> render the charts in the way that you want (eg using our Wicket > >> ComponentFactory API).... but I'm not sure if that's the question you're > >> asking? > >> > >> > >> Dan > >> > >> > >> > >> [1] > >> > >> > https://github.com/isisaddons/isis-app-todoapp/blob/fb8d92cf3c68fc2456d5010fe788b4faf2152590/dom/src/main/java/todoapp/dom/app/dashboard/ToDoAppDashboardService.java#L38 > >> > >> > >> On 7 March 2015 at 10:27, sunand p <sunandonl...@gmail.com> wrote: > >> > >> > Hi All, > >> > > >> > Is there a way to render a chart in the Dashboard (Home Page) instead > of > >> > having it as an action and then rendering a chart. I know that there > is > >> > limitation in scalar charts when attached to an entity but how about > in > >> a > >> > Home Page? > >> > > >> > Any suggestions? > >> > > >> > - Sunand > >> > > >> > > > > >