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

RadHtmlChart Showing Odd Behaviour with DataSource from StroedProcedure

1 Answer 94 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Tilo
Top achievements
Rank 1
Tilo asked on 30 Jul 2015, 01:59 PM

Hi All,

I have a crazy behaviour on my RadHtmlChart. It has a DataSource coming from a stored procedure. This procedure accepts two parameters provided by RadDropDowns (@DateID and @Group).

I choose a @DateID from DropDown 1 , a @Group from DropDown2 and Invoke the Databind by clicking the Filter Button. Hence the RadHtmlChart gets the Data from the stored Procedure and renders Columns as expected. Furthermore a RadGrid is included to display the same data from the DataSource. (Image V1)

However, if the parameter @Group includes an item starting with letter 'U', the RadChart is not rendered and even blocks others from showing.(Image V2)

I really tried out everything, but RadChart is not rendered correctly whenever any item with an 'U' is included.

AnyOne any idea what the reason for this crazy behaviour might be?

 


 

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 31 Jul 2015, 08:32 AM
Hello Tilo,

I have already replied to the support ticket that was opened by you on the matter, so that I paste my answer there for the community:

Most probably there is something wrong with the returned data. Can you please try to extract this chart's data source and then provide it back to us, so that we can make an examination?

The easiest and fastest way to export the chart data source is to utilize the client-side API. For example:
Copy Code
$find("chartID").get_dataSourceJSON();


You can also export the data source on the server-side - convert SqlDataSource to a DataTable data source and then extracted it to an XML file.

Copy Code
protected void Page_Load(object sender, EventArgs e)
{
    //How to convert the SQLDataSource to a DataTable:
    //DataSourceSelectArguments args = new DataSourceSelectArguments();
    //DataView view = (DataView)SQLDataSource1.Select(args);
    //DataTable dt = view.ToTable();
 
    DataTable dt = GetData();
 
    RadHtmlChart1.DataSource = dt;
    RadHtmlChart1.DataBind();
    ExportDataTableToXMLFile(dt, @"C:\Work\TWS\Helpers\myXMLDS.xml", "myDataTableName");
 
}
protected void ExportDataTableToXMLFile(DataTable dt, string exportFileName, string DataTableName)
{
    if (dt.TableName == "")
    {
        dt.TableName = DataTableName;
    }
    for (int i = 0; i < dt.Columns.Count; i++)
    {
        dt.Columns[i].ColumnMapping = MappingType.Attribute;
    }
    dt.WriteXml(exportFileName);
}


Regards,
Danail Vasilev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart (HTML5)
Asked by
Tilo
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or