If I go with GfxSetOverlayMode(2), how to construct a dynamic X-Y axis identical to that of a chart overlay? Also, please shed some light on auto-scaling aspect of these custom-made axes?
Having said that, can we insert space between last bar of a day and start bar of the next (both on chart and X-axis) with SetChartOptions(2, chartShowDates) and GfxSetOverlayMode(0 or 1)?
In low-level graphics, Status(“pxwidth”) and Status(“pxheight”) will give you the pixel width and height of the chart pane. From there you can work out where you want to draw your axes using the Gfx command set. Bear in mind in low-level graphics the origin is the top left, not the bottom left as you might expect.
Thank you very much for the information ! That helps …
If I may request, could you kindly share any reference AFL that shows how to display DateTime in the X-axis with auto-scaling (identical to that of a Price chart overlay).
Before I go ahead and start manipulating the X-axis. I was wondering on how to replicate the price chart using GfxSetOverlayMode(2)?
Warm appreciation to @Tomasz. It is quite well possible using, GfxSetOverlayMode(0) and GfxSetOverlayMode(1). But I cannot get my head around on how to do it using GfxSetOverlayMode(2) and GfxSetCoordsMode(0).
Once I have the control over the pixels, I imagine to increase the number to space between a set of drawn bars (representing different time-frames), then, use that space to populate different mini-charts for instance VAP histograms and others. And put it in a loop to exhibit a regular repetition.
For example in C#.Net (below code) we can draw a line from (0,0) to (1,1) pretty easily using the DpiX property of the Graphics class "in dots per inch", for the horizontal resolution supported by the Graphics object. But how to replicate the same in AFL (in terms of co-ordinates)?
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Example1_1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.BackColor = Color.LightBlue;
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.PageUnit = GraphicsUnit.Inch;
Pen blackPen = new Pen(Color.Black, 1 / g.DpiX);
g.DrawLine(blackPen, 0, 0, 1, 1);
}
}
}
Hi there
Lennon
i think is worth to start with this example afl here,
this example can show you, most of what you looking for.
yes i know is old afl without the GfxSetOverlayMode function but i really beleave will teach you few thinks