62,272
社区成员
发帖
与我相关
我的任务
分享 function updateYValue(newYValue, dataPointIndex)
{
if (chart != null)
{
try
{
chart.Series[0].DataPoints[dataPointIndex].SetPropertyFromJs("YValue", newYValue);
}
catch (e)
{
}
}
}
function updateXValue(newXValue, dataPointIndex)
{
if (chart != null)
{
try
{
chart.Series[0].DataPoints[dataPointIndex].SetPropertyFromJs("AxisXLabel", newXValue);
}
catch (e)
{
}
}
}
/*
Timer function allows updating chart data with a time interval.
*/
function timer(code)
{
var listall=HFAirport_Pages_RMRealTimeStatus.XYValueList(code).value;
for(i=0;i<5;i++)
{
var x=listall[0][i];
var y=listall[1][i];
updateXValue(x,i);
updateYValue(y, i);
}
// Set timeout for timer() function
setTimeout("timer('"+code+"')", 1000);
} <div id="VisifireChart0">
<script type="text/javascript">
// Create Visifire object
var vChart = new Visifire('../../Js/SL.Visifire.Charts.xap', "MyChart", 200, 100);
var chartXml = '<vc:Chart xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts" Width="200" Height="100" AnimationEnabled="False" BorderThickness="0.5" Background="White" BorderBrush="Black" Padding="3">'
+ ' <vc:Chart.Titles>'
+ ' <vc:Title Text="UPS内部测量各项值" FontSize="12"/>'
+ ' </vc:Chart.Titles>'
+ ' <vc:Chart.Series>'
+ ' <vc:DataSeries RenderAs="Line" LabelEnabled="True">'
+ ' <vc:DataSeries.DataPoints>';
chartXml +=HFAirport_Pages_RMRealTimeStatus.GetPoints("UPS_NXHT").value;
chartXml +=' </vc:DataSeries.DataPoints>'
+ ' </vc:DataSeries>'
+ ' </vc:Chart.Series>'
+ ' </vc:Chart>';
// Set Chart XML
vChart.setDataXml(chartXml);
vChart.loaded = function(args)
{
chart = args[0]; // Chart reference.
// Start Timer
timer("UPS_NXHT");
}
// Render chart
vChart.render("VisifireChart0");
</script>
</div>