Recent

Author Topic: proper xaxis application  (Read 8300 times)

frederic

  • Full Member
  • ***
  • Posts: 226
Re: proper xaxis application
« Reply #15 on: August 18, 2015, 04:19:07 pm »
Quote
Coming back to your program: Did you follow the input with the unitialized  FdubDTTime[0]? This originates in the line "for n:=1 to Ffutmaxbars do ..." of Tstdchartfrm.SetGraphXaxisArray22 where n := 0 is not used.

Moreover, there is another missing assignment for the index 0 in TForm1.makeXaxarray. Here "mm" is set to 0, and later incremented by 1 ("mmm:=mmm+1") before a value is assigned to "FDTXAxarr1[mmm]", i.e. FDTXAxarr1[0] is never touched. And in the before-mentioned SetGraphXaxisArray22 this array serves as the source for FdubDTTime.


I had discovered this also and corrected it.The testproject must be completely in line with the application i am developing .It could easily be that these issues may be the reason for the strange errors i got there.I must check that first and otherwise rewrite  the test project.

with regard to the very special requirements i have an idea.
In the way you normally would set up an x-axis it is likely very compllicated.

But you already showed a way to come around it by having an overlap and a delta calculation procedure(see your code in the former thread).

I am thinking of extending the use of the xaxisarrays in my setXaxisarray procedure.There  we could prepare label arrays for Timechartsource and Datechartsource per  "nice step".This done once per session.
We know which labels we want and  and where they need to be located.
Irregular opening times  are now  taken already care of , because the arrays are based on the real minutes.
The total theoretical  pixel length of of all the labels together can be calculated .Together with the current extent of the chart we can calculate  max number of minutes( xaxisarrays are minutes)  per "nice step ",which are allowed to be shown on the xaxis .( datelabels are to be based on the smallest day in the arrays)

ps instead of having separate arrays may be you can have Timechartsource1,Timechartsource2,...etc,. I don't know what is easier.


This could also be a general approach like with histograms were you can have arbitrary text per bar( i don't know how  that is done in lazarus)


But for the moment leave it,because i cannot react in the coming days and i will check my program first

frederic







« Last Edit: August 19, 2015, 10:15:15 am by frederic »

frederic

  • Full Member
  • ***
  • Posts: 226
Re: proper xaxis application
« Reply #16 on: September 04, 2015, 10:26:15 pm »
wp

i checked my application and some weird hussling with arrayhandling was  the reason for the strange errors.
I stopped it and worked out the idea i mentioned in my former thread .

Although very simple coded by a dummie  i wrote a testproject  but  it worked  okay.

When you are interested i can send it here

frederic

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: proper xaxis application
« Reply #17 on: September 05, 2015, 12:48:07 am »
When you are interested i can send it here
Yes please

frederic

  • Full Member
  • ***
  • Posts: 226
Re: proper xaxis application
« Reply #18 on: September 05, 2015, 01:07:31 pm »
wp

the testproject is attached

just before sending i saw that the turn off of the markation lines did not function as i intended

frederic

 

TinyPortal © 2005-2018