FloffnoniPalp
New Member
I want to create dynamic DevExpress charts in asp.net, and utilize the custom-callback function to update the charts data points at run-time from javascript. I'am using the following code:\[code\]protected void CreateBarChart(string layoutName, string tableCellId, string controlType, string controlData, string controlName){ try { ASPxDockPanel dockPanel = CreateDockPanel(tableCellId, controlName, controlData); string dockZonePanelId = "dockPanel" + tableCellId[tableCellId.Length - 1]; WebChartControl webBarChart = new WebChartControl(); webBarChart.EnableClientSideAPI = true; webBarChart.CustomCallback += BarChart_CustomCallback; webBarChart.Legend.Visible = false; webBarChart.EnableCallBacks = true; webBarChart.ClientInstanceName = "barChart" + m_barChartId; webBarChart.Series.Add(new Series("Series", ViewType.Bar)); webBarChart.Series[0].ArgumentScaleType = ScaleType.DateTime; webBarChart.Series[0].ValueScaleType = ScaleType.Numerical; Random r = new Random(); for (int i = 0; i < 5; i++) { webBarChart.Series[0].Points.Add(new SeriesPoint(DateTime.Today.AddDays(i), ((int)((r.NextDouble() * 100) * 10)) / 10.0)); } dockPanel.Controls.Add(webBarChart); } catch (Exception ex) { Debug.WriteLine(ex.Message); }}\[/code\]To generate the dynamic chart controls at runtime. This works work fine and the chart is dynamically placed on the back, the problem however is the callback is never hit. Any ideas on what I might be doing incorrect here?Here's the callback that should get hit when the javascript executes:\[code\]protected void BarChart_CustomCallback(object sender, DevExpress.XtraCharts.Web.CustomCallbackEventArgs e){ if (e.Parameter == "test") { }}\[/code\]and finally the javascript that passes in the values:\[code\]function setChartValues(brokerStats) { try { alert("After barChart1"); barChart1.PerformCallback('test'); } catch (error) { alert(error); }}\[/code\]