I have 2 series in my igDataChart. I would like to create a single template to support both but couldn't figure out how. I want the template to include the current series data point value. One of the series has "valueMemberPath: 'UNITS'". The other is "valueMemberPath: 'PEERS'". I had to create separate templates because I didn't know how to generically refer to the series value. I tried to replace "${item.UNITS}" and "${item.PEERS}" with ${series.valueMemberPath}, but that just put the name of valueMemberPath in the output, not the associated value. How can I combine what I want into a single template?
These are my current templates:
<script id="seriesUnitTemplate" type="text/x-jquery-tmpl"> <div> <span style="font-size: larger">${series.title}</span><br /> <span style="font-size: larger; color: ${actualSeriesBrush}">${item.UNITS}%</span><br /> <hr style="border-top: 1px solid lightgray !important; height: 1px !important; margin-top: 0px !important; margin-bottom: 0px !important" /> <span>${item.YEAR}</span><br /> </div></script>
<script id="seriesPeerTemplate" type="text/x-jquery-tmpl"> <div> <span style="font-size: larger">${series.title}</span><br /> <span style="font-size: larger; color: ${actualSeriesBrush}">${item.PEERS}%</span><br /> <hr style="border-top: 1px solid lightgray !important; height: 1px !important; margin-top: 0px !important; margin-bottom: 0px !important" /> <span>${item.YEAR}</span><br /> </div>
Hello Ray,
Unfortunately you cannot use the series.valueMemberPath to directly access an item. The workaround for it is the using of conditional check in order to get the current valueMemberPath and than to bind to it.
Feel free to let me know if I can help you with something in addition.
Best Regards,
Martin Evtimov
Thank you for your response. Unfortunately, what you are telling me is that what I would like to do is not possible via the template. I cannot use the series.valueMemberPath to directly access an item, such as item.xxxx, where xxxx is the value in series.valueMemberPath.
Thank you for contacting Infragistics Support!
You can refer to Infragistics Templating Engine to learn more about our templates features. I have prepared a sample for you, which is using conditional check in order to get the current valueMemberPath and then I’m binding the item’s property to it.
Let me know if I may be of further assistance.