- Upgraded to the latest version of Open Flash Charts (Version 2 Lug Wyrm Charmer)

- Localization of the menus 90% done.
- Removed the old types of Flash charts, (no longer used anyway, now we rely on open-flash-charts)

SVN:trunk[441]
This commit is contained in:
Denis Flaven
2010-06-08 13:12:17 +00:00
parent 4d3fbf1f79
commit fd8b3c835e
28 changed files with 1944 additions and 1142 deletions

View File

@@ -575,105 +575,16 @@ class DisplayBlock
$sHtml .= "<div id=\"LnkSearch_$iSearchSectionId\" class=\"DrawerHandle\">".Dict::S('UI:SearchToggle')."</div>\n";
break;
case 'pie_chart':
$sGroupBy = isset($aExtraParams['group_by']) ? $aExtraParams['group_by'] : '';
$sFilter = $this->m_oFilter->ToOQL();
$sHtml .= "
<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\"
WIDTH=\"400\"
HEIGHT=\"250\"
id=\"charts\"
ALIGN=\"\">
<PARAM NAME=movie VALUE=\"../images/charts.swf?library_path=../images/charts_library&xml_source=".urlencode("../pages/ajax.render.php?operation=pie_chart&group_by=$sGroupBy&encoding=oql&filter=".urlencode($sFilter))."\">
<PARAM NAME=\"quality\" VALUE=\"high\">
<PARAM NAME=\"bgcolor\" VALUE=\"#ffffff\">
<EMBED src=\"../images/charts.swf?library_path=../images/charts_library&xml_source=".urlencode("../pages/ajax.render.php?operation=pie_chart&group_by=$sGroupBy&encoding=oql&filter=".urlencode($sFilter))."\"
quality=\"high\"
bgcolor=\"#ffffff\"
WIDTH=\"400\"
HEIGHT=\"250\"
NAME=\"charts\"
ALIGN=\"\"
swLiveConnect=\"true\"
TYPE=\"application/x-shockwave-flash\"
PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">
</EMBED>
</OBJECT>
";
break;
case 'pie_chart_ajax':
if (isset($aExtraParams['group_by']))
{
$sGroupByField = $aExtraParams['group_by'];
$aGroupBy = array();
while($oObj = $this->m_oSet->Fetch())
{
$sValue = $oObj->Get($sGroupByField);
$aGroupBy[$sValue] = isset($aGroupBy[$sValue]) ? $aGroupBy[$sValue]+1 : 1;
}
$sFilter = urlencode($this->m_oFilter->serialize());
$aData = array();
$sHtml .= "<chart>\n";
$sHtml .= "<chart_type>3d pie</chart_type>\n";
$sHtml .= "<chart_data>\n";
$sHtml .= "<row>\n";
$sHtml .= "<null/>\n";
foreach($aGroupBy as $sValue => $void)
{
$sHtml .= "<string>$sValue</string>\n";
}
$sHtml .= "</row>\n";
$sHtml .= "<row>\n";
$sHtml .= "<string></string>\n";
foreach($aGroupBy as $void => $iCount)
{
$sHtml .= "<number>$iCount</number>\n";
}
$sHtml .= "</row>\n";
$sHtml .= "</chart_data>\n";
$sHtml .= "
<chart_value color='ffffff' alpha='90' font='arial' bold='true' size='10' position='inside' prefix='' suffix='' decimals='0' separator='' as_percentage='true' />
<draw>
<text color='000000' alpha='10' font='arial' rotation='0' bold='true' size='30' x='0' y='140' width='400' height='150' h_align='center' v_align='bottom'>|||||||||||||||||||||||||||||||||||||||||||||||</text>
</draw>
<legend_label layout='horizontal' bullet='circle' font='arial' bold='true' size='13' color='000000' alpha='85' />
<legend_rect fill_color='ffffff' fill_alpha='10' line_color='ffffff' line_alpha='50' line_thickness='0' />
<series_color>
<color>ddaa41</color>
<color>88dd11</color>
<color>4e62dd</color>
<color>ff8811</color>
<color>4d4d4d</color>
<color>5a4b6e</color>
<color>1188ff</color>
</series_color>
";
$sHtml .= "</chart>\n";
}
else
{
// Simply count the number of elements in the set
$iCount = $oSet->Count();
$sHtml .= "<chart>\n</chart>\n";
}
break;
case 'open_flash_chart':
static $iChartCounter = 0;
$sChartType = isset($aExtraParams['chart_type']) ? $aExtraParams['chart_type'] : 'pie';
$sTitle = isset($aExtraParams['chart_title']) ? $aExtraParams['chart_title'] : '';
$sGroupBy = isset($aExtraParams['group_by']) ? $aExtraParams['group_by'] : '';
$sFilter = $this->m_oFilter->ToOQL();
$sHtml .= "<script>
swfobject.embedSWF(\"../images/open-flash-chart.swf\", \"my_chart_{$iChartCounter}\", \"400\", \"400\",\"9.0.0\", \"expressInstall.swf\",
{\"data-file\":\"".urlencode("../pages/ajax.render.php?operation=open_flash_chart&params[group_by]=$sGroupBy&params[chart_type]=$sChartType&params[chart_title]=$sTitle&encoding=oql&filter=".urlencode($sFilter))."\"});
</script>\n";
$sHtml .= "<div id=\"my_chart_{$iChartCounter}\">If the chart does not display, <a href=\"http://get.adobe.com/flash/\" target=\"_blank\">install Flash</a></div>\n";
$oPage->add_script("function ofc_resize(left, width, top, height) { /* do nothing special */ }");
$oPage->add_ready_script("swfobject.embedSWF(\"../images/open-flash-chart.swf\", \"my_chart_{$iChartCounter}\", \"100%\", \"300\",\"9.0.0\", \"expressInstall.swf\",
{\"data-file\":\"".urlencode("../pages/ajax.render.php?operation=open_flash_chart&params[group_by]=$sGroupBy&params[chart_type]=$sChartType&params[chart_title]=$sTitle&encoding=oql&filter=".urlencode($sFilter))."\"});\n");
$iChartCounter++;
break;
@@ -742,6 +653,7 @@ class DisplayBlock
$oChartElement->set_start_angle( 35 );
$oChartElement->set_animate( true );
$oChartElement->set_tooltip( '#label# - #val# (#percent#)' );
$oChartElement->set_colours( array('#FF8A00', '#909980', '#2C2B33', '#CCC08D', '#596664') );
if (isset($aExtraParams['group_by']))
{
$sGroupByField = $aExtraParams['group_by'];
@@ -755,7 +667,7 @@ class DisplayBlock
$aData = array();
foreach($aGroupBy as $sValue => $iValue)
{
$aData[] = new pie_value($iValue, $sValue);
$aData[] = new pie_value($iValue, $sValue); //@@ BUG: not passed via ajax !!!
}
@@ -763,9 +675,9 @@ class DisplayBlock
$oChart->x_axis = null;
}
}
if (isset($aExtraParams['chart_title'])) //@@ BUG: not passed via ajax !!!
if (isset($aExtraParams['chart_title']))
{
$oTitle = new title( $aExtraParams['chart_title'] );
$oTitle = new title( Dict::S($aExtraParams['chart_title']) );
$oChart->set_title( $oTitle );
}
$oChart->set_bg_colour('#FFFFFF');

View File

@@ -2937,6 +2937,7 @@ abstract class MetaModel
// Note: load the dictionary as soon as possible, because it might be
// needed when some error occur
require_once('../core/dict.class.inc.php');
foreach ($oConfig->GetDictionaries() as $sModule => $sToInclude)
{
self::Plugin($sConfigFile, 'dictionaries', $sToInclude);

View File

@@ -21,9 +21,8 @@ body {
h1 {
font-family: Tahoma, Verdana, Arial, Helvetica;
font-size: 10pt;
color: #000;
font-weight:10px;
font-weight: bold;
}
.hilite {
color: #d81515;
@@ -685,4 +684,18 @@ td.cell_error {
}
table.transparent, table.transparent td {
background: transparent;
}
p.page-header {
color:#83B217;
font-weight: bold;
font-size: 2em;
font-family: Verdana, Arial, Helvetica, Sans-Serif
}
td.dashboard {
vertical-align:top;
text-align: center;
border: 1px solid #ccc;
-moz-border-radius: 10px;
padding: 10px;
width: 50%;
}

View File

@@ -682,8 +682,176 @@ Dict::Add('EN US', 'English', 'English', array(
'UI:UserManagement:NoLifeCycleApplicable' => 'N/A',
'UI:UserManagement:NoLifeCycleApplicable+' => 'No lifecycle has been defined for this class',
'UI:UserManagement:GrantMatrix' => 'Grant Matrix',
'UI:USerManagement:LinkBetween_User_And_Profile' => 'Link between %1$s and %2$s',
'UI:UserManagement:LinkBetween_User_And_Profile' => 'Link between %1$s and %2$s',
'UI:AdminToolsMenu' => 'Admin tools',
'UI:AdminToolsMenu+' => 'Admin tools',
'UI:AdminToolsMenu:Title' => 'Administration tools',
'UI:AdminToolsMenu:Text' => 'Tools accessible only to users having the administrator profile',
'UI:AuditMenu' => 'Audit',
'UI:AuditMenu+' => 'Audit',
'UI:ChangeManagementMenu' => 'Change Management',
'UI:ChangeManagementMenu+' => 'Change Management',
'UI:ChangeManagementMenu:Title' => 'Changes Overview',
'UI-ChangeManagementMenu-ChangesByType' => 'Changes by type',
'UI-ChangeManagementMenu-ChangesByStatus' => 'Changes by status',
'UI-ChangeManagementMenu-ChangesByWorkgroup' => 'Changes by workgroup',
'UI-ChangeManagementMenu-ChangesNotYetAssigned' => 'Changes not yet assigned',
'UI:ConfigurationItemsMenu'=> 'Configuration Items',
'UI:ConfigurationItemsMenu+'=> 'All Devices',
'UI:ConfigurationItemsMenu:Title' => 'Configuration Items Overview',
'UI-ConfigurationItemsMenu-ServersByCriticity' => 'Servers by criticity',
'UI-ConfigurationItemsMenu-PCsByCriticity' => 'PCs by criticity',
'UI-ConfigurationItemsMenu-NWDevicesByCriticity' => 'Network devices by criticity',
'UI-ConfigurationItemsMenu-ApplicationsByCriticity' => 'Applications by criticity',
'UI:ConfigurationManagementMenu' => 'Configuration Management',
'UI:ConfigurationManagementMenu+' => 'Configuration Management',
'UI:ConfigurationManagementMenu:Title' => 'Infrastructure Overview',
'UI-ConfigurationManagementMenu-InfraByType' => 'Infrastructure objects by type',
'UI-ConfigurationManagementMenu-InfraByStatus' => 'Infrastructure objects by status',
'UI:ContactsMenu' => 'Contacts',
'UI:ContactsMenu+' => 'Contacts',
'UI:ContactsMenu:Title' => 'Contacts Overview',
'UI-ContactsMenu-ContactsByLocation' => 'Contacts by location',
'UI-ContactsMenu-ContactsByType' => 'Contacts by type',
'UI-ContactsMenu-ContactsByStatus' => 'Contacts by status',
'UI:CSVImportMenu' => 'CSV import',
'UI:CSVImportMenu+' => 'Bulk creation or update',
'UI:DataModelMenu' => 'Data Model',
'UI:DataModelMenu+' => 'Overview of the Data Model',
'UI:ExportMenu' => 'Export',
'UI:ExportMenu+' => 'Export the results of any query in HTML, CSV or XML',
'UI:IncidentManagementMenu' => 'Incident Management',
'UI:IncidentManagementMenu+' => 'Incident Management',
'UI:IncidentManagementMenu:Title' => 'Incident Overview',
'UI-IncidentManagementMenu-IncidentsByType' => 'Incidents by type',
'UI-IncidentManagementMenu-IncidentsByStatus' => 'Incidents by status',
'UI-IncidentManagementMenu-IncidentsByWorkgroup' => 'Incidents by workgroup',
'UI-IncidentManagementMenu-IncidentsNotYetAssigned' => 'Incidents not yet assigned',
'UI:NotificationsMenu' => 'Notifications',
'UI:NotificationsMenu+' => 'Configuration of the Notifications',
'UI:RunQueriesMenu' => 'Run Queries',
'UI:RunQueriesMenu+' => 'Run any query',
'UI:ServiceDeskMenu' => 'Service Desk',
'UI:ServiceDeskMenu+' => 'Service Desk',
'UI:ServiceDeskMenu:Title' => 'Service Calls Overview',
'UI-ServiceDeskMenu-CallsByType' => 'Calls by type',
'UI-ServiceDeskMenu-CallsByStatus' => 'Calls by status',
'UI-ServiceDeskMenu-CallsBySeverity' => 'Calls by severity',
'UI-ServiceDeskMenu-CallsNotYetAssigned' => 'Calls not yet assigned',
'UI:ServiceManagementMenu' => 'Service Management',
'UI:ServiceManagementMenu+' => 'Service Management',
'UI:ServiceManagementMenu:Title' => 'Service Management Overview',
'UI-ServiceManagementMenu-ContractsBySrvLevel' => 'Contracts by service level',
'UI-ServiceManagementMenu-ContractsByStatus' => 'Contracts by status',
'UI-ServiceManagementMenu-ContractsEndingIn30Days' => 'Contracts ending in less then 30 days',
'UI:AdvancedToolsMenu' => 'Tools',
'UI:AdvancedToolsMenu+' => 'Advanced tools',
'UI:UniversalSearchMenu' => 'Universal Search',
'UI:UniversalSearchMenu+' => 'Search for anything...',
'UI:UserManagementMenu' => 'User Management',
'UI:UserManagementMenu+' => 'User management',
'UI:ApplicationsMenu' => 'Applications',
'UI:ApplicationsMenu+' => 'Applications',
'UI:ApplicationsMenu:Title' => 'Applications',
'UI:CircuitsMenu' => 'Circuits',
'UI:CircuitsMenu+' => 'Circuits',
'UI:CircuitsMenu:Title' => 'Circuits',
'UI:ContractsMenu' => 'Contracts',
'UI:ContractsMenu+' => 'Contracts',
'UI:ContractsMenu:Title' => 'Contracts',
'UI:InterfacesMenu' => 'Interfaces',
'UI:InterfacesMenu+' => 'Interfaces',
'UI:InterfacesMenu:Title' => 'Interfaces',
'UI:NetworkDevicesMenu' => 'Network Devices',
'UI:NetworkDevicesMenu+' => 'Network Devices',
'UI:NetworkDevicesMenu:Title' => 'Network Devices',
'UI:PatchesMenu' => 'Patches',
'UI:PatchesMenu+' => 'Patches',
'UI:PatchesMenu:Title' => 'Patches',
'UI:PCsMenu' => 'PCs',
'UI:PCsMenu+' => 'PCs',
'UI:PCsMenu:Title' => 'PCs',
'UI:ServersMenu' => 'Servers',
'UI:ServersMenu+' => 'Servers',
'UI:ServersMenu:Title' => 'Servers',
'UI:ServicesMenu' => 'Services',
'UI:ServicesMenu+' => 'Services',
'UI:ServicesMenu:Title' => 'Services',
'UI:SubnetsMenu' => 'Subnets',
'UI:SubnetsMenu+' => 'Subnets',
'UI:SubnetsMenu:Title' => 'Subnets',
'UI:ApplicationLogMenu' => 'Application Log',
'UI:ApplicationLogMenu+' => 'Application Log',
'UI:ApplicationLogMenu:Title' => 'Application Log',
'UI:ClosedChangesMenu' => 'Closed Changes',
'UI:ClosedChangesMenu+' => 'Closed Changes',
'UI:ClosedChangesMenu:Title' => 'Closed Changes',
'UI:ClosedIncidentsMenu' => 'Closed Incidents',
'UI:ClosedIncidentsMenu+' => 'Closed Incidents',
'UI:ClosedIncidentsMenu:Title' => 'Closed Incidents',
'UI:DocumentsMenu' => 'Documents',
'UI:DocumentsMenu+' => 'Documents',
'UI:DocumentsMenu:Title' => 'Documents',
'UI:GroupingMenu' => 'Groups',
'UI:GroupingMenu+' => 'Groups',
'UI:GroupingMenu:Title' => 'Groups',
'UI:KnownErrorsMenu' => 'Known Errors',
'UI:KnownErrorsMenu+' => 'Known Errors',
'UI:KnownErrorsMenu:Title' => 'Known Errors',
'UI:LocationsMenu' => 'Locations',
'UI:LocationsMenu+' => 'Locations',
'UI:LocationsMenu:Title' => 'Locations',
'UI:MyChangesMenu' => 'My Changes',
'UI:MyChangesMenu+' => 'My Changes',
'UI:MyChangesMenu:Title' => 'My Changes',
'UI:MyIncidentsMenu' => 'My Incidents',
'UI:MyIncidentsMenu+' => 'My Incidents',
'UI:MyIncidentsMenu:Title' => 'My Incidents',
'UI:MyServiceCallsMenu' => 'My Service Calls',
'UI:MyServiceCallsMenu+' => 'My Service Calls',
'UI:MyServiceCallsMenu:Title' => 'My Service Calls',
'UI:OpenChangesMenu' => 'Open Changes',
'UI:OpenChangesMenu+' => 'Open Changes',
'UI:OpenChangesMenu:Title' => 'Open Changes',
'UI:OpenIncidentsMenu' => 'Open Incidents',
'UI:OpenIncidentsMenu+' => 'Open Incidents',
'UI:OpenIncidentsMenu:Title' => 'Open Incidents',
'UI:OpenServiceCallsMenu' => 'Open Service Calls',
'UI:OpenServiceCallsMenu+' => 'Open Service Calls',
'UI:OpenServiceCallsMenu:Title' => 'Open Service Calls',
'UI:PersonsMenu' => 'Persons',
'UI:PersonsMenu+' => 'Persons',
'UI:PersonsMenu:Title' => 'Persons',
'UI:ProfilesMenu' => 'Profiles',
'UI:ProfilesMenu+' => 'Profiles',
'UI:ProfilesMenu:Title' => 'Profiles',
'UI:ScheduledOutagesMenu' => 'Scheduled Outages',
'UI:ScheduledOutagesMenu+' => 'Scheduled Outages',
'UI:ScheduledOutagesMenu:Title' => 'Scheduled Outages',
'UI:TeamsMenu' => 'Teams',
'UI:TeamsMenu+' => 'Teams',
'UI:TeamsMenu:Title' => 'Teams',
'UI:UserAccountsMenu' => 'User Accounts',
'UI:UserAccountsMenu+' => 'User Accounts',
'UI:UserAccountsMenu:Title' => 'User Accounts',
));

View File

@@ -681,6 +681,176 @@ Dict::Add('FR FR', 'French', 'Français', array(
'UI:UserManagement:GrantMatrix' => 'Matrice des droits',
'UI:USerManagement:LinkBetween_User_And_Profile' => 'Lien entre %1$s et %2$s',
'UI:AdminToolsMenu' => 'Outils d\'admin',
'UI:AdminToolsMenu+' => 'Outils d\'administration',
'UI:AdminToolsMenu:Title' => 'Outils d\'administration',
'UI:AdminToolsMenu:Text' => 'Ces outils sont accessibles uniquement aux utilisateur possédant le profil Administrateur.',
'UI:AuditMenu' => 'Audit',
'UI:AuditMenu+' => 'Audit',
'UI:ChangeManagementMenu' => 'Gestion du Changement',
'UI:ChangeManagementMenu+' => 'Gestion du Changement',
'UI:ChangeManagementMenu:Title' => 'Résumé des changements',
'UI-ChangeManagementMenu-ChangesByType' => 'Changements par type',
'UI-ChangeManagementMenu-ChangesByStatus' => 'Changements par état',
'UI-ChangeManagementMenu-ChangesByWorkgroup' => 'Changements par workgroup',
'UI-ChangeManagementMenu-ChangesNotYetAssigned' => 'Changements en attente d\'assignation',
'UI:ConfigurationItemsMenu'=> 'Actifs (CIs)',
'UI:ConfigurationItemsMenu+'=> 'Tous les actifs',
'UI:ConfigurationItemsMenu:Title' => 'Résumé des actifs (CIs)',
'UI-ConfigurationItemsMenu-ServersByCriticity' => 'Serveurs par criticité',
'UI-ConfigurationItemsMenu-PCsByCriticity' => 'PCs par criticité',
'UI-ConfigurationItemsMenu-NWDevicesByCriticity' => 'Equipements réseau par criticité',
'UI-ConfigurationItemsMenu-ApplicationsByCriticity' => 'Applications par criticité',
'UI:ConfigurationManagementMenu' => 'Gestion de Configuration',
'UI:ConfigurationManagementMenu+' => 'Gestion de Configuration',
'UI:ConfigurationManagementMenu:Title' => 'Résumé de l\'Infrastructure',
'UI-ConfigurationManagementMenu-InfraByType' => 'Nombre d\'éléments par type',
'UI-ConfigurationManagementMenu-InfraByStatus' => 'Nombre d\'éléments par état',
'UI:ContactsMenu' => 'Contacts',
'UI:ContactsMenu+' => 'Contacts',
'UI:ContactsMenu:Title' => 'Résumé des contacts',
'UI-ContactsMenu-ContactsByLocation' => 'Contacts par emplacement',
'UI-ContactsMenu-ContactsByType' => 'Contacts par type',
'UI-ContactsMenu-ContactsByStatus' => 'Contacts par état',
'UI:CSVImportMenu' => 'Import CSV',
'UI:CSVImportMenu+' => 'Import ou mise à jour en masse',
'UI:DataModelMenu' => 'Modèle de Données',
'UI:DataModelMenu+' => 'Résumé du Modèle de Données',
'UI:ExportMenu' => 'Exportation',
'UI:ExportMenu+' => 'Exportation des résultats d\'une requête en HTML, CSV ou XML',
'UI:IncidentManagementMenu' => 'Gestion des Incidents',
'UI:IncidentManagementMenu+' => 'Gestion des Incidents',
'UI:IncidentManagementMenu:Title' => 'Résumé des incidents',
'UI-IncidentManagementMenu-IncidentsByType' => 'Incidents par type',
'UI-IncidentManagementMenu-IncidentsByStatus' => 'Incidents par état',
'UI-IncidentManagementMenu-IncidentsByWorkgroup' => 'Incidents par workgroup',
'UI-IncidentManagementMenu-IncidentsNotYetAssigned' => 'Incidents en attente d\'assignation',
'UI:NotificationsMenu' => 'Notifications',
'UI:NotificationsMenu+' => 'Configuration des Notifications',
'UI:RunQueriesMenu' => 'Requêtes OQL',
'UI:RunQueriesMenu+' => 'Executer une requête OQL',
'UI:ServiceDeskMenu' => 'Service Desk',
'UI:ServiceDeskMenu+' => 'Service Desk',
'UI:ServiceDeskMenu:Title' => 'Résumé des demandes utilisateur',
'UI-ServiceDeskMenu-CallsByType' => 'Demandes par type',
'UI-ServiceDeskMenu-CallsByStatus' => 'Demandes par état',
'UI-ServiceDeskMenu-CallsBySeverity' => 'Demandes par sévérité',
'UI-ServiceDeskMenu-CallsNotYetAssigned' => 'Demandes en attente d\'assignation',
'UI:ServiceManagementMenu' => 'Gestion des Services',
'UI:ServiceManagementMenu+' => 'Gestion des Services',
'UI:ServiceManagementMenu:Title' => 'Résumé des services & contrats',
'UI-ServiceManagementMenu-ContractsBySrvLevel' => 'Contrats par niveau de service',
'UI-ServiceManagementMenu-ContractsByStatus' => 'Contrats par état',
'UI-ServiceManagementMenu-ContractsEndingIn30Days' => 'Contrats se terminant dans moins de 30 jours',
'UI:AdvancedToolsMenu' => 'Outils',
'UI:AdvancedToolsMenu+' => 'Outils Avancés',
'UI:UniversalSearchMenu' => 'Recherche Universelle',
'UI:UniversalSearchMenu+' => 'Rechercher n\'importe quel objet...',
'UI:UserManagementMenu' => 'Gestion des Utilisateurs',
'UI:UserManagementMenu+' => 'Gestion des Utilisateurs',
'UI:ApplicationsMenu' => 'Applications',
'UI:ApplicationsMenu+' => 'Applications',
'UI:ApplicationsMenu:Title' => 'Applications',
'UI:CircuitsMenu' => 'Circuits',
'UI:CircuitsMenu+' => 'Circuits',
'UI:CircuitsMenu:Title' => 'Circuits',
'UI:ContractsMenu' => 'Contrats',
'UI:ContractsMenu+' => 'Contrats',
'UI:ContractsMenu:Title' => 'Contrats',
'UI:InterfacesMenu' => 'Interfaces',
'UI:InterfacesMenu+' => 'Interfaces',
'UI:InterfacesMenu:Title' => 'Interfaces',
'UI:NetworkDevicesMenu' => 'Equipements Réseau',
'UI:NetworkDevicesMenu+' => 'Equipements Réseau',
'UI:NetworkDevicesMenu:Title' => 'Equipements Réseau',
'UI:PatchesMenu' => 'Patches',
'UI:PatchesMenu+' => 'Patches',
'UI:PatchesMenu:Title' => 'Patches',
'UI:PCsMenu' => 'PCs',
'UI:PCsMenu+' => 'PCs',
'UI:PCsMenu:Title' => 'PCs',
'UI:ServersMenu' => 'Serveurs',
'UI:ServersMenu+' => 'Serveurs',
'UI:ServersMenu:Title' => 'Serveurs',
'UI:ServicesMenu' => 'Services',
'UI:ServicesMenu+' => 'Services',
'UI:ServicesMenu:Title' => 'Services',
'UI:SubnetsMenu' => 'Subnets',
'UI:SubnetsMenu+' => 'Subnets',
'UI:SubnetsMenu:Title' => 'Subnets',
'UI:ApplicationLogMenu' => 'Log Applicatif',
'UI:ApplicationLogMenu+' => 'Log Applicatif',
'UI:ApplicationLogMenu:Title' => 'Log Applicatif',
'UI:ClosedChangesMenu' => 'Changements Terminés',
'UI:ClosedChangesMenu+' => 'Changements Terminés',
'UI:ClosedChangesMenu:Title' => 'Changements Terminés',
'UI:ClosedIncidentsMenu' => 'Incidents Clôts',
'UI:ClosedIncidentsMenu+' => 'Incidents Clôts',
'UI:ClosedIncidentsMenu:Title' => 'Incidents Clôts',
'UI:DocumentsMenu' => 'Documents',
'UI:DocumentsMenu+' => 'Documents',
'UI:DocumentsMenu:Title' => 'Documents',
'UI:GroupingMenu' => 'Groupes',
'UI:GroupingMenu+' => 'Groupes',
'UI:GroupingMenu:Title' => 'Groupes',
'UI:KnownErrorsMenu' => 'Erreurs Connues',
'UI:KnownErrorsMenu+' => 'Erreurs Connues',
'UI:KnownErrorsMenu:Title' => 'Erreurs Connues',
'UI:LocationsMenu' => 'Emplacements',
'UI:LocationsMenu+' => 'Emplacements',
'UI:LocationsMenu:Title' => 'Emplacements',
'UI:MyChangesMenu' => 'Mes Changements',
'UI:MyChangesMenu+' => 'Mes Changements',
'UI:MyChangesMenu:Title' => 'Mes Changements',
'UI:MyIncidentsMenu' => 'Mes Incidents',
'UI:MyIncidentsMenu+' => 'Mes Incidents',
'UI:MyIncidentsMenu:Title' => 'Mes Incidents',
'UI:MyServiceCallsMenu' => 'Mes Demandes de Service',
'UI:MyServiceCallsMenu+' => 'Mes Demandes de Service',
'UI:MyServiceCallsMenu:Title' => 'Mes Demandes de Service',
'UI:OpenChangesMenu' => 'Changements En Cours',
'UI:OpenChangesMenu+' => 'Changements En Cours',
'UI:OpenChangesMenu:Title' => 'Changements En Cours',
'UI:OpenIncidentsMenu' => 'Incidents En Cours',
'UI:OpenIncidentsMenu+' => 'Incidents En Cours',
'UI:OpenIncidentsMenu:Title' => 'Incidents En Cours',
'UI:OpenServiceCallsMenu' => 'Demandes de Service En Cours',
'UI:OpenServiceCallsMenu+' => 'Demandes de Service En Cours',
'UI:OpenServiceCallsMenu:Title' => 'Demandes de Service En Cours',
'UI:PersonsMenu' => 'Personnes',
'UI:PersonsMenu+' => 'Personnes',
'UI:PersonsMenu:Title' => 'Personnes',
'UI:ProfilesMenu' => 'Profils',
'UI:ProfilesMenu+' => 'Profils',
'UI:ProfilesMenu:Title' => 'Profils',
'UI:ScheduledOutagesMenu' => 'Maintenance Plannifiée',
'UI:ScheduledOutagesMenu+' => 'Maintenance Plannifiée',
'UI:ScheduledOutagesMenu:Title' => 'Maintenance Plannifiée',
'UI:TeamsMenu' => 'Equipes',
'UI:TeamsMenu+' => 'Equipes',
'UI:TeamsMenu:Title' => 'Equipes',
'UI:UserAccountsMenu' => 'Comptes Utilisateur',
'UI:UserAccountsMenu+' => 'Comptes Utilisateur',
'UI:UserAccountsMenu:Title' => 'Comptes Utilisateur',
));
?>

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -1,64 +1,38 @@
<?php
class area_base
/**
* inherits from line
*/
class area extends line
{
function area_base()
function area()
{
$tmp = 'fill-alpha';
$this->$tmp = 0.35;
$this->values = array();
}
function set_width( $w )
{
$this->width = $w;
}
function set_colour( $colour )
{
$this->colour = $colour;
$this->type = "area";
}
/**
* the fill colour
*/
function set_fill_colour( $colour )
{
$this->fill = $colour;
}
/**
* sugar: see set_fill_colour
*/
function fill_colour( $colour )
{
$this->set_fill_colour( $colour );
return $this;
}
function set_fill_alpha( $alpha )
{
$tmp = "fill-alpha";
$this->$tmp = $alpha;
}
function set_halo_size( $size )
{
$tmp = 'halo-size';
$this->$tmp = $size;
}
function set_values( $v )
{
$this->values = $v;
}
function set_dot_size( $size )
{
$tmp = 'dot-size';
$this->$tmp = $size;
}
function set_key( $text, $font_size )
{
$this->text = $text;
$tmp = 'font-size';
$this->$tmp = $font_size;
}
function set_tooltip( $tip )
{
$this->tip = $tip;
}
function set_loop()
{
$this->loop = true;

View File

@@ -7,7 +7,6 @@ class bar_3d_value
function bar_3d_value( $top )
{
$this->top = $top;
// $this->bottom = $bottom;
}
function set_colour( $colour )
@@ -21,11 +20,3 @@ class bar_3d_value
}
}
class bar_3d extends bar_base
{
function bar_3d()
{
$this->type = "bar_3d";
parent::bar_base();
}
}

View File

@@ -6,36 +6,92 @@ class bar_base
{
function bar_base(){}
/**
* @param $text as string the key text
* @param $size as integer, size in pixels
*/
function set_key( $text, $size )
{
$this->text = $text;
$tmp = 'font-size';
$this->$tmp = $size;
}
/**
* syntatical sugar.
*/
function key( $text, $size )
{
$this->set_key( $text, $size );
}
/**
* @param $v as an array, a mix of:
* - a bar_value class. You can use this to customise the paramters of each bar.
* - integer. This is the Y position of the top of the bar.
*/
function set_values( $v )
{
$this->values = $v;
}
/**
* see set_values
*/
function append_value( $v )
{
$this->values[] = $v;
}
/**
* @param $colour as string, a HEX colour, e.g. '#ff0000' red
*/
function set_colour( $colour )
{
$this->colour = $colour;
}
/**
*syntatical sugar
*/
function colour( $colour )
{
$this->set_colour( $colour );
}
/**
* @param $alpha as real number (range 0 to 1), e.g. 0.5 is half transparent
*/
function set_alpha( $alpha )
{
$this->alpha = $alpha;
}
/**
* @param $tip as string, the tip to show. May contain various magic variables.
*/
function set_tooltip( $tip )
{
$this->tip = $tip;
}
/**
*@param $on_show as line_on_show object
*/
function set_on_show($on_show)
{
$this->{'on-show'} = $on_show;
}
function set_on_click( $text )
{
$tmp = 'on-click';
$this->$tmp = $text;
}
function attach_to_right_y_axis()
{
$this->axis = 'right';
}
}

View File

@@ -2,13 +2,40 @@
include_once 'ofc_bar_base.php';
class bar_glass_value
class bar_on_show
{
function bar_glass_value( $top )
/**
*@param $type as string. Can be any one of:
* - 'pop-up'
* - 'drop'
* - 'fade-in'
* - 'grow-up'
* - 'grow-down'
* - 'pop'
*
* @param $cascade as float. Cascade in seconds
* @param $delay as float. Delay before animation starts in seconds.
*/
function __construct($type, $cascade, $delay)
{
$this->type = $type;
$this->cascade = (float)$cascade;
$this->delay = (float)$delay;
}
}
class bar_value
{
/**
* @param $top as integer. The Y value of the top of the bar
* @param OPTIONAL $bottom as integer. The Y value of the bottom of the bar, defaults to Y min.
*/
function bar_value( $top, $bottom=null )
{
$this->top = $top;
// $this->bottom = $bottom;
if( isset( $bottom ) )
$this->bottom = $bottom;
}
function set_colour( $colour )
@@ -22,6 +49,14 @@ class bar_glass_value
}
}
class bar extends bar_base
{
function bar()
{
$this->type = "bar";
parent::bar_base();
}
}
class bar_glass extends bar_base
{
@@ -31,3 +66,66 @@ class bar_glass extends bar_base
parent::bar_base();
}
}
class bar_cylinder extends bar_base
{
function bar_cylinder()
{
$this->type = "bar_cylinder";
parent::bar_base();
}
}
class bar_cylinder_outline extends bar_base
{
function bar_cylinder_outline()
{
$this->type = "bar_cylinder_outline";
parent::bar_base();
}
}
class bar_rounded_glass extends bar_base
{
function bar_rounded_glass()
{
$this->type = "bar_round_glass";
parent::bar_base();
}
}
class bar_round extends bar_base
{
function bar_round()
{
$this->type = "bar_round";
parent::bar_base();
}
}
class bar_dome extends bar_base
{
function bar_dome()
{
$this->type = "bar_dome";
parent::bar_base();
}
}
class bar_round3d extends bar_base
{
function bar_round3d()
{
$this->type = "bar_round3d";
parent::bar_base();
}
}
class bar_3d extends bar_base
{
function bar_3d()
{
$this->type = "bar_3d";
parent::bar_base();
}
}

View File

@@ -4,6 +4,12 @@ include_once 'ofc_bar_base.php';
class bar_sketch extends bar_base
{
/**
* @param $colour as string, HEX colour e.g. '#00ff00'
* @param $outline_colour as string, HEX colour e.g. '#ff0000'
* @param $fun_factor as integer, range 0 to 10. 0,1 and 2 are pretty boring.
* 4 to 6 is a bit fun, 7 and above is lots of fun.
*/
function bar_sketch( $colour, $outline_colour, $fun_factor )
{
$this->type = "bar_sketch";

View File

@@ -36,6 +36,11 @@ class bar_stack_value
$this->val = $val;
$this->colour = $colour;
}
function set_tooltip( $tip )
{
$this->tip = $tip;
}
}
class bar_stack_key

View File

@@ -1,9 +1,157 @@
<?php
class line extends line_base
class line_on_show
{
/**
*@param $type as string. Can be any one of:
* - 'pop-up'
* - 'explode'
* - 'mid-slide'
* - 'drop'
* - 'fade-in'
* - 'shrink-in'
*
* @param $cascade as float. Cascade in seconds
* @param $delay as float. Delay before animation starts in seconds.
*/
function __construct($type, $cascade, $delay)
{
$this->type = $type;
$this->cascade = (float)$cascade;
$this->delay = (float)$delay;
}
}
class line
{
function line()
{
$this->type = "line";
$this->values = array();
}
/**
* Set the default dot that all the real
* dots inherit their properties from. If you set the
* default dot to be red, all values in your chart that
* do not specify a colour will be red. Same for all the
* other attributes such as tooltip, on-click, size etc...
*
* @param $style as any class that inherits base_dot
*/
function set_default_dot_style( $style )
{
$tmp = 'dot-style';
$this->$tmp = $style;
}
/**
* @param $v as array, can contain any combination of:
* - integer, Y position of the point
* - any class that inherits from dot_base
* - <b>null</b>
*/
function set_values( $v )
{
$this->values = $v;
}
/**
* Append a value to the line.
*
* @param mixed $v
*/
function append_value($v)
{
$this->values[] = $v;
}
function set_width( $width )
{
$this->width = $width;
}
function set_colour( $colour )
{
$this->colour = $colour;
}
/**
* sytnatical sugar for set_colour
*/
function colour( $colour )
{
$this->set_colour( $colour );
return $this;
}
function set_halo_size( $size )
{
$tmp = 'halo-size';
$this->$tmp = $size;
}
function set_key( $text, $font_size )
{
$this->text = $text;
$tmp = 'font-size';
$this->$tmp = $font_size;
}
function set_tooltip( $tip )
{
$this->tip = $tip;
}
/**
* @param $text as string. A javascript function name as a string. The chart will
* try to call this function, it will pass the chart id as the only parameter into
* this function. E.g:
*
*/
function set_on_click( $text )
{
$tmp = 'on-click';
$this->$tmp = $text;
}
function loop()
{
$this->loop = true;
}
function line_style( $s )
{
$tmp = "line-style";
$this->$tmp = $s;
}
/**
* Sets the text for the line.
*
* @param string $text
*/
function set_text($text)
{
$this->text = $text;
}
function attach_to_right_y_axis()
{
$this->axis = 'right';
}
/**
*@param $on_show as line_on_show object
*/
function set_on_show($on_show)
{
$this->{'on-show'} = $on_show;
}
function on_show($on_show)
{
$this->set_on_show($on_show);
return $this;
}
}

View File

@@ -4,12 +4,12 @@ class line_base
{
function line_base()
{
$this->type = "line_dot";
$this->type = "line";
$this->text = "Page views";
$tmp = 'font-size';
$this->$tmp = 10;
$this->values = array(9,6,7,9,5,7,6,9,7);
$this->values = array();
}
function set_values( $v )
@@ -17,6 +17,16 @@ class line_base
$this->values = $v;
}
/**
* Append a value to the line.
*
* @param mixed $v
*/
function append_value($v)
{
$this->values[] = $v;
}
function set_width( $width )
{
$this->width = $width;
@@ -67,4 +77,16 @@ class line_base
$tmp = "line-style";
$this->$tmp = $s;
}
/**
* Sets the text for the line.
*
* @param string $text
*/
function set_text($text)
{
$this->text = $text;
}
}

View File

@@ -35,16 +35,58 @@ class pie_value
$tmp = 'on-click';
$this->$tmp = $event;
}
/**
* An object that inherits from base_pie_animation
*/
function add_animation( $animation )
{
if( !isset( $this->animate ) )
$this->animate = array();
$this->animate[] = $animation;
return $this;
}
}
class base_pie_animation{}
/**
* fade the pie slice from $alpha (pie set_alpha) to 100% opaque.
*/
class pie_fade extends base_pie_animation
{
function pie_fade()
{
$this->type="fade";
}
}
/**
* Bounce the pie slice out a little
*/
class pie_bounce extends base_pie_animation
{
/**
* @param $distance as integer, distance to bounce in pixels
*/
function pie_bounce( $distance )
{
$this->type="bounce";
$this->distance = $distance;
}
}
/**
* Make a pie chart and fill it with pie slices
*/
class pie
{
function pie()
{
$this->type = 'pie';
$this->colours = array("#d01f3c","#356aa0","#C79810");
$this->border = 2;
}
function set_colours( $colours )
@@ -52,46 +94,140 @@ class pie
$this->colours = $colours;
}
/**
* Sugar wrapped around set_colours
*/
function colours( $colours )
{
$this->set_colours( $colours );
return $this;
}
/**
* @param $alpha as float (0-1) 0.75 = 3/4 visible
*/
function set_alpha( $alpha )
{
$this->alpha = $alpha;
}
/**
*sugar wrapped set_alpha
**/
function alpha( $alpha )
{
$this->set_alpha( $alpha );
return $this;
}
/**
* @param $v as array containing one of
* - null
* - real or integer number
* - a pie_value object
*/
function set_values( $v )
{
$this->values = $v;
}
// boolean
function set_animate( $animate )
/**
* sugar for set_values
*/
function values( $v )
{
$this->animate = $animate;
$this->set_values( $v );
return $this;
}
// real
/**
* HACK to keep old code working.
*/
function set_animate( $bool )
{
if( $bool )
$this->add_animation( new pie_fade() );
}
/**
* An object that inherits from base_pie_animation
*/
function add_animation( $animation )
{
if( !isset( $this->animate ) )
$this->animate = array();
$this->animate[] = $animation;
return $this;
}
/**
* @param $angle as real number
*/
function set_start_angle( $angle )
{
$tmp = 'start-angle';
$this->$tmp = $angle;
}
/**
* sugar for set_start_angle
*/
function start_angle($angle)
{
$this->set_start_angle( $angle );
return $this;
}
/**
* @param $tip as string. The tooltip text. May contain magic varibles
*/
function set_tooltip( $tip )
{
$this->tip = $tip;
}
/**
* sugar for set_tooltip
*/
function tooltip( $tip )
{
$this->set_tooltip( $tip );
return $this;
}
function set_gradient_fill()
{
$tmp = 'gradient-fill';
$this->$tmp = true;
}
function gradient_fill()
{
$this->set_gradient_fill();
return $this;
}
/**
* By default each label is the same colour as the slice,
* but you can ovveride that behaviour using this method.
*
* @param $label_colour as string HEX colour;
*/
function set_label_colour( $label_colour )
{
$tmp = 'label-colour';
$this->$tmp = $label_colour;
}
function label_colour( $label_colour )
{
$this->set_label_colour( $label_colour );
return $this;
}
/**
* Turn off the labels
*/
@@ -106,4 +242,16 @@ class pie
$tmp = 'on-click';
$this->$tmp = $event;
}
/**
* Fix the radius of the pie chart. Take a look at the magic variable #radius#
* for helping figure out what radius to set it to.
*
* @param $radius as number
*/
function radius( $radius )
{
$this->radius = $radius;
return $this;
}
}

View File

@@ -17,11 +17,10 @@ class scatter_value
class scatter
{
function scatter( $colour, $dot_size )
function scatter( $colour )
{
$this->type = "scatter";
$this->set_colour( $colour );
$this->set_dot_size( $dot_size );
}
function set_colour( $colour )
@@ -29,12 +28,18 @@ class scatter
$this->colour = $colour;
}
function set_dot_size( $dot_size )
function set_default_dot_style( $style )
{
$tmp = 'dot-size';
$this->$tmp = $dot_size;
$tmp = 'dot-style';
$this->$tmp = $style;
}
/**
* @param $v as array, can contain any combination of:
* - integer, Y position of the point
* - any class that inherits from scatter_value
* - <b>null</b>
*/
function set_values( $values )
{
$this->values = $values;

View File

@@ -2,26 +2,48 @@
class scatter_line
{
function scatter_line( $colour, $dot_size )
function scatter_line( $colour, $width )
{
$this->type = "scatter_line";
$this->set_colour( $colour );
$this->set_dot_size( $dot_size );
$this->set_width( $width );
}
function set_default_dot_style( $style )
{
$tmp = 'dot-style';
$this->$tmp = $style;
}
function set_colour( $colour )
{
$this->colour = $colour;
}
function set_dot_size( $dot_size )
function set_width( $width )
{
$tmp = 'dot-size';
$this->$tmp = $dot_size;
$this->width = $width;
}
function set_values( $values )
{
$this->values = $values;
}
function set_step_horizontal()
{
$this->stepgraph = 'horizontal';
}
function set_step_vertical()
{
$this->stepgraph = 'vertical';
}
function set_key( $text, $font_size )
{
$this->text = $text;
$tmp = 'font-size';
$this->$tmp = $font_size;
}
}

View File

@@ -1,5 +1,9 @@
<?php
/**
* Set the title of a chart, make one of these and pass it into
* open_flash_chart set_title
*/
class title
{
function title( $text='' )
@@ -7,6 +11,26 @@ class title
$this->text = $text;
}
/**
* A css string. Can optionally contain:
* - font-size
* - font-family
* - font-weight
* - color
* - background-color
* - text-align
* - margin
* - margin-left
* - margin-right
* - margin-top
* - margin-bottom
* - padding
* - padding-left
* - padding-right
* - padding-top
* - padding-bottom
* just like the css we use all the time :-)
*/
function set_style( $css )
{
$this->style = $css;

View File

@@ -6,33 +6,49 @@ class tooltip
{
function tooltip(){}
/**
* @param $shadow as boolean. Enable drop shadow.
*/
function set_shadow( $shadow )
{
$this->shadow = $shadow;
}
// stroke in pixels (e.g. 5 )
/**
* @param $stroke as integer, border width in pixels (e.g. 5 )
*/
function set_stroke( $stroke )
{
$this->stroke = $stroke;
}
/**
* @param $colour as string, HEX colour e.g. '#0000ff'
*/
function set_colour( $colour )
{
$this->colour = $colour;
}
/**
* @param $bg as string, HEX colour e.g. '#0000ff'
*/
function set_background_colour( $bg )
{
$this->background = $bg;
}
// a css style
/**
* @param $style as string. A css style.
*/
function set_title_style( $style )
{
$this->title = $style;
}
/**
* @param $style as string. A css style.
*/
function set_body_style( $style )
{
$this->body = $style;

View File

@@ -26,9 +26,18 @@ if (!file_exists($default_path)) mkdir($default_path, 0777, true);
$destination = $default_path . basename( $_GET[ 'name' ] );
echo 'Saving your image to: '. $destination;
// print_r( $_POST );
// print_r( $_SERVER );
// echo $HTTP_RAW_POST_DATA;
//
// POST data is usually string data, but we are passing a RAW .png
// so PHP is a bit confused and $_POST is empty. But it has saved
// the raw bits into $HTTP_RAW_POST_DATA
//
$jfh = fopen($destination, 'w') or die("can't open file");
fwrite($jfh, $GLOBALS['HTTP_RAW_POST_DATA']);
fwrite($jfh, $HTTP_RAW_POST_DATA);
fclose($jfh);
//

View File

@@ -4,61 +4,121 @@ class x_axis
{
function x_axis(){}
/**
* @param $stroke as integer, with of the line and ticks
*/
function set_stroke( $stroke )
{
$this->stroke = $stroke;
}
function stroke( $stroke )
{
$this->set_stroke( $stroke );
return $this;
}
/**
*@param $colour as string HEX colour
*@param $grid_colour as string HEX colour
*/
function set_colours( $colour, $grid_colour )
{
$this->set_colour( $colour );
$this->set_grid_colour( $grid_colour );
}
/**
*@param $colour as string HEX colour
*/
function set_colour( $colour )
{
$this->colour = $colour;
}
function colour( $colour )
{
$this->set_colour($colour);
return $this;
}
function set_tick_height( $height )
{
$tmp = 'tick-height';
$this->$tmp = $height;
}
function tick_height( $height )
{
$this->set_tick_height($height);
return $this;
}
function set_grid_colour( $colour )
{
$tmp = 'grid-colour';
$this->$tmp = $colour;
}
// $o is a boolean
function grid_colour( $colour )
{
$this->set_grid_colour($colour);
return $this;
}
/**
* @param $o is a boolean. If true, the X axis start half a step in
* This defaults to True
*/
function set_offset( $o )
{
$this->offset = $o?true:false;
}
function offset( $o )
{
$this->set_offset($o);
return $this;
}
/**
* @param $steps as integer. Which grid lines and ticks are visible.
*/
function set_steps( $steps )
{
$this->steps = $steps;
}
function steps( $steps )
{
$this->set_steps($steps);
return $this;
}
/**
* @param $val as an integer, the height in pixels of the 3D bar. Mostly
* used for the 3D bar chart.
*/
function set_3d( $val )
{
$tmp = '3d';
$this->$tmp = $val;
}
/**
* @param $x_axis_labels as an x_axis_labels object
* Use this to customize the labels (colour, font, etc...)
*/
function set_labels( $x_axis_labels )
{
//$this->labels = $v;
$this->labels = $x_axis_labels;
}
//
// helper function to make the examples
// simpler.
//
/**
* Sugar syntax: helper function to make the examples simpler.
* @param $a is an array of labels
*/
function set_labels_from_array( $a )
{
$x_axis_labels = new x_axis_labels();
@@ -69,6 +129,9 @@ class x_axis
$x_axis_labels->set_steps( $this->steps );
}
/**
* min and max.
*/
function set_range( $min, $max )
{
$this->min = $min;

View File

@@ -1,5 +1,8 @@
<?php
/**
* x_axis_label see x_axis_labels
*/
class x_axis_label
{
function x_axis_label( $text, $colour, $size, $rotate )

View File

@@ -4,14 +4,27 @@ class x_axis_labels
{
function x_axis_labels(){}
/**
* @param $steps which labels are generated
*/
function set_steps( $steps )
{
$this->steps = $steps;
}
//
// An array of [x_axis_label or string]
//
/**
* @param $steps as integer which labels are visible
*/
function visible_steps( $steps )
{
$this->{"visible-steps"} = $steps;
return $this;
}
/**
*
* @param $labels as an array of [x_axis_label or string]
*/
function set_labels( $labels )
{
$this->labels = $labels;
@@ -22,13 +35,35 @@ class x_axis_labels
$this->colour = $colour;
}
/**
* font size in pixels
*/
function set_size( $size )
{
$this->size = $size;
}
/**
* rotate labels
*/
function set_vertical()
{
$this->rotate = "vertical";
$this->rotate = 270;
}
/**
* @param @angle as real. The angle of the text.
*/
function rotate( $angle )
{
$this->rotate = $angle;
}
/**
* @param $text as string. Replace and magic variables with actual x axis position.
*/
function text( $text )
{
$this->text = $text;
}
}

View File

@@ -4,10 +4,10 @@ class y_axis extends y_axis_base
{
function y_axis(){}
//
// y axis right does NOT control
// grid colour, the left axis does
//
/**
* @param $colour as string. The grid are the lines inside the chart.
* HEX colour, e.g. '#ff0000'
*/
function set_grid_colour( $colour )
{
$tmp = 'grid-colour';

View File

@@ -4,11 +4,17 @@ class y_axis_base
{
function y_axis_base(){}
/**
* @param $s as integer, thickness of the Y axis line
*/
function set_stroke( $s )
{
$this->stroke = $s;
}
/**
* @param $val as integer. The length of the ticks in pixels
*/
function set_tick_length( $val )
{
$tmp = 'tick-length';
@@ -32,6 +38,15 @@ class y_axis_base
$this->$tmp = $colour;
}
/**
* Set min and max values, also (optionally) set the steps value.
* You can reverse the chart by setting min larger than max, e.g. min = 10
* and max = 0.
*
* @param $min as integer
* @param $max as integer
* @param $steps as integer.
*/
function set_range( $min, $max, $steps=1 )
{
$this->min = $min;
@@ -39,18 +54,63 @@ class y_axis_base
$this->set_steps( $steps );
}
/**
* Sugar for set_range
*/
function range( $min, $max, $steps=1 )
{
$this->set_range( $min, $max, $steps );
return $this;
}
/**
* @param $off as Boolean. If true the Y axis is nudged up half a step.
*/
function set_offset( $off )
{
$this->offset = $off?1:0;
}
function set_labels( $labels )
/**
* @param $y_axis_labels as an y_axis_labels object
* Use this to customize the labels (colour, font, etc...)
*/
function set_labels( $y_axis_labels )
{
$this->labels = $labels;
$this->labels = $y_axis_labels;
}
/**
* Pass in some text for each label. This can contain magic variables "#val#" which
* will get replaced with the value for that Y axis label. Useful for:
* - "£#val#"
* - "#val#%"
* - "#val# million"
*
* @param $text as string.
*/
function set_label_text( $text )
{
$tmp = new y_axis_labels();
$tmp->set_text( $text );
$this->labels = $tmp;
}
/**
* @param $steps as integer.
*
* Only show every $steps label, e.g. every 10th
*/
function set_steps( $steps )
{
$this->steps = $steps;
}
/**
* Make the labels show vertical
*/
function set_vertical()
{
$this->rotate = "vertical";
}
}

View File

@@ -20,21 +20,29 @@ include_once 'ofc_title.php';
include_once 'ofc_y_axis_base.php';
include_once 'ofc_y_axis.php';
include_once 'ofc_y_axis_right.php';
include_once 'ofc_y_axis_labels.php';
include_once 'ofc_y_axis_label.php';
include_once 'ofc_x_axis.php';
include_once 'ofc_area_base.php';
include_once 'ofc_area_hollow.php';
include_once 'ofc_area_line.php';
include_once 'ofc_pie.php';
include_once 'ofc_bar.php';
include_once 'ofc_bar_filled.php';
//include_once 'ofc_bar.php';
include_once 'ofc_bar_glass.php';
include_once 'ofc_bar_filled.php';
include_once 'ofc_bar_stack.php';
include_once 'ofc_bar_3d.php';
//include_once 'ofc_bar_3d.php';
include_once 'ofc_hbar.php';
include_once 'ofc_line_base.php';
include_once 'ofc_line.php';
include_once 'ofc_line_dot.php';
include_once 'ofc_line_hollow.php';
//include_once 'ofc_line_dot.php';
//include_once 'ofc_line_hollow.php';
include_once 'ofc_candle.php';
include_once 'ofc_area_base.php';
include_once 'ofc_tags.php';
include_once 'ofc_arrow.php';
//include_once 'ofc_area_hollow.php';
//include_once 'ofc_area_line.php';
include_once 'ofc_x_legend.php';
include_once 'ofc_y_legend.php';
include_once 'ofc_bar_sketch.php';
@@ -49,6 +57,9 @@ include_once 'ofc_radar_axis_labels.php';
include_once 'ofc_radar_spoke_labels.php';
include_once 'ofc_line_style.php';
include_once 'dot_base.php';
include_once 'ofc_menu.php';
class open_flash_chart
{
function open_flash_chart()
@@ -112,6 +123,35 @@ class open_flash_chart
$this->tooltip = $tooltip;
}
/**
* This is a bit funky :(
*
* @param $num_decimals as integer. Truncate the decimals to $num_decimals, e.g. set it
* to 5 and 3.333333333 will display as 3.33333. 2.0 will display as 2 (or 2.00000 - see below)
* @param $is_fixed_num_decimals_forced as boolean. If true it will pad the decimals.
* @param $is_decimal_separator_comma as boolean
* @param $is_thousand_separator_disabled as boolean
*
* This needs a bit of love and attention
*/
function set_number_format($num_decimals, $is_fixed_num_decimals_forced, $is_decimal_separator_comma, $is_thousand_separator_disabled )
{
$this->num_decimals = $num_decimals;
$this->is_fixed_num_decimals_forced = $is_fixed_num_decimals_forced;
$this->is_decimal_separator_comma = $is_decimal_separator_comma;
$this->is_thousand_separator_disabled = $is_thousand_separator_disabled;
}
/**
* This is experimental and will change as we make it work
*
* @param $m as ofc_menu
*/
function set_menu($m)
{
$this->menu = $m;
}
function toString()
{
if (function_exists('json_encode'))

File diff suppressed because it is too large Load Diff