Normal Topic Graphs (Read 7077 times)
cbislander
Full Member
***
Offline



Posts: 103
Joined: Mar 22nd, 2018
Graphs
May 24th, 2021 at 6:54pm
Print Post Print Post  
I am trying to add graphs to our Inventory and got it working by month for each year.  The problem is I can only do it once.  I can bring up a bar graph for one year, clear it. When I click on the other year, the graph doesn't appear, but the Prompt for User Input does.  I tried setting them at different locations, but that did not work.

2020

vChartNo = @StaticChart(CHART_TYPE_BAR, 470, 40, 300, 200,
MTOTAL, "Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec")

Ans = @PromptForUserInput("Clear chart?","Y")
If Ans = "Y" Then {StaticRemoveChart(vChartNo)
                       StaticDrawClear(LE7)}

2021

vChartNo1 = @StaticChart(CHART_TYPE_BAR, 470, 40, 300, 200,
MTOTAL, "Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec")

Ans = @PromptForUserInput("Clear chart?","Y")
If Ans = "Y" Then {StaticRemoveChart(vChartNo1)
                 StaticDrawClear(BAR CHART1)}
  

graph1.png ( 26 KB | 74 Downloads )
graph1.png
Back to top
 
IP Logged
 
cbislander
Full Member
***
Offline



Posts: 103
Joined: Mar 22nd, 2018
Re: Graphs
Reply #1 - May 24th, 2021 at 10:07pm
Print Post Print Post  
Here's what happens after I click on the other year.
  

20210524_190442.jpg ( 194 KB | 61 Downloads )
20210524_190442.jpg
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Graphs
Reply #2 - May 25th, 2021 at 2:01pm
Print Post Print Post  
Unless you are drawing other things, there is no need for the StaticDrawClear() calls. You may need to place a ForceRedraw() call after your StaticChart() call.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
cbislander
Full Member
***
Offline



Posts: 103
Joined: Mar 22nd, 2018
Re: Graphs
Reply #3 - May 25th, 2021 at 3:45pm
Print Post Print Post  
Hi Ray,

I think I got it working, but I will try the ForceRedraw.

One thing I noticed is the graph only has one range that can be labelled.  For example the X plane is Jan - Dec, but the Y plane cannot be labelled.  In a bar graph the tallest bar can be 10 or 1 so the graph appearance can be a little deceiving.  I have attached a picture to show what I am talking about.  I added a WriteLn pop-up so the information appears.
  

1814rep.png ( 11 KB | 65 Downloads )
1814rep.png
Back to top
 
IP Logged