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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
duplicate an Object at ru...
by
jamie
[
Today
at 03:44:29 am]
Can /my/ AI help me with ...
by
schuler
[
Today
at 03:08:23 am]
Anubis activated
by
dsiders
[
Today
at 01:36:11 am]
wildcard utilities list
by
mas steindorff
[May 17, 2026, 11:01:19 pm]
TLazSerial : serial port ...
by
mas steindorff
[May 17, 2026, 10:50:34 pm]
StringGrid: which is "cur...
by
Bart
[May 17, 2026, 10:41:30 pm]
PopupMenu on dock menu
by
systemgvp
[May 17, 2026, 08:32:50 pm]
How to wait until a WebDA...
by
paweld
[May 17, 2026, 08:16:51 pm]
[SOLVED] Dark Theme
by
Hansvb
[May 17, 2026, 07:29:22 pm]
Bug with constref?
by
LemonParty
[May 17, 2026, 07:15:45 pm]
When will lazarus actuall...
by
marcov
[May 17, 2026, 05:52:04 pm]
FPC Unleashed (inline var...
by
Okoba
[May 17, 2026, 03:49:31 pm]
Can I enter MySQL prompt ...
by
nikel
[May 17, 2026, 03:41:56 pm]
is this code correct?
by
Thaddy
[May 17, 2026, 03:23:29 pm]
Anubis's website security...
by
ALLIGATOR
[May 17, 2026, 02:45:52 pm]
Pure Pascal LZ4, LZ5 and ...
by
LemonParty
[May 17, 2026, 01:38:07 pm]
Linking a PortAudio stati...
by
Thaddy
[May 17, 2026, 10:52:31 am]
TShellTreeView TopItem
by
Paolo
[May 17, 2026, 10:07:58 am]
Temp file CGI00000.TMP
by
Thaddy
[May 17, 2026, 09:32:16 am]
Nothing but chaotic attem...
by
LeP
[May 17, 2026, 09:02:05 am]
Feature suggestion - repe...
by
paweld
[May 17, 2026, 07:38:10 am]
search via TSQLQuery
by
paweld
[May 17, 2026, 07:28:41 am]
Amigo programming languag...
by
paxscript
[May 17, 2026, 05:49:02 am]
Klondike solitaire Part 2
by
valdir.marcos
[May 17, 2026, 03:50:07 am]
Creation of LAMW [NoGUI] ...
by
neuro
[May 17, 2026, 01:06:41 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [solved] TA Chart / BarSeries: Which setting will say "no data - no draw"? (Read 2069 times)
Nicole
Hero Member
Posts: 1324
[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: 13515
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: 1324
[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