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

Non-standard behavior RadChartView

5 Answers 16 Views
This is a migrated thread and some comments may be shown as answers.
Valery
Top achievements
Rank 1
Veteran
Valery asked on 21 May 2018, 12:10 PM

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



 

 


5 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 May 2018, 09:36 AM
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.
0
Valery
Top achievements
Rank 1
Veteran
answered on 22 May 2018, 10:07 AM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 May 2018, 10:33 AM
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.
0
Valery
Top achievements
Rank 1
Veteran
answered on 22 May 2018, 11:33 AM

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?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 May 2018, 10:25 AM
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.
Asked by
Valery
Top achievements
Rank 1
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Valery
Top achievements
Rank 1
Veteran
Share this question
or