Compare different columns

2

Is it possible to generate the pie chart by comparing different columns of a DataTable ?

That is, I have a DataTable with 2 columns of values and wanted to create a pie chart for each line of DataTable , thus comparing the two values.

DataTable :

Descricao | Val1 | Val2
xxxxxxxx  | 9999 | 8888
yyyyyyyy  | 1111 | 2222

I'm using Microsoft Chart Control , which is native to .NET.

    
asked by anonymous 28.11.2014 / 18:39

1 answer

1

Yes, it does. DataTable of Microsoft has the facility to create objects of type DataView .

In other words, they are filters or "SELECTS" that you can do within a DataTable. You can create 2 DataView for each type of chart you want to create, and for each chart, you DataSouce of them for each DataView created.

The advantage is that if you add or modify information in the DataTable, this modification is automatically reflected in all existing DataViews and consequently in your charts (you may need to rebind, but nothing too compli- cated).

    
30.11.2014 / 16:16