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
[SOLVED] Form OnTop not w...
by
Pe3s
[
Today
at 07:32:12 pm]
Save record to BLOB Field
by
Sc0li0sis
[
Today
at 07:31:24 pm]
progress dialog with bloc...
by
cdbc
[
Today
at 07:31:19 pm]
$ifdef highlighting
by
440bx
[
Today
at 07:09:02 pm]
Convert string with Key-V...
by
Warfley
[
Today
at 05:29:37 pm]
[Solved] Need help with c...
by
nikel
[
Today
at 04:57:02 pm]
Clipboard Formats
by
AlexTP
[
Today
at 04:39:19 pm]
Lazarus Bugfix Release 4...
by
BSaidus
[
Today
at 04:17:24 pm]
[BUG REPORT] Code explore...
by
Martin_fr
[
Today
at 02:54:20 pm]
Qt6 / X11: problem with G...
by
paweld
[
Today
at 02:44:07 pm]
Dumb Problems Contest!
by
Thaddy
[
Today
at 02:41:59 pm]
Please ask about the valu...
by
zzzzzzz7
[
Today
at 02:14:52 pm]
Need help converting a C+...
by
jamie
[
Today
at 01:02:23 pm]
laz_xmlstreaming.pas fail...
by
Ryan J
[
Today
at 01:00:52 pm]
Probleme installing Lazar...
by
DonAlfredo
[
Today
at 09:05:41 am]
Wikipedia pollution
by
Thaddy
[
Today
at 08:31:35 am]
How to register a windows...
by
Thaddy
[
Today
at 08:24:15 am]
TurboBird IBX
by
rvk
[
Today
at 07:10:47 am]
append new record to arra...
by
speter
[
Today
at 12:46:02 am]
TTagEdit Component 1.2
by
astverskoy
[December 06, 2025, 11:25:09 pm]
Corrupted strings
by
Aruna
[December 06, 2025, 08:25:44 pm]
Lazarus Trunc & macOS Tah...
by
Thaddy
[December 06, 2025, 05:00:57 pm]
"F2": possible bug in IDE...
by
WooBean
[December 06, 2025, 04:14:47 pm]
Problem with TSQLQuery
by
sch61
[December 06, 2025, 02:53:10 pm]
Lazarus broke my project
by
LatinoDaddy
[December 06, 2025, 02:21:02 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [solved] TA Chart / BarSeries: Which setting will say "no data - no draw"? (Read 1963 times)
Nicole
Hero Member
Posts: 1277
[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: 13264
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: 1277
[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