cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

I am really stuck and i didn't find anything helpful, 

I want to show measure and dimension on click event through button through scripting in sac story.

my model name is "account" my measure name is "net_sales" my dimension type is account. appearantly there is no error in it. but i am not getting anything when click on button 

 

 


// Chart_1.getDataSource().setDimensionFilter("Account", ["Revenue"]);

// Chart_1.getDataSource().setMemberDisplayMode(Feed.CategoryAxis,"net_sales");

Chart_1.addDimension("account",Feed.CategoryAxis2);

// Chart_1.addDimension("account",Feed.CategoryAxis2);
console.log(['dimension',Chart_1.addDimension("Revenue",Feed.CategoryAxis2)]);

Chart_1.addMeasure("[account].[parentId].&[A100000]",Feed.ValueAxis);
console.log(['measure',Chart_1.addMeasure("[account].[parentId].&[A200100]",Feed.ValueAxis)]);

 

// Chart_1.addMeasure("[account].[parentId].&[A200100]",Feed.ValueAxis);

 

0 Likes
View Entire Topic
RajuRam
Active Participant
0 Likes

Please try the below. 

// Clear previous chart data

Chart_1.removeDimensions();
Chart_1.removeMeasures();

Chart_1.addDimension("account", Feed.CategoryAxis);

// Optional: filter the dimension to a specific member
// Uncomment the next line if you want to show only "Revenue"
// Chart_1.getDataSource().setDimensionFilter("account", ["Revenue"]);

// Add the measure to Y-axis
Chart_1.addMeasure("net_sales", Feed.ValueAxis);

// Refresh the chart to apply changes
Chart_1.update();