I am trying to reproduce this sample http://www.igniteui.com/data-chart/polar-series but my data has a different structure. I have to do something like:
series: [{ name: "series1", type: seriesType, angleAxis: "angleAxis", radiusAxis: "radiusAxis", angleMemberPath: "measure.angle", radiusMemberPath: "measure.radius" }]
where my data source is a collection of objects which have a measure property. Currently this property is an object with two properties - angle and radius, but I might need to use it as an array, too. So 'measure.angle' would become 'measure[0]' and 'measure.radius' - ''measure[1]'. I have tried both scenarios and none of them worked, while having angle and radius as top-level properties works but is not an option in my case. Is there a way to set these binding properties to nested values?
Hello Tencho,
Thank you for contacting Infragistics Support!
We are currently looking into this matter and will keep you posted of any available information.Please do not hesitate to contact us with any updates or additional questions regarding this scenario in the meantime.
In order to use value from an object you would want to use coercionMethods. For example:
Data:
var data = [ { "Date": "2013-07-16", "Time": "10:00", "Wind": { "Speed": 3.305, "Direction": 141 }, id: 0 }, { "Date": "2013-07-16", "Time": "11:00", "Wind": { "Speed": 5.832, "Direction": 181 }, id: 1 },
Series:
series: [{ name: "series1", type: seriesType, angleAxis: "angleAxis", radiusAxis: "radiusAxis", angleMemberPath: "Wind!Wind_Direction", radiusMemberPath: "Wind!Wind_Speed", coercionMethods: { Wind_Direction: function(val) { return val.Direction; }, Wind_Speed: function(val) { return val.Speed; } }}],
Notice the syntax of member path string, which is split in two parts. The first one is the property of the object ("Wind"), the second part is the method which will be used for correction("Wind_Direction"). However in this scenario the second method ("Wind_Speed") will never be called. This is due to the fact that the implementation uses dictionary to keep reference to coercionMethods and the key in that dictionary is the property name. In this case it is ‘Wind’ and the second method is ignored. So it seems you cannot reflect more than one property from arbitrary object in datasource.
I cannot say at the moment if this was a design decision back in time or is some kind of limitation. I suggest that you test the coercionMethods and see if such approach will work for you. If you do need to get a value for both angleMemberPath and radiusMemberPath from the same object, please let us know and we will figure out how to proceed with this.
Hello,
I'm just following up to see if you need any further assistance with this issue. If so please let me know.