Posted 2 September 2024, 10:15 am EST - Updated 2 September 2024, 10:20 am EST
Hi C1,
this is a rather complex one, so have a cup of coffee before reading ;-).
I try to implement a configurable FlexChart and FlexPie implementation in our dashboard. So, the datasource is a list of data rows, each row is a class that consists of an array of values. The source is e.g. a SQL select, but the underlying DataReader was closed and the data was copied to a container class that we use internally. So I cannot bind the DataReader to the chart, but I can bind the list of rows.
After digging through the C1FlexChart decompiled code, I found that my data row class can implement “ICustomTypeDescriptor”. Following the approach from https://keuperict.nl/posts/development/2017/09/26/icustomtypedescriptor-interface/, I can bind a field name of the sql statement to a column value in my row data array.
Great, problem solved for FlexChart!
But FlexPie works slightly different, and here my approach does not work.
The call to “ICustomTypeDescriptor” is done in method “DataUtils.GetValue(object obj, string propertyName)”:
FlexChart calls it here:
FlexPie just accesses a PropertyInfo object instead of using “DataUtils.GetValue(object obj, string propertyName)”:
I hope this can be easily added, and I hope it resolves my requirement.
If needed I can create a sample.
Best regards
Wolfgang