bar chart

Post Reply
Joel
Posts: 58
Joined: Fri Jan 15, 2016 1:36 pm
My devices: miniipad
Flag: Germany

bar chart

Post by Joel » Thu Jan 05, 2017 4:41 pm

Hi there,

made a simple bar chart thing to display values with their description. values and description are passed by arrays.

included a testing-program. just remove the commentary signs around TEST-BEGIN and TEST-END.

Code: Select all

'b'
/*
'*******TEST-BEGIN*******

'/Bibliothek/maths
INPUT test
ON test GOSUB test1
END
test1:
 OPTION BASE 1
 INPUT num_bars
 DIM legend$(num_bars)
 DIM values(num_bars)
 FOR n= 1 TO num_bars
  legend$(n)=str_rnd$(i_rnd(10,15))
  values(n)=r_rnd(0,1)
 NEXT n
 'PAUSE 2
 GRAPHICS
 GRAPHICS CLEAR 1,1,1
 
 
 bar_chart(legend$,values,10,10,SCREEN_WIDTH()*.4,SCREEN_HEIGHT()*.8)
 PAUSE 1
 bar_chart.complete_bar=1
 bar_chart(legend$,values,10,10,SCREEN_WIDTH()*.4,SCREEN_HEIGHT()*.8)
 PAUSE 1
 bar_chart.framed=1
 bar_chart(legend$,values,10,10,SCREEN_WIDTH()*.4,SCREEN_HEIGHT()*.8)
 PAUSE 1
 GRAPHICS CLEAR 1,1,1
 FOR n=1 TO num_bars-1 STEP 5
  bar_chart2(legend$,values,10,10,SCREEN_WIDTH()*.4,SCREEN_HEIGHT()*.8,n,n+4)
  PAUSE 1
  GRAPHICS CLEAR 1,1,1
 NEXT n
RETURN 'of test1


'********TEST-END********
*/

'c'
DEF bar_chart(legend$(),values(),pos_x,pos_y,width,height) 'array$(index,1:name of category, 2: value [0...1]
 'legend$():array that contains the legend / description of each bar
 'values():array that contains the corresponding values(range:[0...1]) of each bar.
 'pos_x,pos_y upper left position of diagram, width, height selfexplanatory
 'complete_bar=1 'completes the bar to 100% with red colour
 'fraimed: 'draws a rectangle around the bars
 
 GET DIM legend$ XSIZE num_legends
 GET DIM values XSIZE num_values
 IF num_values<>num_legends THEN RETURN -1
 num_bars=num_values
 
 OPTION SORT DESCENDING
 SORT values AS ordered_values
 '***VARIABLES***
 category_fontsize=25 'fontsize legende
 category_font$="Avenir-Book" 'fontname of legende
 v_dist_bar=bar_height*0.25 'gab between bars
 h_dist_bar=width*0.01 'gab before bar
 rel_dist_bar=.25 'relation dist/bar -> v_dist_bar=bar_height*rel_dist_bar 
 FILL COLOR 0,1,0
 DRAW COLOR 0,0,0
 IF framed=1 THEN DRAW RECT pos_x,pos_y TO pos_x+width+10,pos_y+height
 'height=num_bars*bar_height+num_bars*v_dist_bar distance between bars + 2*1/2 on both end 
 
 bar_height=height/((1+rel_dist_bar)*num_bars) 'height of each bar
 v_dist_bar=bar_height*rel_dist_bar 'distance between each bar, 1/2 distance at both ends

 'width=max_text_length+max_bar_length
 'calculating max_length of text
 DRAW FONT SIZE category_fontsize
 DRAW FONT NAME category_font$
 'checking text_height
 IF TEXT_HEIGHT("asdfghj") > bar_height THEN
  FOR n=category_fontsize TO 0 STEP -.1
   DRAW FONT SIZE n
   IF TEXT_HEIGHT("asdfghj") < bar_height THEN BREAK
  NEXT n 
 ENDIF
 max_text_length=0
 FOR n= 1 TO num_bars
  IF TEXT_WIDTH(legend$(n))>max_text_length THEN max_text_length=TEXT_WIDTH(legend$(n))
 NEXT n
 
 
 'calculationg bars
 max_bar_length = width-max_text_length-h_dist_bar 
 pos_x_bar=x+max_text_length+h_dist_bar 'upper left position of bars
 p_x=pos_x+max_text_length+h_dist_bar 
 
 IF complete_bar THEN
  FILL COLOR 1,0,0
  n=0
  FOR p_y= pos_y+v_dist_bar/2 TO pos_y+height STEP bar_height+v_dist_bar 'more or less 
   n+=1
   FILL RECT p_x+max_bar_length*values(Ordered_values(N)),p_y TO p_x+max_bar_length,p_y+bar_height 
  NEXT p_y
 ENDIF
 
 
 'drawing bars
 FILL COLOR 0,1,0
 n=0
 FOR p_y= pos_y+v_dist_bar/2 TO pos_y+height STEP bar_height+v_dist_bar 'more or less 
  n+=1
  FILL RECT p_x,p_y TO p_x+max_bar_length*values(Ordered_values(N)),p_y+bar_height 
  percentage$=STR$(INT(values(ordered_values(n))*100))&"%"
  IF p_x+max_bar_length*values(Ordered_values(N))-TEXT_WIDTH(percentage$)>p_x THEN
   DRAW TEXT percentage$  AT p_x+max_bar_length*values(Ordered_values(N))-TEXT_WIDTH(percentage$),p_y 
  ELSE
   DRAW TEXT percentage$  AT p_x,p_y 
  ENDIF 
  DRAW TEXT legend$(Ordered_values(N)) AT p_x-TEXT_WIDTH(legend$(Ordered_values(N)))-h_dist_bar,p_y+bar_height/2-TEXT_HEIGHT(legend$(Ordered_values(N)))/2
 NEXT p_y  
END DEF
'**************************
'**************************
DEF bar_chart2(legend$(),values(),pos_x,pos_y,width,height,data1,data2) 'array$(index,1:name of category, 2: value [0...1]
 'same as above
 'plus: 
 'data1: the first datum to be displayed
 'data2: the last datum to be displayed
 IF framed THEN DRAW RECT pos_x,pos_y TO pos_x+width+10,pos_y+height
 GET DIM legend$ XSIZE num_legends
 GET DIM values XSIZE num_values
 IF num_values<>num_legends THEN RETURN -1
 IF data2>num_values THEN data2=num_values
 IF data1>data2 THEN RETURN -1
 num_bars=data2-data1+1
 
 OPTION SORT DESCENDING
 SORT values AS ordered_values
 '***VARIABLES***
 category_fontsize=25 'fontsize legende
 category_font$="Avenir-Book" 'fontname of legende
 v_dist_bar=bar_height*0.25 'gab between bars
 h_dist_bar=width*0.01 'gab before bar
 rel_dist_bar=.25 'relation dist/bar -> v_dist_bar=bar_height*rel_dist_bar 
 FILL COLOR 0,1,0
 DRAW COLOR 0,0,0
 'height=num_bars*bar_height+num_bars*v_dist_bar distance between bars + 2*1/2 on both end 
 
 bar_height=height/((1+rel_dist_bar)*num_bars) 'height of each bar
 v_dist_bar=bar_height*rel_dist_bar 'distance between each bar, 1/2 distance at both ends

 'width=max_text_length+max_bar_length
 'calculating max_length of text
 DRAW FONT SIZE category_fontsize
 DRAW FONT NAME category_font$
 'checking text_height
 IF TEXT_HEIGHT("asdfghj") > bar_height THEN
  FOR n=category_fontsize TO 0 STEP -.1
   DRAW FONT SIZE n
   IF TEXT_HEIGHT("asdfghj") < bar_height THEN BREAK
  NEXT n 
 ENDIF
 max_text_length=0
 FOR n= 1 TO num_bars
  IF TEXT_WIDTH(legend$(n))>max_text_length THEN max_text_length=TEXT_WIDTH(legend$(n))
 NEXT n
 
 'calculationg bars
 max_bar_length = width-max_text_length-h_dist_bar 
 pos_x_bar=x+max_text_length+h_dist_bar 'upper left position of bars
 p_x=pos_x+max_text_length+h_dist_bar 
 
 IF complete_bar THEN
  FILL COLOR 1,0,0
  n=data1-1
  FOR p_y= pos_y+v_dist_bar/2 TO pos_y+height STEP bar_height+v_dist_bar 'more or less 
   n+=1
   FILL RECT p_x+max_bar_length*values(Ordered_values(N)),p_y TO p_x+max_bar_length,p_y+bar_height 
   IF n=data2 THEN BREAK  
  NEXT p_y
 ENDIF
 
 
 'drawing bars
 FILL COLOR 0,1,0
 n=data1-1
 FOR p_y= pos_y+v_dist_bar/2 TO pos_y+height STEP bar_height+v_dist_bar 'more or less 
  n+=1
  FILL RECT p_x,p_y TO p_x+max_bar_length*values(Ordered_values(N)),p_y+bar_height 
  percentage$=STR$(INT(values(ordered_values(n))*100))&"%"
  IF p_x+max_bar_length*values(Ordered_values(N))-TEXT_WIDTH(percentage$)>p_x THEN
   DRAW TEXT percentage$  AT p_x+max_bar_length*values(Ordered_values(N))-TEXT_WIDTH(percentage$),p_y 
  ELSE
   DRAW TEXT percentage$  AT p_x,p_y 
  ENDIF 
  DRAW TEXT legend$(Ordered_values(N)) AT p_x-TEXT_WIDTH(legend$(Ordered_values(N)))-h_dist_bar,p_y+bar_height/2-TEXT_HEIGHT(legend$(Ordered_values(N)))/2
  IF n=data2 THEN BREAK 
 NEXT p_y
END DEF
''

'excerpt from maths-library
DEF str_rnd$(L)
 letter$=""
 FOR n=1 TO l
  letter$= letter$&CHR$(i_rnd(ASC("a"),ASC("z")))
 NEXT n
 RETURN letter$
END DEF

DEF i_rnd(a,b) 'returns random integer between two given numbers [a,b]
 i_rnd=FLOOR((b+1-a) *RND(1)+a)
END DEF

DEF  r_rnd(a,b) 'returns random real number between two given real numbers (a,b) 
 r_rnd=(b-a)*RND(1)+a
END DEF

Joel
Posts: 58
Joined: Fri Jan 15, 2016 1:36 pm
My devices: miniipad
Flag: Germany

Re: bar chart

Post by Joel » Fri Jan 20, 2017 7:36 pm

Needed kinda dash-board-bar-chart ;-)
Put the code here and hope you will enjoy it.

Code: Select all



GOSUB test
END

test:
 DIM values(10)
 DIM legend$(10)
 OPTION TEXT POS CENTRAL
 s=SCREEN_WIDTH()+SCREEN_HEIGHT()*1i
 GRAPHICS ! GRAPHICS CLEAR .2,.2,.2
 
 'first bar chart
 GOSUB fill_values 'get some data
 GOSUB fill_legend 'get some legend
 
 position=.24*s
 width_of_chart=550
 
 'draw bar
 bar_c(position,width_of_chart,values,legend$)
 
 'second bar chart
 GOSUB fill_values
 GOSUB fill_legend
 
 'change settings
 bar_c.traff_lght=0 'no red, amber, green this time. just one color
 bar_c.same_col=1 'all LEDs have same color
 bar_c(.1*s,100,values,legend$)
 
 'third bar chart
 GOSUB fill_values
 GOSUB fill_legend
 bar_c.traff_lght=1 ! bar_c.same_col=1 ! bar_c.num_leds=30 'red,amber,green - all LEDs same color, 30 LEDs this time
 bar_c(.7*s,200,values,legend$)
 
 GOTO jump_return
 fill_values: 'sub
  FOR index=1 TO 5
   values(index)=r_rnd(0,1)
  NEXT index
 RETURN 'of for_run
 
 fill_legend:
  FOR index=1 TO 5
   legend$(index)=str_rnd$(i_rnd(5,12))
  NEXT index
  
 RETURN 'of fill legend

jump_return:
RETURN 'of test

'c'

DEF bar_c(c_pos,w_frame,values(),legend$())
'' 
'displays a bar-chart based on values()-array with values from 0...1 - and legend$()
'c_pos:position on screen, passed as complex number
'w_frame: width of chart. other measures are deduced
'values():numeric array with values [0,1] for each bar
'legend$():string array with text for each bar. text size will be adapted for each bar chart.
'r'
 IF NOT called THEN 'default setting - can be changed from outside the fctn(e.g. bar_c.draw_frame=0 ecc.)
  draw_frame=1 'draws rectangle around that thing
  ups_down=0 'draws whole thing upside-down
  traff_lght=1 'LEDs have three colours given in "colour-definition"
  same_col=0 ' all LEDs have same colour
  
   'colour definition
  color_led_condition1$="0,0.850,0" 'green  0,0.938,0
  color_led_condition2$="1,1,0.315" 'yellow  0.742,1,0
  color_led_condition3$="0.939,0,0" 'red
  
  color_led_off$="0.2,0.2,0.2" 'dark
  color_led_on$="0.742,1,0" 'yellow
  
  color_frame$=".1,0.1,0.1" 'grey
  color_frame_line$="1,0,0" 'red
  color_legend$="1,1,1" 'colour of legend
 ENDIF ' not called 
   
 'frame
 aspect_ratio=(1+SQR(5))/2 'golden ratio
 h_frame=w_frame/aspect_ratio 'height of whole bar chart
 h_barset=h_frame/4*3 '0...h_frame: height of bars
   
 'LEDS can be changed from outside the function
 IF NOT called THEN
  num_leds=09 'number of LED per column/bar
  called = 1
 END IF
 
 h_led_factor=.5 '0...1 height of LED
 w_led=w_frame/8 '6... :width of LED
 
 'bloody rest
 num_bars=5 '2... number of bars, columns...actually designed for 5 bars
 w_barset=w_frame/4*3 '0...(w_framewidth-w_led): of all bars from ctr to ctr
 header_footer_balance=.5 '0...1 balance between height of HEADER AND footer 
 
 
'c' 
 'not ment to be changed
 h_led=h_barset/num_leds*h_led_factor 'height of led, to be changed with h_led_factor
 w_margin=(w_frame-w_barset)/2 '2: margin at both sides. not supposed to be changed
 h_header=(h_frame-h_barset)*header_footer_balance 'upper distance from frame to barset
 h_footer=h_frame-h_header-h_barset ' distance from frame-bottom to barset
 h_ctr_led=h_barset/num_leds/2 'y_center of (upper) LED from h_header
 legend_space=w_barset/(num_bars-1) 'if text is always on the same height  not alternating
   
  pos_x=REAL(c_pos) ! pos_y=IMAG(c_pos)
  
 'defining colours of bars and position of the legend
 IF ups_down THEN 'bars used in upside-down mode?
  color_led$(4)=color_led_condition3$ 'red
  color_led$(3)=color_led_condition2$ 'amber
  color_led$(2)=color_led_condition1$ 'green
  color_led$(5)=color_led_off$ 'dark
  legendpos_y=pos_y+h_header/2
  IF NOT traff_lght THEN 'no traffic light mode then use theses colours
   color_led$(1)=color_led_on$'yellow
   'color_led$(5)=color_led_off$ 'dark
  ENDIF 
 ELSE 'ups_down=0
  color_led$(2)=color_led_condition3$  'red
  color_led$(3)=color_led_condition2$ 'amber
  color_led$(4)=color_led_condition1$ 'green
  color_led$(1)=color_led_off$ 'dark
  legendpos_y=pos_y+h_frame-h_header/2
  IF NOT traff_lght THEN 
   color_led$(5)=color_led_on$ 'yellow
   'color_led$(1)=color_led_off$ 'dark
  ENDIF 'NOT traff_lght
 ENDIF 'ups_down? 
 
 fill_color(color_frame$)
 FILL RECT pos_x , pos_y TO pos_x+w_frame,pos_y+h_frame
 
 IF draw_frame THEN 
  DRAW COLOR insepstr$(1,color_frame_line$,","),insepstr$(2,color_frame_line$,","),insepstr$(3,color_frame_line$,",") 
  DRAW RECT pos_x , pos_y TO pos_x+w_frame,pos_y+h_frame 'DRAW FRAME  
 ENDIF 'draw_frame?
 
 'pass value to "column_value" ups_down / NOT ups_down
 FOR col_led= 1 TO num_bars
  col_value=values(col_led)
  IF ups_down THEN 
   column_value=col_value
   threshold=CEIL(num_leds*column_value) 'used in "set LEDs" transition between LED: on and off
  ELSE '=0
   column_value=1-col_value
   threshold=FLOOR(num_leds*column_value) 
  ENDIF
  
  'set LEDs (ups_down:off, NOT ups_down:on)
  IF NOT traff_lght OR NOT ups_down THEN FILL_COLOR(color_led$(1)) 
  FOR row_led=1 TO threshold 'CEIL(num_leds*column_value)
   IF NOT same_col AND ups_down THEN FILL_COLOR(color_led$(FLOOR(row_led/num_leds/.34)+2)) 'traffic-lght-color(value)
   IF traff_lght AND ups_down AND same_col THEN FILL_COLOR (color_led$(FLOOR(column_value/.34)+2)) 'all-same-color(value) 
    ctr_x_led=divide(pos_x+w_margin,w_barset,num_bars-1,col_led-1) 'ceter-position of LED
    ctr_y_led=divide(pos_y+h_footer,h_barset, num_leds,row_led-1)+h_ctr_led
   FILL RECT ctr_x_led,ctr_y_led SIZE w_led/2, h_led/2 'draw LED
  NEXT row_led
   
  'set LEDs (ups_down:on, NOT ups_down:off)
  IF NOT traff_lght OR ups_down THEN FILL_COLOR (color_led$(5))
  IF FLOOR(num_leds*column_value)+1<=num_leds THEN 
   FOR row_led=threshold+1 TO num_leds
    IF NOT same_col AND NOT ups_down THEN FILL_COLOR (color_led$(FLOOR(row_led/num_leds/.34)+2))
    IF traff_lght AND NOT ups_down AND same_col THEN FILL_COLOR (color_led$(FLOOR(column_value/.3333)+2)) 
    ctr_x_led=divide(pos_x+w_margin,w_barset,num_bars-1,col_led-1)
    ctr_y_led=divide(pos_y+h_footer,h_barset, num_leds,row_led-1)+h_ctr_led
    FILL RECT ctr_x_led,ctr_y_led SIZE w_led/2, h_led/2
   NEXT row_led
  END IF 
 NEXT col_led  
 restore_fontsize=FONT_SIZE() 
 
 'find font size that fits for the longest word
 counter=0
 FOR FONTsize=40 TO 0 STEP -1
  FOR index= 1 TO num_bars
   DRAW FONT SIZE FONTsize ! IF TEXT_WIDTH(legend$(index))<legend_space THEN counter+=1
  NEXT index
   IF  counter=num_bars THEN BREAK
   counter=0
 NEXT FONTsize 
 
 'put legend under bar
 DRAW_COLOR(color_legend$) 
 FOR col_led = 1 TO num_bars
  legendpos_x=divide(pos_x+w_margin,w_barset,num_bars-1,col_led-1)
  DRAW TEXT legend$(col_led) AT legendpos_x,legendpos_y
 NEXT col_led

'b'
 'c'
DRAW FONT SIZE restore_fontsize 'restores font size
 
END DEF 'of bar_c
'==========
DEF draw_color(color_string$)
 DRAW COLOR insepstr$(1,color_string$,","),insepstr$(2,color_string$,","),insepstr$(3,color_string$,",")
END DEF
'==========
DEF fill_color(color_string$)
 FILL COLOR insepstr$(1,color_string$,","),insepstr$(2,color_string$,","),insepstr$(3,color_string$,",")
END DEF
'==========

'r'
'================utilities=maths=========
''

DEF i_rnd(a,b) 'returns random integer between two given numbers [a,b]
 i_rnd=FLOOR((b+1-a) *RND(1)+a)
END DEF
'==========
DEF  r_rnd(a,b) 'returns random real number between two given real numbers (a,b) 
 r_rnd=(b-a)*RND(1)+a
END DEF
'==========
DEF str_rnd$(L)
 letter$=""
 FOR n=1 TO l
  letter$= letter$&CHR$(i_rnd(ASC("a"),ASC("z")))
 NEXT n
 RETURN letter$
END DEF
'==========
DEF insepstr$(section,s1$,S2$)
 IF MAX(LEN(s1$),LEN(s2$))=LEN(s1$) THEN 's1 the longest?
  separator$=s2$ ! string$=s1$ 'shortest is separator
 ELSE
  string$=s2$ ! separator$=s1$
 ENDIF
  
 IF string$="" THEN RETURN "ERROR" '-1 problematisch bei der auswertung. Stoppzeichen definieren und übergeben?
 'insepstr$(2,",","123,4567,890") -> 4567
 option_base_=OPTION_BASE()
 OPTION BASE 1
 length=LEN(string$)
 IF INSTR(string$,separator$,1)=-1 AND section=1 THEN 
  OPTION BASE option_base_
  RETURN string$ '-1 'trennzeichen nicht vorhanden
 ENDIF
 pos2=0
 FOR n= 1 TO section
  pos1=pos2+1 
  IF pos1<=LEN(string$) THEN 
   pos2=INSTR(string$,separator$,pos1) 
  ELSE 
   OPTION BASE option_base_  
   RETURN "ERROR" '-1
  ENDIF
  IF pos2 = -1 THEN BREAK 'letztes komma fehlt
 NEXT n
  IF n=section AND pos1<=length THEN pos2=length+1 'letzte komma fehlt
  IF n<section THEN 
   OPTION BASE option_base_
   RETURN "ERROR" '-1 'weniger sections als erwartet
  ENDIF 
  '(n=section und noch zeichen übrig: letztes komma fehlt, sonst zuwenig sections
  result$=MID$(string$,pos1,pos2-pos1)
  OPTION BASE option_base_ 
  RETURN result$
 
END DEF
'==========
DEF divide(anchor,length,num_section,n)
 length_section=length/num_section
 divide= length_section*n+anchor 
END DEF
'==========
DEF save_graphic_params
 IF NOT called THEN called=1
 GRAPHICS SAVE 0,0, 150,150 TO "save_graphic_params" 'need a small corner to check something out...so save that corner
 'function checks and saves the folowing settings:
 'draw color d_r,d_g,d_b,d_a
 'fill color f_r,f_g,f_b,f_a
 'draw size d_s
 'font size f_s
 'option text pos normal text_pos_normal
 
 scr=SCREEN_SCALE() 'Retina:2
 
 'check draw color
 DRAW LINE 0,0 TO 1,1
 GET PIXEL 0,0 COLOR d_r,d_g,d_b, d_A
 
 
 'check fill color
 FILL RECT 0,0 TO 1,1
 GET PIXEL 0,0 COLOR f_r,f_g,f_b,f_a
 
 'check draw size
 'DRAW SIZE 6
 FILL COLOR 1,1,1 'white for background
 FILL RECT 0,0 TO 50,50
 
 DRAW COLOR 0,0,0 'black for drawing
 DRAW LINE 0,0 TO 0,1
 
 FOR d_s=0 TO 50
  GET PIXEL x,0 COLOR c_r,c_g,c_b,c_a
  IF c_r=1 THEN BREAK
 NEXT d_s
 'PRINT d_s/SCREEN_SCALE()*2  
 
 'DRAW FONT SIZE 15
 f_s = FONT_SIZE()
 'PRINT f_s
 
 
 'check text_pos
 'GRAPHICS
 'OPTION TEXT POS CENTRAL
 DRAW FONT SIZE 15
 FILL RECT 0,0 TO 120,120
 teststr$=CHR$(124)&"                  "
 DRAW TEXT teststr$ AT 0,0
 FOR y_pos=0 TO TEXT_HEIGHT("T")*scr
  FOR x_pos=0 TO 50*scr
   GET PIXEL x_pos,y_pos COLOR r,g,b,a
   IF r=0 THEN BREAK  
  NEXT x_pos
   IF r=0 THEN BREAK
 NEXT y_pos
 
 'PRINT "check_text_pos", x_pos,y_pos,TEXT_HEIGHT("T")
 IF x_pos=50*scr+1 AND y_pos=TEXT_HEIGHT("T")*scr+1 THEN text_pos_normal=0 ELSE text_pos_normal=1
 'PRINT "text_pos_normal:=", text_pos_normal
 
 'RESTORE changed settings:draw color / fill color / font size
 DRAW FONT SIZE f_s
 DRAW COLOR d_r,d_g,d_b ! DRAW ALPHA d_a
 FILL COLOR f_r,f_g,f_b ! FILL ALPHA f_a
 DRAW IMAGE "save_graphic_params" AT 0,0
END DEF
'==========
DEF restore_graphic_params
 'restores the settings saved by save_graphic_params:
 'draw color d_r,d_g,d_b,d_a
 'fill color f_r,f_g,f_b,f_a
 'draw size d_s
 'font size f_s
 'option text pos normal text_pos_normal
 IF save_graphic_params.called THEN 'change only if there are evaluable settings saved
  DRAW COLOR save_graphic_params.d_r, save_graphic_params.d_g, save_graphic_params.d_b
  DRAW ALPHA save_graphic_params.d_a
  FILL COLOR save_graphic_params.f_r, save_graphic_params.f_g, save_graphic_params.f_b
  FILL ALPHA save_graphic_params.f_a
  DRAW SIZE save_graphic_params.d_s
  DRAW FONT SIZE save_graphic_params.f_s
  IF save_graphic_params.text_pos_normal=1 THEN 
   OPTION TEXT POS NORMAL
  ELSE
   OPTION TEXT POS CENTRAL
  ENDIF
 ENDIF  
END DEF[attachment=0]IMG_2207.PNG[/attachment]
Attachments
IMG_2207.PNG
IMG_2207.PNG (366.94 KiB) Viewed 918 times

User avatar
Marcel
Posts: 8
Joined: Tue Jun 06, 2017 6:55 pm
My devices: iPad pro
Flag: Netherlands
Contact:

Re: bar chart

Post by Marcel » Wed Jun 14, 2017 2:45 am

Hi Joel,

Nice work. Now connecting to the internal mic and filters behind it for spectrum analyzing.

Marcel

Post Reply