11 Answers, 1 is accepted
Please have a look into the following sample client side code I tried at my end.
I'm getting a null value when trying to do the:
I'm databinding the htmlchart programmaticly and wanted to change the datasource from client-side on another chart clientseriesclick event.
I have tried to reproduce to described issue but to no avail. You can find a short video with the test as well as a VS sample that I have used for the test in the attached archive and then notify me if I am missing something.
The used sample is a modified version of the example in the Client-side API help article. You can helpful that example as well as the HtmlChart - Client-side Binding online demo in resolving the unexpected behavior.
It may also be possible that you are using an older version of RadControls that do not support the client-side databinding functionality yet. If that is the case we strongly recommend to update your version of RadControls to the latest one. This help article will shed more light on how to do that.
If the above information, however, is not helpful could you please amend my VS example, so that it reproduces your issue and then tell us what changes you have made, so that we can proceed further with the investigation?
the Telerik team
My case is different from the demo.
Im generating different type of charts, sometimes its a pie, others columns, etc...
I create series programmaticly thats why on the .aspx file i only declare the
<telerik:RadHtmlChart ID="chartId" runat="server"></telerik:RadHtmlChart>.
The rest is on the server side.
Thanks for your help.
Thank you for the additional clarification.
Note that you can get the datasource of the RadHtmlChart on the client-side only for a databound chart (if SeriesItems are created and added programmatically then you cannot access them on the client).
You can, however, set a particular datasource to the chart on the client without the need to initially databound it on the server. The only requirement is to set the DataFieldY property of the particular series. More information on the matter is available in this demo.
I can suggest you that instead of creating SeriesItems programmatically, to create a sample datasource programmatically and databound it. Then you will have the ability to access and modify it on the client. You can also find attached a VS example that demonstrates how to switch the series type and modify the datasource of the chart on the client.
Thanks for your reply, that was a really good idea! I'll try it.
Yes, you can use the ClientDataSource in order to bind RadHtmlChart to JSON data. A live demo demonstrating such scenario can be seen here:
Thanks for your example. I have tried ScatterLinechart with the sample json data, looks like the chart loads fine in Chrome browser but not loading in IE11 and Edge.
Further debug found that cx value is not set in Edge & IE11
Could you please help me why it doesn't load in Edge & IE11.
Please ignore the above issue.I have fixed the issue by changing the datetime format.
Earlier i was using an datetime format as shown below
now i have changed the datetime format as below and it started working in Edge & IE11.
Thanks a lot for the update, Jeeva - I am happy to know the chart behaves as desired by you now.
Our thoughts here at Progress are with those affected by the outbreak.