[Lazarus] Specifying Y axis

Werner Pamler werner.pamler at freenet.de
Mon Aug 17 18:32:17 CEST 2015


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 <werner.pamler at freenet.de 
> <mailto:werner.pamler at freenet.de>>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 at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150817/69d1c833/attachment-0003.html>


More information about the Lazarus mailing list