I would like to create treemaps dynamically using only one type of object which will represent the hierarchy.
My object looks like this:
public class Asset
{
public Asset Parent {get;set;}
public string Name {get;set;}
public int Type {get;set;}
public List<Asset> Children {get;set;}
public List<Property> Properties {get;set;}
}
public class Property
{
public string Name {get;set;}
public double Value {get;set;}
}
I have attached a drawing of a typical model that I will be binding to the treemap.
For this example I would like to create a treemap that will have Type Well as the leaf, size is "Oil Prod" and color is "WHP"
My questions are:
1: How can I do the mapping when all the types are the same (all asset) I want to specify at run time (through some config object) which asset is the leaf based on the asset type (Well) e.g asset.Type == "Well".
2: How can I map to a size or color value when it's in a list of properties e.g. size = asset.Properties.Where(p => p.Name == "Oil Prod").FirstOrDefault().
Thank you in advance for any help.
My object looks like this:
public class Asset
{
public Asset Parent {get;set;}
public string Name {get;set;}
public int Type {get;set;}
public List<Asset> Children {get;set;}
public List<Property> Properties {get;set;}
}
public class Property
{
public string Name {get;set;}
public double Value {get;set;}
}
I have attached a drawing of a typical model that I will be binding to the treemap.
For this example I would like to create a treemap that will have Type Well as the leaf, size is "Oil Prod" and color is "WHP"
My questions are:
1: How can I do the mapping when all the types are the same (all asset) I want to specify at run time (through some config object) which asset is the leaf based on the asset type (Well) e.g asset.Type == "Well".
2: How can I map to a size or color value when it's in a list of properties e.g. size = asset.Properties.Where(p => p.Name == "Oil Prod").FirstOrDefault().
Thank you in advance for any help.