Hi,
I am using igDataChart as below:
@( Html.Infragistics().DataChart(Model) .ID("chart") .Width("700px") .Height("400px") .VerticalZoomable(true) .HorizontalZoomable(true) .Axes((axes) => getting error on this line { axes.NumericX("xAxis"); axes.NumericY("yAxis"); }) .DataBind() .Render())
Error is as below:
CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type
You are almost there - two small adjustments:
Put a @ before the 'foreach' to let know the Razor egine know that's a code block if you haven't already.
The second and more important thing is to remove the ID property from the chart - jQuery controls are initialized based on their target element's ID and in such loop they are all the same and all charts will attempt to render on the same container. When you remove the ID the MVC helper is smart enough to assign ID and number them automatically so multiple charts can be rendered.
I've modified your Test project's view file to render two charts for example:
(event though I'm using the two halves of one data set, replacing it with multiples, exactly like your foreach code, wil work just as fine).
Regards,
Damyan
Hi Damyan,
Now I can see the chart.
Just wondering how to render multiple chartsin a loop, something as shown below:
foreach (DataSeries dataSeries in dataSeriesCollection) { <fieldset> @(Html.Infragistics().DataChart(dataSeries.AsQueryable()) .ID("chart") .VerticalZoomable(true) .HorizontalZoomable(true) .Axes((axes) => { axes.NumericX("xAxis"); axes.NumericY("yAxis"); }) .Series(series => { series.Scatter("scatterSeries") .XAxis("xAxis").YAxis("yAxis") .XMemberPath(dataPoint => dataPoint.X) .YMemberPath(dataPoint => dataPoint.Y); }) .DataBind() .Render() ) </fieldset> }
Thanks Graham, now its apparent that the root cause was the folder structure.
I would request you and you documentation team to update this information.
If i could have find this information in documentation, I would have saved 2 days :)
Thanks again.
Thanks a Ton Damyan.
I have intentionally removed the js files and dll, since infragistics forum does not allow file size above 200KB.
Later i uploaded the modified solution to dropbox.
It looks like the problem was with the Folder structure, js files should be kept so that loader can find them.
Solution is working now. Thanks again.
Damyan, you beat me to it! :)