This is a migrated thread and some comments may be shown as answers.

Pure client side

1 Answer 32 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Henrik
Top achievements
Rank 2
Henrik asked on 01 Feb 2014, 02:42 PM
Hi.

I cant seem to figure this out:
I want to use the HTMLchare pure client-sided.

My data looks like this :
var qData = [{"QNum": 1,"Result": 2},{"QNum": 2,"Result": 2},{"QNum": 3,"Result": 3},{"QNum": 4,"Result": 3},{"QNum": 5,"Result": 4},{"QNum": 6,"Result": 1}];

My chart is configured like this :

                <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server"
                    Width="800px" InvokeLoadData="FromCode">
<ChartTitle>
<Appearance Visible="False">
</Appearance>
</ChartTitle>

                    <Legend>
                        <Appearance Visible="False">
                        </Appearance>
                    </Legend>
                    <PlotArea>
<XAxis Step="1" Visible="True" DataLabelsField="QNum" >

</XAxis>

<YAxis MaxValue="4" MinValue="0" Visible="True"   >

</YAxis>
                        <Series>
                            <telerik:ColumnSeries Name="Result" DataFieldY="Result" >
                                                               <Appearance>
                                        <FillStyle BackgroundColor="#d5a2bb"></FillStyle>
                                   </Appearance>
                            </telerik:ColumnSeries>
                        </Series>
                    </PlotArea>
                    <Navigator>
                        <XAxis Visible="True">
                        </XAxis>
                    </Navigator>
        </telerik:RadHtmlChart>

And i try to bind it like this:

                    function CheckboxClicked(sender) {
                        var RadHtmlChart1 = $find('<%=RadHtmlChart1.ClientID %>');
                        RadHtmlChart1.set_dataSource(qData);

                        //Redrawing the chart
                        RadHtmlChart1.repaint();
                    }


Now, when I repaint, it does create 6 labels on the XAxis and naming them according to the QNum column in my data but the values of the columns are not populated according to the "Result" column in my data.

What am I missing?

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 04 Feb 2014, 02:36 PM
Hello Henrik,

Setting the InvokeLoadData property to "FromCode" is required in scenarios where the chart's data source is to be loaded via a callback. Since the data source binding is performed entirely on the client it is not required for this property to be set. You can also find a runnable sample of the provided VS example in the attached archive.

Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Chart (HTML5)
Asked by
Henrik
Top achievements
Rank 2
Answers by
Danail Vasilev
Telerik team
Share this question
or