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
IRC channel
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
Mediators and Indexed Pro...
by
Weitentaaal
[
Today
at 07:57:22 am]
Noting responds when send...
by
Thaddy
[
Today
at 07:46:23 am]
Un-register an LCL Compon...
by
dbannon
[
Today
at 05:19:05 am]
Столбец из CSV в CheckLis...
by
akulovz
[
Today
at 05:16:23 am]
TFPHTTPClient.Get(URL) / ...
by
dseligo
[
Today
at 05:03:08 am]
FPC Compiler Relocation B...
by
Coldzer0
[
Today
at 04:53:42 am]
AI cheetah
by
lainz
[
Today
at 03:17:28 am]
[SOLVED] Problems with ac...
by
Gercino
[
Today
at 01:04:30 am]
[SOLVED] TLabel OptimalFi...
by
Josh
[November 30, 2023, 11:43:45 pm]
Not able to add any compo...
by
andrew Bubble
[November 30, 2023, 11:41:01 pm]
Pascal script: Unable to ...
by
aducom
[November 30, 2023, 10:13:42 pm]
TProcess and lots of data...
by
marcov
[November 30, 2023, 10:12:58 pm]
Lazarus Release Candidate...
by
AlexTP
[November 30, 2023, 10:01:08 pm]
Anyone interested in test...
by
cpicanco
[November 30, 2023, 09:35:48 pm]
Titlebar custom color
by
domasz
[November 30, 2023, 09:31:14 pm]
Dynamical creation of obj...
by
peterbos
[November 30, 2023, 09:10:55 pm]
BGRABitmap - showcase -
by
circular
[November 30, 2023, 08:52:03 pm]
Better Vectorcall Support
by
Nitorami
[November 30, 2023, 08:38:46 pm]
Windows API and wide/unic...
by
Nadar
[November 30, 2023, 08:08:58 pm]
Out of memory on a ATtiny...
by
ccrause
[November 30, 2023, 07:16:29 pm]
What is the meaning of TF...
by
MarkMLl
[November 30, 2023, 06:32:25 pm]
[SOLVED]Bash commands and...
by
TRon
[November 30, 2023, 06:23:52 pm]
how to change color of a ...
by
Joanna
[November 30, 2023, 04:28:17 pm]
Help with barcode scannin...
by
Handoko
[November 30, 2023, 04:16:10 pm]
Best practices to use tRt...
by
Mr.Madguy
[November 30, 2023, 12:48:45 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [solved] TA Chart / BarSeries: Which setting will say "no data - no draw"? (Read 705 times)
Nicole
Hero Member
Posts: 790
[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: 11445
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: 790
[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