Displaying multiple scenarios in a Decision
Optimization
Visualization view
Last updated: Apr 18, 2024
Displaying multiple scenarios in a Decision Optimization Visualization view
You can display more than one scenario on a page in the Visualizationview to compare and validate your model and
data.
About this task
Copy link to section
The following procedure shows you how to display two scenarios in the same
Visualizationview using a bar chart with the
Chart Widget Editor. An example
also follows that shows you how to display two scenarios in a Vega Chart bar
chart.
Procedure
Copy link to section
For example, to display bar charts for two scenarios in the Visualizationview:
Click Chart and configure it by clicking the pencil icon.
In the Chart Widget Editor, expand the Select scenario menu, and choose Scenario
1 (assuming that your current scenario is Scenario 2) so that you have
both scenario 1 and scenario 2 listed.
In the Table field, select the Solution data option and
select solution from the drop-down list.
In the bar chart pane, select Descending for the Category
order, Y-axis for the Bar type and click
OK to close the Chart Widget Editor. A second bar chart is then displayed
showing you the solution results for scenario 2.
Re-edit the chart and select @Scenario in the Split by field
of the Bar chart pane.
Results
Copy link to section
You then obtain both scenarios in the same bar chart:
You can select many different types of charts in the Chart Widget Editor.
Example
Copy link to section
To display bar charts for two scenarios using the Vega Chart widget, you
can similarly choose Solution
data > solution to display the same data, select
value, and name in both the x and y fields in the
Chart section of the Vega Chart Widget Editor. Then, in the Mark
section, select @Scenario for the color field. This selection
gives you the following bar chart with the two scenarios on the same y-axis, distinguished by
different colors.
If you re-edit the chart and select @Scenario for the column facet, you obtain the two scenarios
in separate charts side by side as follows:
You can use many different types of charts that are available in the Mark field
of the Vega Chart Widget Editor.
You can also select the JSON tab in all the widget editors and configure your charts by using the
JSON code. A more advanced example of JSON code is provided in the Vega Chart widgets in Decision Optimization experiments section.
About cookies on this siteOur websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising.For more information, please review your cookie preferences options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.