There are several articles describing how to get the underlying datarow but they use a for loop to compare the name/value pairs (which maybe misleading). Is there a solid way to get the columnname of the data clicked?
Hello,
You might be able to get the column and row labels like the following:
private void ultraChart1_ChartDataClicked(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs e) { string colLabel = e.ColumnLabel; string rowLabel = e.RowLabel; }
Please let me know if this is not what you are looking for.
Hi Danko
Unfortunately, no, that's not what I want. Consider the following select statement:
select MachineName, UserName, Count(0) as Total from Events group by MachineName,UserName
I bind the result of above statement to Ultrachart1. When I click, I want to know whether it was a "machinename" or "username". What I get with e.RowLabel and e.ColumnLabel is the "value" of that cell (e.g. "XP01" or "domain\username")
Could you please let me know what kind of data source you are using and what is the structure of it? If you could provide me more information regarding your scenario or even a small sample, I will be able to research this further and verify is there a way to achieve what you are looking for.
It's a plain dataset operation. Like this:
dim sqlConn as new SqlConnection("connection string to a database")dim sqlDa as new SqlDataAdapter("Select UserName, ComputerName, Count(*) from aTable Group by UserName, ComputerName", sqlConn)dim dt as new DataTablesqlDa.Fill(dt)
UltraChart1.DataSource=dt
I can provide you a sample solution but it just contains the above code in Form.Load.
After the chart is rendered, I want to know whether the clicked data was a "UserName" or "ComputerName" so that I can drill down using a different chart/dataset
Please let me know if you need more information
Hello Murat,
I am attaching a sample where you would be able to get the mapping to the current hierarchy of the data in the desired clicked event.
In order to get the column captions in the same event, I think that you would have to map them to the real values from the data table if you need to use them.
You could use this sample as a base pointer for what you are looking for.
Please let me know if you have any other questions.
Hello Danko
First, thank you very much for your commitment on this subject. As for the answer, the dataset does not change frequently, actually after I've filled the table, nothing happens until user change the criteria - which is fine for me.
I'd be glad if you create a sample.
Regards
Murat
Since there is nothing built in for what you are looking for, there might be a way to achieve it, but it would be not very easy to implement.
The approach would include creating a separate dataTable, that contains row and column labels for mapping the hierarchy from your real dataTable.
After that would have to create TreeMapSeries object that contains TreeMapDataPoints and add them to the series object.
I am not sure if you would like such approach, since you have that you are already aware of it, but if you do, I will create sample based on that, but this would require additional work if that data is freaquently changed.
Thank you for the provided information.
I will create a small sample based on your information and will update you once I have mode details about the requested behavior.