Detect Bar Size/Resolution?

To add comments, please log in or register
Geester
280
Geester  

Hi,

I've attached a couple of images. One is where I have the bars small and one where the bars are larger. If I drag on the time axis on the chart window, going left makes the bars smaller, going right makes them bigger.

In the images, there is an indicator that I have programmed that has "wave" labels showing numbers. I'd like to programmatically change the numbers to a smaller font when the bars are made smaller and, vice versa.

Could anyone tell me whether these step bar/chart sizes can be captured in some kind of event so that I can adjust my label size?

Cheers and thanks! :)

Files:
E1.png 19 kb
E2.png 15 kb
William Roeder
20228
William Roeder  
  1. I've never dragged on the time axes, just press +/-
  2. You can try catching an event, or use a timer, or just check a tick.
    int OnInit(){
       width = (int)   ChartGetInteger(0,CHART_SCALE);
       SetIndexStyle(0, DRAW_HISTOGRAM, EMPTY, width);
    :
    int OnCalculate(...){
       if(ChartGetInteger(0,CHART_SCALE) != width)  OnInit();
    

Geester
280
Geester  
whroeder1:
  1. I've never dragged on the time axes, just press +/-
  2. You can try catching an event, or use a timer, or just check a tick.

Thanks very much @whroeder1 for pointing out CHART_SCALE. That'll do the trick very nicely indeed! :)

To add comments, please log in or register