Hi RS,
super Skript! Danke.
Ich habe allerdings noch so ein Problemchen 
Alles nach Anleitung gemacht - allerdings weiss ich nicht genau, was ich bei diesem Eintragmachen soll:
$HC_WFE_CSS = ‚ips_pingdom.js‘;
Ich finde die Datei nirgends …
Dann habe ich noch das Problem, dass die Highstocks nicht angezeigt werden…
Im Code steht lediglich folgendes:
<div style="width: 100%; height: 240px; margin: 0 auto" id="container"></div>
DasTemplate hier verwende ich:
<?php
// ab IPS-Highcharts Script V2.0000
// 07.05.2012 ge㭤ert auf jquery/1.7.2
//echo 'aaaaaaaaaaaaaaaaa';
if (!isset($_GET['CfgFile']))
{
$CfgFile = false;
}
else
{
$CfgFile = $_GET['CfgFile'];
}
if (!isset($_GET['ScriptId']))
{
$iScriptId = false;
}
else
{
$iScriptId = (int)$_GET['ScriptId'];
}
// ScriptId wurde �ben -> aktuelle Daten werden geholt
if ($iScriptId != false)
{
$ConfigScript=IPS_GetScript($iScriptId); // Id des Config Scripts
include_once(IPS_GetKernelDir() . "scripts\\" .$ConfigScript['ScriptFile']);
global $sConfig;
//$sConfig = IPS_RunScriptWait($iScriptId);
$s = utf8_encode($sConfig);
}
// Filename w�bergeben -> Daten aus Datei lesen
else if ($CfgFile != false)
{
// pr�b �ben Datei existiert
if (!file_exists($CfgFile))
{
echo "Datei '$CfgFile' nicht vorhanden!!!";
return;
}
// file vorhanden -> einlesen
$handle = fopen($CfgFile,"r");
$s ="";
while (!feof($handle))
{
$s .= fgets($handle);
}
fclose($handle);
$s = utf8_encode($s);
}
else
{
echo "Achtung! Fehlerhafte Parameter CfgFile bzw ScriptId";
return;
}
// Bereiche splitten -> erster Teil sind diverse Config Infos, zweiter Teik sind die Daten f�hcharts
$s = explode("|||" , $s);
if (count($s) >= 2)
{
$TempString = trim($s[0],"
");
$JavaScriptConfigForHighchart = $s[1];
$LangOptions="lang: {}";
if (count($s) > 2)
$LangOptions = trim($s[2],"
");
// aus den Daten ein sch� Array machen
$TempStringArr = explode("
", $TempString);
foreach($TempStringArr as $Item)
{
$KeyValue = explode("=>", $Item);
$AdditionalConfigData[trim($KeyValue[0]," []")] = trim($KeyValue[1]," ");
}
// Verzeichnis + Theme
if ($AdditionalConfigData['Theme'] != '')
$AdditionalConfigData['Theme']= 'js/themes/' . $AdditionalConfigData['Theme'];
//$AdditionalConfigData["Height"]="1200px";
//$AdditionalConfigData["Width"]="600px";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Highcharts</title>
<!-- 1. Add these JavaScript inclusions in the head of your page -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="js/highstock.js"></script>
<!-- 1a) add a theme file -->
<script type="text/javascript" src="<?php echo $AdditionalConfigData['Theme'] ?>"></script>
<!-- 1b) the exporting module -->
<script type="text/javascript" src="js/modules/exporting.js"></script>
<!-- 2. Add the JavaScript to initialize the chart on document ready -->
<script type="text/javascript">
var chart;
Highcharts.setOptions({<?php echo $LangOptions; ?>});
$(document).ready(function() {
chart = new Highcharts.StockChart({<?php echo $JavaScriptConfigForHighchart; ?>});
</script>
</head>
<body>
<!-- 3. Add the container -->
<div id="container" style="width: <?php echo $AdditionalConfigData['Width'] ?>; height: <?php echo $AdditionalConfigData['Height'] ?>; margin: 0 auto"></div>
</body>
</html>
Selbst dieses simple Testskript bleibt leer:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Highstock Example</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
var chart;
Highcharts.setOptions({lang:{decimalPoint:',',thousandsSep:'.',rangeSelectorZoom:'',months:['Januar','Februar','M\u00e4rz','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],shortMonths:['Jan','Feb','M\u00e4r','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],weekdays:['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag']}});
$(document).ready(function() {
chart = new Highcharts.StockChart({
chart:{zoomType:'x',renderTo:'container'},credits:{enabled:true,href:'',text:'test.de',position:{align:'right',x:-10,verticalAlign:'top',y:15}},legend:{enabled:true,layout:'horizontal',shadow:true,floating:true,verticalAlign:'top',y:50,align:'right',x:100},loading:{showDuration:200},plotOptions:{column:{borderColor:'#666666',borderWidth:0,shadow:true}},exporting:{enabled:false,buttons:{printButton:{enabled:false}}},title:{text:'Tageswerte'},subtitle:{text:'Zeitraum: (Mi) 01.01.2014 00:00 - (Fr) 28.11.2014 17:59'},tooltip:{useHTML:true,shared:true,yDecimals:2,crosshairs:[{width:1,color:'grey',dashStyle:'dashdot'},{width:1,color:'grey',dashStyle:'dashdot'}],formatter:function() { var s; var s = '<b>' + Highcharts.dateFormat('%A, %d.%m.%Y', this.x) + '<\/b><br>'; s += '<table width="150" cellspacing="0" cellpadding="0">'; $.each(this.points, function(i, point) { var unit ={'Verf\u00fcgbarkeit': '%','Response-Time NA': 'ms','Response-Time Gesamt': 'ms','Response-Time EU': 'ms','': '','': '','': '',} [this.series.name]; s += '<td>' + point.series.name + ': <\/td><td align=right><span style=color:' + this.series.color + '>' + this.y + unit + '<\/span><\/td>';s += '<\/tr>'; }); s += '<\/table>'; return s; } },xAxis:{type:'datetime',dateTimeLabelFormats:{second:'%H:%M:%S',minute:'%H:%M',hour:'%H:%M',day:'%e. %b',week:'%e. %b',month:'%b %y',year:'%Y'},allowDecimals:false,min:Date.UTC(2014,0,1,00,00,00),max:Date.UTC(2014,10,28,17,59,00)},yAxis:[{title:{text:'Response-Time (ms)',style:{color:'#555555'}},enabled:true,Unit:null,opposite:true,allowDecimals:true,min:null,tickInterval:null,max:null,offset:40,labels:{style:{color:'#555555'}}},{title:{text:'Verf\u00fcgbarkeit (%)',style:{color:'#B60101'}},enabled:true,Unit:null,opposite:false,allowDecimals:false,min:null,tickInterval:null,max:100,offset:30,labels:{style:{color:'#B60101'}}}],navigator:{enabled:true,baseSeries:[0,1],height:25,margin:10,maskFill:'rgba(150,150,150, 0.4)',series:{type:'areaspline',color:'#FF0000',fillOpacity:0.3,dataGrouping:{smoothed:true},lineWidth:0}},rangeSelector:{selected:0,inputEnabled:false,buttons:[{type:'month',count:3,text:'3M'},{type:'month',count:6,text:'6M'},{type:'ytd',text:'YtD'},{type:'year',count:1,text:'1Y'},{type:'all',text:'All'}],buttonSpacing:2},scrollbar:{enabled:false},series:[{zIndex:100,type:'spline',step:false,yAxis:1,visible:true,showInLegend:false,color:'#FF0000',fillOpacity:0.5,shadow:true,lineWidth:1,states:{hover:{lineWidth:2}},marker:{enabled:false,symbol:'circle',states:{hover:{enabled:true,symbol:'circle',radius:4,lineWidth:1}}},name:'Verf\u00fcgbarkeit',data:[{humanDate:'26.11.2014, 00:00:00',x:Date.UTC(2014,10,26,00,00,00),y:100},{humanDate:'27.11.2014, 00:00:00',x:Date.UTC(2014,10,27,00,00,00),y:99.65},{humanDate:'28.11.2014, 00:00:00',x:Date.UTC(2014,10,28,00,00,00),y:99.65}]},{zIndex:20,type:'areaspline',step:false,yAxis:0,visible:true,showInLegend:false,color:'#666666',fillOpacity:0.3,shadow:true,lineWidth:1,states:{hover:{lineWidth:1}},marker:{enabled:false,symbol:'circle',states:{hover:{enabled:true,symbol:'circle',radius:4,lineWidth:1}}},name:'Response-Time NA',data:[{humanDate:'26.11.2014, 00:00:00',x:Date.UTC(2014,10,26,00,00,00),y:651},{humanDate:'27.11.2014, 00:00:00',x:Date.UTC(2014,10,27,00,00,00),y:612},{humanDate:'28.11.2014, 00:00:00',x:Date.UTC(2014,10,28,00,00,00),y:631}]},{zIndex:30,type:'areaspline',step:false,yAxis:0,visible:true,showInLegend:false,color:'#ABABAB',fillOpacity:0.2,shadow:true,lineWidth:2,states:{hover:{lineWidth:3}},marker:{enabled:false,symbol:'circle',states:{hover:{enabled:true,symbol:'circle',radius:4,lineWidth:1}}},name:'Response-Time Gesamt',data:[{humanDate:'26.11.2014, 00:00:00',x:Date.UTC(2014,10,26,00,00,00),y:497},{humanDate:'27.11.2014, 00:00:00',x:Date.UTC(2014,10,27,00,00,00),y:467},{humanDate:'28.11.2014, 00:00:00',x:Date.UTC(2014,10,28,00,00,00),y:475}]},{zIndex:40,type:'areaspline',step:false,yAxis:0,visible:true,showInLegend:false,color:'#777777',fillOpacity:0.4,shadow:true,lineWidth:1,states:{hover:{lineWidth:1}},marker:{enabled:false,symbol:'circle',states:{hover:{enabled:true,symbol:'circle',radius:4,lineWidth:1}}},name:'Response-Time EU',data:[{humanDate:'26.11.2014, 00:00:00',x:Date.UTC(2014,10,26,00,00,00),y:350},{humanDate:'27.11.2014, 00:00:00',x:Date.UTC(2014,10,27,00,00,00),y:324},{humanDate:'28.11.2014, 00:00:00',x:Date.UTC(2014,10,28,00,00,00),y:317}]}]});
});
</script>
</head>
<body>
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/modules/exporting.js"></script>
<div id="container" style="height: 500px; min-width: 500px"></div>
</body>
</html>
Hatte die Werte mal aus IPS rauskopiert.
Habe ich irgendetwas vergessen bzw. kannst du mir mal ein paar Debug-Tipps geben … Danke