Help talk:EasyTimeline syntax: Difference between revisions

Content deleted Content added
Derianus (talk | contribs)
 
(42 intermediate revisions by 25 users not shown)
Line 1:
{{WikiProject banner shell|
{{Help Project}}
{{Wikipedia Help Project|class=NA|importance=mid}}
 
}}
{{collapse top|1=[[Meta:Help:EasyTimeline syntax]] authors and history}}
 
Line 240 ⟶ 241:
== Timeline or Graph? ==
 
Are the syntax for timelines? They seem to look more like graphs to me. Can someone show an example? <b><font color="#0060C0">[[User:Newfraferz87|No]]</font><fontspan colorstyle="color:#6000C00060C0">No</span>]][[User talk:Newfraferz87|News]]</font><fontspan colorstyle="008000color:#6000C0">News</span>]][[Special:Contributions/Newfraferz87|<span style="color:#008000">!]]</fontspan>]]</b> 01:33, 21 February 2010 (UTC)
: '''Strong agree''' [[User:BoldLuis|BoldLuis]] ([[User talk:BoldLuis|talk]]) 15:22, 20 May 2020 (UTC)
 
== Help "Error Message" on Timeline ==
Line 257 ⟶ 259:
 
Best regards,<br/>[[User:Codename Lisa|Codename Lisa]] ([[User talk:Codename Lisa|talk]]) 11:59, 31 May 2014 (UTC)
 
: The back end does [http://ploticus.sourceforge.net/doc/color.html not support] HSB specifications for PNG images. I will remove this option from the help page. [[Special:Contributions/84.127.115.190|84.127.115.190]] ([[User talk:84.127.115.190|talk]]) 04:53, 19 November 2014 (UTC)
 
== ISO 8601 date format ==
Line 270 ⟶ 274:
*dd/mm/yyyy - European, Latin American format
 
So, two all-numerical formats, but none of them allowed by WP style guide, which mandates ISO 8601 for all-numerical formats.
The images that are generated have
* Updated yyyy/mm/dd
 
See also http://xkcd.com/1179/
So, three all-numerical formats, but none of them allowed by WP style guide, which mandates ISO 8601 for all-numerical formats.
 
http://xkcd.com/1179/
 
[[User:Derianus|Derianus]] ([[User talk:Derianus|talk]]) 21:31, 28 September 2014 (UTC)
 
*Hi Dedalus, I am not longer maintaining since 200?, but it should be a straightforward patch. You can either submit a patch yourself or file a bug for it. Cheers, [[User:Erik Zachte|Erik Zachte]] ([[User talk:Erik Zachte|talk]]) 17:35, 29 September 2014 (UTC)
 
:: Here it is:
{{collapse top|Patch}}
<syntaxhighlight lang="diff">
--- EasyTimeline.pl.orig 2014-11-07 19:49:49.000000000 +0100
+++ EasyTimeline.pl 2014-11-08 14:50:42.000000000 +0100
@@ -1076,11 +1076,13 @@
$datevalue = lc($datevalue);
if ( ($datevalue ne "dd/mm/yyyy")
&& ($datevalue ne "mm/dd/yyyy")
+ && ($datevalue ne "yyyy-mm-dd")
&& ($datevalue ne "yyyy")
&& ($datevalue ne "x.y"))
{
&Error(
- "Invalid DateFormat. Specify as 'dd/mm/yyyy', 'mm/dd/yyyy', 'yyyy' or 'x.y'\n"
+ "Invalid DateFormat. Specify as 'dd/mm/yyyy', 'mm/dd/yyyy', 'yyyy-mm-dd',\n"
+ . " 'yyyy' or 'x.y'\n"
. " (use first two only for years >= 1800)\n");
return;
}
@@ -1611,15 +1613,23 @@
}
}
else {
+ my $year;
+
if ( ($attrvalue =~ /^\d+$/)
&& ($attrvalue >= 1800)
&& ($attrvalue <= 2030))
{
if ($attribute =~ /^From$/i) {
- $attrvalue = "01/01/" . $attrvalue;
+ if ($DateFormat eq "yyyy-mm-dd") {
+ $attrvalue .= "-01-01";
+ }
+ else { $attrvalue = "01/01/" . $attrvalue; }
}
if ($attribute =~ /^Till$/i) {
- if ($DateFormat eq "dd/mm/yyyy") {
+ if ($DateFormat eq "yyyy-mm-dd") {
+ $attrvalue .= "-12-31";
+ }
+ elsif ($DateFormat eq "dd/mm/yyyy") {
$attrvalue = "31/12/" . $attrvalue;
}
else { $attrvalue = "12/31/" . $attrvalue; }
@@ -1632,7 +1642,11 @@
);
return;
}
- if (substr($attrvalue, 6, 4) < 1800) {
+ if ($DateFormat eq "yyyy-mm-dd") {
+ $year = substr($attrvalue, 0, 4);
+ }
+ else { $year = substr($attrvalue, 6, 4); }
+ if ($year < 1800) {
&Error(
"Period attribute '$attribute' invalid. Specify year >= 1800."
);
@@ -2524,13 +2538,17 @@
}
if ( ($DateFormat eq "dd/mm/yyyy")
- || ($DateFormat eq "mm/dd/yyyy"))
+ || ($DateFormat eq "mm/dd/yyyy")
+ || ($DateFormat eq "yyyy-mm-dd"))
{
if ( ($attrvalue =~ /^\d+$/)
&& ($attrvalue >= 1800)
&& ($attrvalue <= 2030))
{
- $attrvalue = "01/01/" . $attrvalue;
+ if ($DateFormat eq "yyyy-mm-dd") {
+ $attrvalue .= "-01-01";
+ }
+ else { $attrvalue = "01/01/" . $attrvalue; }
}
}
@@ -4300,7 +4318,8 @@
}
else { $script .= " stubs: none\n"; }
- if ($DateFormat !~ /\//) {
+ if ( ($DateFormat eq "yyyy")
+ || ($DateFormat eq "x.y")) {
$script .= " ticincrement: " . $Scales{"$scale inc"} . "\n";
}
else {
@@ -4530,17 +4549,25 @@
return ($true);
}
- if (!($date =~ /^\d\d\/\d\d\/\d\d\d\d$/)) { return ($false); }
-
- if ($DateFormat eq "dd/mm/yyyy") {
- $day = substr($date, 0, 2);
- $month = substr($date, 3, 2);
- $year = substr($date, 6, 4);
+ if ($DateFormat eq "yyyy-mm-dd") {
+ if (!($date =~ /^\d\d\d\d-\d\d-\d\d$/)) { return ($false); }
+ $day = substr($date, 8, 2);
+ $month = substr($date, 5, 2);
+ $year = substr($date, 0, 4);
}
else {
- $day = substr($date, 3, 2);
- $month = substr($date, 0, 2);
- $year = substr($date, 6, 4);
+ if (!($date =~ /^\d\d\/\d\d\/\d\d\d\d$/)) { return ($false); }
+
+ if ($DateFormat eq "dd/mm/yyyy") {
+ $day = substr($date, 0, 2);
+ $month = substr($date, 3, 2);
+ $year = substr($date, 6, 4);
+ }
+ else {
+ $day = substr($date, 3, 2);
+ $month = substr($date, 0, 2);
+ $year = substr($date, 6, 4);
+ }
}
if ($month =~ /^(?:01|03|05|07|08|10|12)$/) {
@@ -4573,6 +4600,17 @@
return ($true);
}
+ if ($DateFormat eq "yyyy-mm-dd") {
+ $day = substr($date, 8, 2);
+ $month = substr($date, 5, 2);
+ $year = substr($date, 0, 4);
+ $dayf = substr($from, 8, 2);
+ $monthf = substr($from, 5, 2);
+ $yearf = substr($from, 0, 4);
+ $dayt = substr($till, 8, 2);
+ $montht = substr($till, 5, 2);
+ $yeart = substr($till, 0, 4);
+ }
if ($DateFormat eq "dd/mm/yyyy") {
$day = substr($date, 0, 2);
$month = substr($date, 3, 2);
@@ -4641,7 +4679,12 @@
my @mmm = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
my ($day, $month, $year);
my $date = shift;
- if ($DateFormat eq "dd/mm/yyyy") {
+ if ($DateFormat eq "yyyy-mm-dd") {
+ $day = substr($date, 8, 2);
+ $month = substr($date, 5, 2);
+ $year = substr($date, 0, 4);
+ }
+ elsif ($DateFormat eq "dd/mm/yyyy") {
$day = substr($date, 0, 2);
$month = substr($date, 3, 2);
$year = substr($date, 6, 4);
@@ -4706,7 +4749,10 @@
$month++;
my $date;
- if ($DateFormat eq "dd/mm/yyyy") {
+ if ($DateFormat eq "yyyy-mm-dd") {
+ $date = sprintf("%04d-%02d-%02d", $year, $month, $day);
+ }
+ elsif ($DateFormat eq "dd/mm/yyyy") {
$date = sprintf("%02d/%02d/%04d", $day, $month, $year);
}
else { $date = sprintf("%02d/%02d/%04d", $month, $day, $year); }
</syntaxhighlight>
{{collapse bottom}}
:: [[Special:Contributions/84.127.115.190|84.127.115.190]] ([[User talk:84.127.115.190|talk]]) 14:12, 8 November 2014 (UTC)
:::Hi! Thanks for your patch! Please use [[mw:Developer access]] to submit this as a Git branch directly into [[mw:Git/Tutorial|Gerrit]]. Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use the [https://tools.wmflabs.org/gerrit-patch-uploader/ Gerrit Patch Uploader]. Thanks again! --[[User:AKlapper (WMF)|AKlapper (WMF)]] ([[User talk:AKlapper (WMF)|talk]]) 10:28, 10 November 2014 (UTC)
:::: Submitted at [[bugzilla:73640]]. [[Special:Contributions/84.127.115.190|84.127.115.190]] ([[User talk:84.127.115.190|talk]]) 04:58, 20 November 2014 (UTC)
 
== Alignment ==
 
How do I align the timeline as a whole on the wikipage? On the German wiki <nowiki><div class="float-right"></nowiki> does the trick. Here it seems to have no effect. Any help would be appreciated :) Best, [[User:Furius|Furius]] ([[User talk:Furius|talk]]) 08:19, 10 October 2014 (UTC)
 
== x.y format ==
 
Is there a reason the <code>x.y</code> real-number "date" format isn't documented? --[[User:Fru1tbat|Fru1tbat]] ([[User talk:Fru1tbat|talk]]) 17:19, 5 December 2014 (UTC)
 
== Legend cropped on the right ==
 
On this article [https://en.wikipedia.org/w/index.php?title=Pat_Metheny_Group&oldid=662849794#Timeline], the legend is cropped on the right - the "n" in "Percussion" is cut in half, and "Studio releases" becomes "Studio rele". I can fix this by changing "columns:4" to "3", but it would be better if it would be fixed in the feature itself. Could somebody do that? [[User:Bonomont|Bonomont]] ([[User talk:Bonomont|talk]]) 18:32, 9 June 2015 (UTC)
 
== Font Color ==
 
Hi guys,
 
I am working on [[Template:Tomb Raider series Timeline]].
How do I change the font color?
 
Cheers!--[[User:TudorTulok|TudorTulok]] ([[User talk:TudorTulok|talk]]) 07:28, 29 November 2015 (UTC)
 
::Solved here '''textcolor:black'''. Sorry for putting the question and immediately answering and finding the solution myself. [[User:TudorTulok|TudorTulok]] ([[User talk:TudorTulok|talk]]) 07:29, 29 November 2015 (UTC)
 
== Font selection ==
 
I understand from the EasyTimeline documentation that any non-default font must be available on the server. In the case of Wikipedia, how do I find out what alternative fonts are available? The default is just horrible: the letter spacing is all uneven. OTOH, this might be a problem with the font rendering, and not something that can be improved easily. (See [[Classical music#Timeline of composers]]) [[User:Imaginatorium|Imaginatorium]] ([[User talk:Imaginatorium|talk]]) 11:26, 11 September 2016 (UTC)
 
 
==Bar height==
Hi! I would be grateful if someone could tell me where to find the syntax for the bar dimensions. ATB[[User:Wikirictor|Wikirictor]] ([[User talk:Wikirictor|talk]]) 02:30, 11 January 2017 (UTC)
 
== Years before 1800 ==
 
I just drafted a timeline to add to an article relating to the [[American Revolutionary War]]. I pasted it into the article, only to discover that EasyTimeline wouldn't run. It doesn't work for years in the 1700s:
{{Block indent |1={{Pre |1={{Red |1=
Line 5: Period = from:06/15/1775 till:12/23/1783
- Period attribute 'from' invalid. Specify year >= 1800.
 
Line 15: ScaleMajor = unit:year increment:2 start:1775
- Scale attribute 'start' invalid.
}}}}}}
Is this limitation as arbitrary as it appears to be, and could someone please fix it? <small><span style="color:#000;border-width:0;font-weight:normal;padding:0 1px 0 1px;text-shadow:1px 4px 8px #F70,-8px -6px 10px #ee7f2d,1px 1px 1px #FFF,2px 2px 1px #AAA;">[[User:Lwarrenwiki|Lwarrenwiki]] ([[User talk:Lwarrenwiki|talk]])</span></small> 17:35, 15 January 2018 (UTC)
 
== Bug: Additional diagonal lines in Chrome ==
 
I can't reproduce it but there are multiple reports that timelines can add strange diagonal lines when used for bands [[Helloween#Timeline|like this]]. It seems to affect Chrome but not Firefox. [https://i.redd.it/agc2esaceeq31.png Here is a screenshot]. Any idea what causes this and how to get rid of it? --[[User:Mfb|mfb]] ([[User talk:Mfb|talk]]) 23:09, 3 October 2019 (UTC)
 
== Text is blurry when zoomed in ==
 
This template should generate 2x images as well https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images#resolution_switching_same_size_different_resolutions. The text is noticably blurry when using a page zoom above 100% or using a retina display.
 
[[File:Blurry EasyTimeline timeline because of page zoom.png]]
 
[[User:Akeosnhaoe|Akeosnhaoe]] ([[User talk:Akeosnhaoe|talk]]) 20:39, 1 March 2021 (UTC)
 
== Help needed splitting a line at [[Demographics of the Supreme Court of the United States‎]] ==
 
At [[Demographics of the Supreme Court of the United States‎#Catholic justices]], is it possible to plot one line for Edward D. White, split between the two colors representing his time as an associate justice and his time as chief justice? [[User:BD2412|<span style="background:gold">'''''BD2412'''''</span>]] [[User talk:BD2412|'''T''']] 22:56, 10 March 2021 (UTC)
*'''Note:''' This has been resolved. [[User:BD2412|<span style="background:gold">'''''BD2412'''''</span>]] [[User talk:BD2412|'''T''']] 19:18, 24 April 2021 (UTC)
 
== Underscores as spaces ==
 
: '''bar'''
:defines the bar id. Other commands (notably PlotData) will expect this id for reference. This will also be the label to be shown along the axis, unless attribute text is present. The bar id should not contain any spaces: '''use underscores instead, these will be converted to spaces''', as with article titles.
 
Oh no, they won't!
 
The underscores continue to show up as underscores. How long has this been a thing? [[User:TangoFett|TangoFett]] ([[User talk:TangoFett|talk]]) 19:07, 6 October 2023 (UTC)
 
== Adding a reference to this chart ==
 
Hey,
 
is there a way I can add a reference to this chart? Or maybe place a short caption directly below this chart with this reference:<ref>{{Cite web |title=iPhone-Verkaufszahlen weltweit bis 2023 |url=https://de.statista.com/statistik/daten/studie/203584/umfrage/absatz-von-apple-iphones-seit-dem-geschaeftsjahr-2007/ |access-date=2023-11-14 |website=Statista |language=de}}</ref>
 
<div class="floatright">
<timeline>
ImageSize=width:270 height:400
PlotArea=left:60 bottom:51 top:10 right:16
AlignBars=justify
Period=from:0 till:250
TimeAxis=orientation:horizontal
 
Colors=
id:gray value:gray(0.5)
id:line1 value:gray(0.9)
id:line2 value:gray(0.7)
 
ScaleMajor=unit:year increment:50 start:0 gridcolor:line2
ScaleMinor=unit:year increment:50 start:0 gridcolor:line1
 
BarData=
bar:2007 text:2007
bar:2008 text:2008
bar:2009 text:2009
bar:2010 text:2010
bar:2011 text:2011
bar:2012 text:2012
bar:2013 text:2013
bar:2014 text:2014
bar:2015 text:2015
bar:2016 text:2016
bar:2017 text:2017
bar:2018 text:2018
bar:2019 text:2019
bar:2020 text:2020
bar:2021 text:2021
bar:2022 text:2022
bar:2023 text:2023
 
PlotData=
color:tan1 width:10
 
bar:2007 from:start till:1.3 text:1.3 million
bar:2008 from:start till:11.6 text:11.6 million
bar:2009 from:start till:20.7 text:20.7 million
bar:2010 from:start till:39.9 text:39.9 million
bar:2011 from:start till:72.2 text:72.2 million
bar:2012 from:start till:125 text:125 million
bar:2013 from:start till:150 text:150 million
bar:2014 from:start till:169 text:169 million
bar:2015 from:start till:231 text:231 million
bar:2016 from:start till:211 text:211 million
bar:2017 from:start till:216 text:216 million
bar:2018 from:start till:217 text:217 million
bar:2019 from:start till:185 text:185 million
bar:2020 from:start till:189 text:189 million
bar:2021 from:start till:238 text:238 million
bar:2022 from:start till:239 text:239 million
bar:2023 from:start till:223 text:223 million
 
TextData=
pos:(70,20) textcolor:gray fontsize:S text:iPhone sales worldwide
TextData=
pos:(70,5) textcolor:gray fontsize:S text:Source:
</timeline></div> [[User:WikiPate|WikiPate]] ([[User talk:WikiPate|talk]]) 16:22, 14 November 2023 (UTC)
{{Reftalk}}
{{clear}}
 
== Adding multiple wikilinks in TextInput ==
 
How do I wikilink to multiple internal pages in the same line in a given "bar"? See [[User:Qwerty284651/sandbox#Men's doubles|timeline]]. Tried using quotes ("") and underscore (_) between [[Bob Bryan]] and [[Mike Bryan]] per [[Help:EasyTimeline syntax#Text input]], but did not give the intended result. [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 03:28, 10 February 2024 (UTC)
 
== "[[:EasyTimeline syntax]]" listed at [[Wikipedia:Redirects for discussion|Redirects for discussion]] ==
[[File:Information.svg|30px]]
The redirect <span class="plainlinks">[//en.wikipedia.org/w/index.php?title=EasyTimeline_syntax&redirect=no EasyTimeline syntax]</span> has been listed at [[Wikipedia:Redirects for discussion|redirects for discussion]] to determine whether its use and function meets the [[Wikipedia:Redirect|redirect guidelines]]. Readers of this page are welcome to comment on this redirect at '''{{slink|Wikipedia:Redirects for discussion/Log/2024 March 14#EasyTimeline syntax}}''' until a consensus is reached. <!-- Template:RFDNote --> [[User:Jlwoodwa|jlwoodwa]] ([[User talk:Jlwoodwa|talk]]) 00:54, 14 March 2024 (UTC)
 
== Display quality ==
 
Is it possible to increase the quality of text display in the timeline? [[User:Murat Karibay|Murat Karibay]] ([[User talk:Murat Karibay|talk]]) 00:20, 1 January 2025 (UTC)
 
== Axis label formatting ==
 
So I found out that using {{tt|BarData}} somehow hides the bar axis labels. I think:
# The behavior feels like an unintended side effect
# Maybe it should be pointed out in the syntax help. Maybe after figuring out there isn't ''another'' (interfering) side effect.
# There should be a way to format the axis labels anyway, independent of this behavior.
 
[[user:ArdWar|<span style="color:#339">'''Ard'''</span><span style="color:#7df">'''War'''</span>]]&nbsp;[[user_talk:ArdWar|🖂]] 00:58, 23 July 2025 (UTC)