I currently have a custom visual works works great, it currently displays a gauge based upon an input measure, who's fill can change colour based upon predefined limits.
Now the percentage is based upon an external number, 33, which is entered as text within the gauge definition. However, I would like this to be entered as a measure, since that way it can be driven by an external source (Sharepoint list for example).
However, I'm having great issues in my capabilities file of using more than a single measure. I understand that usually you have a category and several measures which relate to elements within the category (thinking of graphs etc).
I currently have my within my capabilities file the following data roles section:
"dataRoles": [
{
"displayName": "Value 1",
"name": "dataValue1",
"kind": "Measure"
},
{
"displayName": "Value 2",
"name": "dataValue2",
"kind": "Measure"
}
],
The data view mappings section is of that below:
"dataViewMappings": [
{
"conditions": [
{
"dataValue1": {
"max": 1
}
},
{
"dataValue2": {
"max": 1
}
}
],
"single": {
"role": ""
}
}
]
It compiles and seems to work, until you add a second measure, then weird things happen (yes I know not a technical explanation :) ) but I'll explain.
I also have a section which defines the colours and at what value the colours are used and whilst I can switch off the title etc with no issue, the custom section toggles quickly from being switched off to on again (so it stays the same value).
I know that this is something to do with the multiple measures that I'm trying to implement, since without them, it works flawlessly. Any help or if anyone has source code of a visual using multiple independent measures, I'd be most grateful.
Kind Regards.