Widget:PlaceNamesCharts: Difference between revisions
From International Robin Hood Bibliography
mNo edit summary |
mNo edit summary |
||
Line 107: | Line 107: | ||
"title": "", | "title": "", | ||
"minValue": 0, | "minValue": 0, | ||
"format": "####" | "format": "####" | ||
}, | }, | ||
"vAxis": { | "vAxis": { | ||
Line 297: | Line 297: | ||
if (minYear !== 0) {//Only display timeline if dated items found | if (minYear !== 0) {//Only display timeline if dated items found | ||
var showXAxisTicks = false; | |||
window.IRHB.charts.datedItem = true; | window.IRHB.charts.datedItem = true; | ||
var data = new google.visualization.DataTable(); | var data = new google.visualization.DataTable(); | ||
Line 325: | Line 326: | ||
dataRowsAr[i][0] = xValue; | dataRowsAr[i][0] = xValue; | ||
} | } | ||
if (!showXAxisTicks && xValue > 2) { | |||
showXAxisTicks = true; | |||
} | |||
var lowerMod = minYear % 100; | var lowerMod = minYear % 100; | ||
var lowerCentury = minYear - lowerMod; | var lowerCentury = minYear - lowerMod; | ||
Line 360: | Line 363: | ||
var options = window.IRHB.charts.options["timeline"]; | var options = window.IRHB.charts.options["timeline"]; | ||
options.colors = window.IRHB.charts.columnColors; | options.colors = window.IRHB.charts.columnColors; | ||
if (!showXAxisTicks) { | |||
options.hAxis.textPosition = "none"; | |||
} | |||
options.vAxis.viewWindow.max = lowerYear; | options.vAxis.viewWindow.max = lowerYear; | ||
options.vAxis.viewWindow.min = upperYear; | options.vAxis.viewWindow.min = upperYear; |
Revision as of 17:35, 21 October 2018
This widget generates the Google charts on landing pages in the Place-names and Festivals sections of IRHB. It takes no parameters.