Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
TAChart
(Moderator:
Ask
) »
[solved] TA Chart / BarSeries: Which setting will say "no data - no draw"?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
YM Player
by
TRon
[
Today
at 02:32:16 am]
How single procedure ends...
by
Marion
[
Today
at 01:57:43 am]
Python4Lazarus Undefined ...
by
Grew
[
Today
at 01:57:41 am]
ct2laz - convertor betwee...
by
Sharfik
[
Today
at 01:26:03 am]
StringGrid colored rows d...
by
wp
[December 02, 2024, 11:21:00 pm]
Amigo programming languag...
by
maurog
[December 02, 2024, 11:19:44 pm]
[SOLVED] How to document ...
by
korba812
[December 02, 2024, 10:49:39 pm]
AVRPascal – free code edi...
by
ackarwow
[December 02, 2024, 10:18:22 pm]
storing string
by
Remy Lebeau
[December 02, 2024, 09:46:56 pm]
How do you know wich vers...
by
Warfley
[December 02, 2024, 08:32:11 pm]
Unable to find file "date...
by
Cumberland
[December 02, 2024, 08:27:29 pm]
Common File Dialogs Have ...
by
rvk
[December 02, 2024, 07:33:14 pm]
Developing a Kernel Modul...
by
nicolap
[December 02, 2024, 05:37:05 pm]
LazMapView - adding a sca...
by
alpine
[December 02, 2024, 05:26:28 pm]
[SOLVED] Howto use a DEFI...
by
tintinux
[December 02, 2024, 04:55:13 pm]
ZDataset.Locate + loParti...
by
tintinux
[December 02, 2024, 04:47:48 pm]
Strange memory allocation...
by
MathMan
[December 02, 2024, 03:40:40 pm]
Best UI to adopte while d...
by
marcov
[December 02, 2024, 02:42:45 pm]
Random SnowFlakes:
by
Boleeman
[December 02, 2024, 12:24:18 pm]
AY_FLY Library
by
Thaddy
[December 02, 2024, 11:50:21 am]
Hustle - A simple task ma...
by
MarkMLl
[December 02, 2024, 11:37:20 am]
How much would it hamper ...
by
Thaddy
[December 02, 2024, 11:36:24 am]
Lazarus MDI application.
by
Fred vS
[December 02, 2024, 11:25:21 am]
Linking question
by
Khrys
[December 02, 2024, 10:23:13 am]
CudaText Editor (written ...
by
AlexTP
[December 02, 2024, 10:16:27 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [solved] TA Chart / BarSeries: Which setting will say "no data - no draw"? (Read 1607 times)
Nicole
Hero Member
Posts: 1009
[solved] TA Chart / BarSeries: Which setting will say "no data - no draw"?
«
on:
June 21, 2023, 10:10:33 am »
I have a chart, in which I add data by code.
The x-axes holds dates.
Which setting will make that only those dates are drawn, where there are figures for?
Please see at the screenshot, how it looks and how I want it to look.
«
Last Edit: June 21, 2023, 02:24:17 pm by Nicole
»
Logged
wp
Hero Member
Posts: 12457
Re: TA Chart / BarSeries: Which setting will say "no data - no draw"?
«
Reply #1 on:
June 21, 2023, 10:59:30 am »
Do not assign an x value to the series; this way you use the equidistant point index --> Use Series.Add(y) rather than Series.AddXY(x, y). Convert the date to a string and apply is as additional parameter in the Add call:
Add(y, DateToStr(date)).
In order to get the dates to the horizontal axis you additionally must assign the ChartSource used by the series to the Source property of the BottomAxis.Marks. And you must also set BottomAxis.Marks.Style to smsLabel in order to see the labels defined by the Add calls:
Code: Pascal
[Select]
[+]
[-]
uses
TAChartUtils
;
procedure
TForm1
.
FormCreate
(
Sender
:
TObject
)
;
begin
Chart1BarSeries1
.
Add
(
Random
*
1000
,
DateToStr
(
EncodeDate
(
2000
,
1
,
1
)
)
)
;
Chart1BarSeries1
.
Add
(
Random
*
1000
,
DateToStr
(
EncodeDate
(
2020
,
1
,
1
)
)
)
;
Chart1BarSeries1
.
Add
(
Random
*
1000
,
DateToStr
(
EncodeDate
(
2022
,
1
,
1
)
)
)
;
Chart1BarSeries1
.
Add
(
Random
*
1000
,
DateToStr
(
EncodeDate
(
2022
,
6
,
21
)
)
)
;
Chart1
.
BottomAxis
.
Marks
.
Source
:
=
Chart1BarSeries1
.
Source
;
Chart1
.
BottomAxis
.
Marks
.
Style
:
=
smsLabel
;
end
;
«
Last Edit: June 21, 2023, 11:10:06 am by wp
»
Logged
Nicole
Hero Member
Posts: 1009
[solved] Re: TA Chart / BarSeries: Which setting will say "no data - no draw"?
«
Reply #2 on:
June 21, 2023, 02:23:57 pm »
This worked at sudden, thank you so much!
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
TAChart
(Moderator:
Ask
) »
[solved] TA Chart / BarSeries: Which setting will say "no data - no draw"?
TinyPortal
© 2005-2018