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
Parametrized Access SQL Q...
by
Khrys
[
Today
at 07:12:03 am]
How to set the Excel cell...
by
dodgex
[
Today
at 06:01:11 am]
BS PanelTrans - transform...
by
Xenno
[
Today
at 05:54:55 am]
Why does FPC behave this ...
by
440bx
[
Today
at 04:41:50 am]
PngDrop: Reduce the size ...
by
ALLIGATOR
[
Today
at 04:05:04 am]
RTTIPropertyGrid expand
by
jamie
[
Today
at 03:17:43 am]
What was your first compu...
by
TBMan
[
Today
at 02:19:55 am]
Fantasy Worldbuilder; Pro...
by
Boleeman
[
Today
at 01:28:33 am]
Sum GNU Anti Reversi 8x8 ...
by
Boleeman
[
Today
at 12:42:53 am]
StrToDateTime problems
by
andyH
[
Today
at 12:28:42 am]
How to forward a Class in...
by
Bart
[January 12, 2026, 10:35:22 pm]
Picture Process with BGRA...
by
circular
[January 12, 2026, 08:05:53 pm]
[SOLVED] Average color
by
LeP
[January 12, 2026, 06:51:24 pm]
set zero values not to b...
by
wp
[January 12, 2026, 06:25:48 pm]
HELP Why the WriteRowHeig...
by
wp
[January 12, 2026, 06:22:24 pm]
building a Calculator usi...
by
Dzandaa
[January 12, 2026, 03:51:20 pm]
How can Lazarus implement...
by
Tommi
[January 12, 2026, 03:46:47 pm]
how to relay a button cli...
by
srvaldez
[January 12, 2026, 01:15:46 pm]
what was your first pasca...
by
BSaidus
[January 12, 2026, 01:01:32 pm]
[SOLVED] Transparent back...
by
alpine
[January 12, 2026, 11:28:56 am]
Lazarus and Libre Office
by
sydenis
[January 12, 2026, 11:07:38 am]
[SOLVED] Able to access p...
by
vinntec
[January 12, 2026, 09:27:53 am]
How to execute PKZIPC fro...
by
Hozso
[January 12, 2026, 08:17:36 am]
Jerky animation (windows)
by
Roland57
[January 12, 2026, 07:19:29 am]
RPNCalc in Lazarus
by
tailkinker
[January 12, 2026, 04:42:09 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [solved] TA Chart / BarSeries: Which setting will say "no data - no draw"? (Read 1985 times)
Nicole
Hero Member
Posts: 1300
[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: 13324
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: 1300
[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