Non-standard behavior RadChartView

6 posts, 0 answers
  1. Valery
    Valery avatar
    53 posts
    Member since:
    May 2011

    Posted 21 May 2018 Link to this post

    I create chart as follows:

                var barModel = new BarSeries
                {
                    ValueMember = "Model",
                    CategoryMember = "N"
                };
                radChartViewGss.Series.Add(_barModel);
                var barWellModel = new BarSeries
                {
                    ValueMember = "WellModel",
                    CategoryMember = "N"
                };
                radChartViewGss.Series.Add(barWellModel);

    ...creating and filling a table (DataTable gssTable)

                radChartViewGss.DataSource = gssTable;

    ... and show table
                radGridViewGss.DataSource = gssTable;

     

    Everything works great.

    Then I want to change the data:
               radChartViewGss.DataSource = null;

               radGridViewGss.DataSource = null;

                gssTable.BeginLoadData();
                gssTable.Rows.Clear();

    ... filling a table (gssTable)

                gssTable.EndLoadData();
                gssTable.AcceptChanges();

    During the data modification process, the radGridView is not updated, but radChartView constantly tries to update itself. As a result, everything works very slowly.

    Why two similar component behave differently when data source disconnected?

    I know how programmatically I can disable this behavior of the chart. But this should be done automatically!!! If there is no data source, the chart is not drawn



     

     


  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3451 posts

    Posted 22 May 2018 Link to this post

    Hello, Valery,    

    In order to clear the RadChartView it is not enough to set the DataSource property to null. It is necessary to clear the Series as well.

    DataTable table = new DataTable();
     
    public Form1()
    {
        InitializeComponent();
        
        table.Columns.Add("Value", typeof(double));
        table.Columns.Add("Name", typeof(string));
        table.Rows.Add(1, "John");
        table.Rows.Add(3, "Adam");
        table.Rows.Add(5, "Peter");
        table.Rows.Add(12, "Sam");
        table.Rows.Add(6, "Paul");
        BarSeries lineSeria = new BarSeries();
        radChartView1.Series.Add(lineSeria);
        lineSeria.ValueMember = "Value";
        lineSeria.CategoryMember = "Name";
        lineSeria.DataSource = table;
    }
     
    private void radButton1_Click(object sender, EventArgs e)
    {
        this.radChartView1.DataSource = null;
        this.radChartView1.Series.Clear();
     
        foreach (DataRow row in table.Rows)
        {
            row["Value"] = (double)row["Value"] + 10;

    I hope this information helps. If you have any additional questions, please let me know. 

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Valery
    Valery avatar
    53 posts
    Member since:
    May 2011

    Posted 22 May 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    My question was not how to do it (I know how).

    During the data modification process, the radGridView is not updated, but radChartView constantly tries to update itself. As a result, everything works very slowly.
    Why two similar component behave differently when data source disconnected?

    Logic in such behavior, I do not see

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3451 posts

    Posted 22 May 2018 Link to this post

    Hello, Valery,    

    By default, you bind the series, not the whole chart. Thus, you set the BarSeries.DataSource property. The following help article is useful on this topic: https://docs.telerik.com/devtools/winforms/chartview/populating-with-data/binding-to-datatable

    When you set the DataSource property for the series to null, the chart will be automatically cleared. It is not supposed to be updated when the DataSource is modified because it is not connected to the series any more. I have attached my sample project for your reference. Am I missing something? Feel free to modify the project in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

    I am looking forward to your reply.

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Valery
    Valery avatar
    53 posts
    Member since:
    May 2011

    Posted 22 May 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    I connect the data source (table) not to the series, but to the radChartView. And I expect that if I disconnect the data source, the series will also automatically know about it.

    For example, if I'm working with a radGridView, then the columns of this radGridView know that the data is connected or disconnected.

    Why is it implemented in a radGridView by one logic, and in a radChartView by another logic?

  6. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3451 posts

    Posted 23 May 2018 Link to this post

    Hello, Valery,    

    RadChartView and RadGridView are different controls and they have completely different internal implementation. Indeed, in this case, the chart should be empty as well. I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

    I have also updated your Telerik points.

    Currently, the possible solution that I can suggest is to set the DataSource property to null for the series.

    I hope this information helps. If you have any additional questions, please let me know. 

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top