Hi,
how can I pass ViewData to a Chart in ASP.NET MVC? Should be somethig like
Chart.DataSource = ViewData["Data"] in the .aspx file.
Chart.DataSource = ViewData["Data"]
Thanks!
yes, but i think you would need to use an event handler and bind the data in codebehind. the <% %> markup extensions don't work in every context.
Hi again,
this works, but only in a UltraWebTab:
<ig:WebTab ID="SalesVolumeTabs" runat="server" Height="260px" Width="200px"> <Tabs> <ig:ContentTabItem runat="server" Text="Diagramm" > <Template> <% SalesVolumeChart.DataSource = ViewData["SalesVolumeData"]; SalesVolumeChart.DataBind(); %> <igchart:UltraChart ID="SalesVolumeChart" runat="server" DeploymentScenario-ImageURL="../Content/images/Chart.png" DeploymentScenario-FilePath="../../Content/images" EmptyChartText="Keine Daten vorhanden." ChartType="PieChart" Version="10.2" Height="240" Width="180" > </igchart:UltraChart> </Template> </ig:ContentTabItem>
</Tabs> </ig:WebTab>
I tried the same in the ExplorerBar (which was the first component to choose because of the linear alignment for mobile devices), but I always get Errors. Something like: <% %> tags can't be placed in the template section or that the component SalesVolumeChart is not known in the document.
Is there a way to get this working in an ExplorerBar, so that the chart is show in a group section of the ExplorerBar?
Thanks again, KurtJulius