Recent

Author Topic: axis range problem  (Read 3833 times)

mtanner

  • Full Member
  • ***
  • Posts: 226
axis range problem
« on: August 18, 2018, 09:25:42 am »
I have a  dual-axis chart.  I use the following bit of code to control the range of the left axis.

With MyChart.AxisList[0] do begin
    Min=0;  Max=100; UseMin=true; UseMax=true;
end;

although actually the values are supplied by variables (whose values I have traced and checked to be correct).

The chart comes out with an x-range of 0 to 1000 (not 100). Except when I plot a series which is actually using the right-hand axis (whose range control seems to work ok).

Any suggestions please?

wp

  • Hero Member
  • *****
  • Posts: 6319
Re: axis range problem
« Reply #1 on: August 18, 2018, 09:33:40 am »
You do not provide enough information for me to give a precise answer. Please assemble a short demo which shows the issue and upload it here (only .pas, .lfm, .lpi and .lpr files in a common .zip).
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

WooBean

  • Jr. Member
  • **
  • Posts: 89
Re: axis range problem
« Reply #2 on: August 18, 2018, 11:18:57 am »
...

With MyChart.AxisList[0] do begin
    Min=0;  Max=100; UseMin=true; UseMax=true;
end;
...
Any suggestions please?

In my opinion your code does nothing. For example: "Min=0;" can be a valid expression (compare variable or field "Min" to zero) but its result is never used.

WooBean
« Last Edit: August 18, 2018, 11:42:40 am by WooBean »
Win7/64, Lazarus 1.8 win64-win64, FPC 3.0.4

mtanner

  • Full Member
  • ***
  • Posts: 226
Re: axis range problem
« Reply #3 on: August 18, 2018, 12:38:48 pm »
WooBean, apologies for the typo, the real code does have ":=" and not just "=", and it does do something under the circumstances described.