0
votes

I'm using Embarcadero's HTML5 builder (php) and TeeChart to draw graphs. Great tool for most parts but the TeeChart documentation for HTML5 Builder php is extremely thin, almost nonexisting so you need to guess a lot.

Now, I need a way to format the x-axis in a TeeChart line graph that has 2 series of data. Both series shares the same y and x-axis.The x-axis in my case should be text, not numbers. Now, the default x-axis is numbered 1,2,3... which isn't really workable in most situations.

To format TeeChart's y-axis is easy; the following code does it:

 $this->Chart1->axes->left->automatic = false;
  $this->Chart1->axes->left->minimum = 16;
  $this->Chart1->axes->left->maximum = 28;

one would then think the same logic would apply for the bottom axis, i.e.

 $this->Chart1->axes->bottom->minimum = something etc...

but not so. You'll get a runtime error trying that manouver.

Someone out there who knows how to get TeeChart php for HTML5 Builder draw an x-axis as you want it to appear?

1

1 Answers

1
votes

I've taken the source code from this demo (index page here) and I've added this at the end of the page, before the render call:

$chart1->axes->bottom->automatic = false;
$chart1->axes->bottom->minimum = -1;
$chart1->axes->bottom->maximum = 11;
$chart1->axes->top->automatic = false;
$chart1->axes->top->minimum = -1;
$chart1->axes->top->maximum = 11;

And it seems to work without problems:

custom range in horizontal axis