[Lazarus] Specifying Y axis

2015-08-14 Thread Richard Mace
Hi,
I have a line graph that only needs to display 0's and 1's however, when
the first 0 is plotted, the Y axis is set-up as the lowest mark being -1,
then goes up through 0 to then be +1.
How can I set the graph up to say that the lowest mark would be 0 and the
highest would be 1?

Many thanks

Richard
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Specifying Y axis

2015-08-15 Thread Werner Pamler

Chart1.Extent.YMax := 1;
Chart1.Extent.YMin := 0;
Chart1.Extent.UseYMax := true;
Chart1.Extent.UseYMin := true;

Call this before or after adding data to the series, or set it in the 
object inspector.


Am 15.08.2015 um 07:15 schrieb Richard Mace:

Hi,
I have a line graph that only needs to display 0's and 1's however, 
when the first 0 is plotted, the Y axis is set-up as the lowest mark 
being -1, then goes up through 0 to then be +1.
How can I set the graph up to say that the lowest mark would be 0 and 
the highest would be 1?


Many thanks

Richard


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Specifying Y axis

2015-08-16 Thread Richard Mace
On 15 August 2015 at 10:38, Werner Pamler  wrote:

> Chart1.Extent.YMax := 1;
> Chart1.Extent.YMin := 0;
> Chart1.Extent.UseYMax := true;
> Chart1.Extent.UseYMin := true;
>
> Call this before or after adding data to the series, or set it in the
> object inspector.
>

​Thanks Werner, That works great.
I've now got a the 0 as Min and the 1 as Max, however, it's also showing a
0.5 in the middle.
Any idea how I can remove that?

Also, is it possible to actually replace the 0 and 1 for words such as
"true" and "false"?

Thanks

Richard​
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Specifying Y axis

2015-08-17 Thread Werner Pamler

There are (at least) two solutions:

#1:
Select Chart.LeftAxis. Go to "Intervals", set "Count" to 2, and modify 
"Options" such that only "aipUseCount" and "aipUseNiceSteps" are active.
Write an event handler for "OnMarkToText" of the LeftAxis: "if AMark = 0 
then AMarkText := 'FALSE' else if AMark = 1 then AMarkText := 'TRUE';"


#2:
Add a ListChartSource to the form, Double-click on its property 
"DataPoints". In line 1 of the "DataPoint Editor" set Y=0, Text ='FALSE' 
(the other fields can be empty)

Cursor cown to add a new line: in line 2 enter Y = 1, Text = 'TRUE'
Link the ListChartSource to the property "Source" of the 
Chart.LeftAxis.Marks.

Set the "Style" of the Chart.LeftAxis.Marks to "smsLabel".


Am 16.08.2015 um 21:40 schrieb Richard Mace:
On 15 August 2015 at 10:38, Werner Pamler >wrote:


Chart1.Extent.YMax := 1;
Chart1.Extent.YMin := 0;
Chart1.Extent.UseYMax := true;
Chart1.Extent.UseYMin := true;

Call this before or after adding data to the series, or set it in
the object inspector.


​Thanks Werner, That works great.
I've now got a the 0 as Min and the 1 as Max, however, it's also 
showing a 0.5 in the middle.

Any idea how I can remove that?

Also, is it possible to actually replace the 0 and 1 for words such as 
"true" and "false"?


Thanks

Richard​



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus