c# - Complex (?) LineSeries itemsource object -
i trying instantiate multiple line series using same itemsource object defining adifferent datafieldy each lineseries object.
i've got working @ first when had , object multiple properties like
class simple { double time; double value1; double value2; } that way set datafieldy in 1 graph datafieldy="value1" example. comes problem, class different since comes mongo database. looks this:
class complex { double timestamp; backward b; forward f; } class backward { double backvalue; } class forward { double forwardvalue; } there other variables of course , hierarchy runs 1 level deeper. should work example.
what string need add @ datafieldy considering itemsource equals observablecollection<complex>?
also there way, maybe using reflection, me initialize line series using foreach loop?
foreach(var s in magic(complex)) { var ln = new lineseries() ln.itemsource = complexcollection ln.datafieldt = s; } maybe trying in wrong way :)
cheers
turn b , f public properties:
class complex { ... public backward b { get; set; } public forward f { get; set; } } you should able specify nested property path, e.g.:
datafieldy = "b.backvalue";
Comments
Post a Comment