0
votes

I want my bar chart to start with value other than 0.

I already set up variable value as 2 and my service from process modeling library will update variable value overtime.

Every time I play the simulation, the bar chart always start at 0 value not start at 2 value

I am still new to AnyLogic. I've tried google for days, but I couldn't find the answer or tutorial I'm looking for.

Here is my code in process modeling onExit:

nValue++;

double i = nValue;

barChart.add(i);

What I want is

Bar chart currently shows 0 (Start value) to 2 (Value I set).

I expect Bar chart to start at 2 (Value I set) to nValue (Value updated overtime)

Thank you for your time

1
Am I correct that you want the scale to only show 2......n ?Florian
Yes. You are correct.kim
Unfortunately not possible, see my answer below...Florian
in fact it is possible, but you have to generate your own barChart using shapes... It would be quite more complicated... I didn't understand the question the first time :(Felipe
@Felipe Is there any tutorial or guide that I can follow?kim

1 Answers

0
votes

I assume you want something like this (this is just a photoshopped version of your screenshot):

Bar Chart Mockup

You can set a fixed scale in AnyLogic here:

Bar Chart Properties

However it seems that it is not possible to not include a 0 value inside the scale, your setting of 2 - something (let's use 100 here), brings the following error:

java.lang.RuntimeException: root:
The interval [minimum,maximum] must contain 0

I am not sure if this is a bug or some technical limitation. But in short: What you are trying to do doesn't work.