2020 Jan 14 9:53 AM - edited 2024 Feb 03 5:52 PM
HI Experts,
I have created an SAC designer application. I have a scenario to hide the chart if the value is NULL. Is it possible to check the value of key figure and hide the full chart if there is no value to display? Can you please help with the syntax.
Request clarification before answering.
Hi,
The below code will work.
//Long Version, onresultchanged of chart
if(Chart_1.getDatasource().isResultEmpty())
{
Chart_1.setVisible(false);
}
else
{
Chart_1.setVisible(true);
}
//Short version, onresultchanged of chart
Chart_1.setVisible(!Chart_1.getDatasource().isResultEmpty());
- Sathya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Sathya, It worked 🙂
Hi all,
I'm trying to use the getData() function, but I'm clearly missing something. Could you tell me, in the function getData({"@MeasureDimension":"35535223-8334-4717-a487-324737206791"}) where does the "35535223-8334-4717-a487-324737206791" come from?
Thanks,
Katarzyna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also had a question on how to check value of a measure. Like I need to check the value of a measure 1, 2, 3 or 4 and hide a chart. I have a data source and on intialization I need to validate if the datasource measure value i need to setvisible or hidden.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohit,
you can apply Sathya suggestion. I can give you second suggestion apply which suits your requirements in a better way.
it's easy if you can read the measure value from Numeric charts as well.
Measure id you will get from console.log(chart.getDataSource().getMeasures());
var i =ConvertUtils.stringToNumber(chart.getDataSource().getData({"@MeasureDimension":"35535223-8334-4717-a487-324737206791"}).formattedValue));
not i is the measure value in numeric. Based on the value of i you can write logic of set visibility.
Regards,
Sanjay Guha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
24 | |
22 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.