如何动态改变线性规融合图上的指针位置

发布于 2024-12-05 15:57:35 字数 283 浏览 3 评论 0原文

我有线性量表融合图表,指针位于图表上方,其中指针值不断动态更新,并且我尝试根据 xml 文件中的值定位指针,但我面临的问题是每次重新定位指针时,整个图表被刷新,我的要求是仅重新定位指针,完整的图表不应刷新,任何人都可以帮助实现此功能,我正在尝试遵循以下链接中显示的示例http://www.fusioncharts.com/widgets/Gallery/Linear3.html

I have linear guage fusion chart with pointer above the chart, where the pointer value keeps updating dynamically , and i am trying to position the pointer based on the value in xml file,but the problem i am facing is each time pointer gets repositioned , the whole graph gets refreshed , my requirement is to reposition only the pointer, the complete chart should not be refreshed , can any one help, to implement this functionality, i am trying to follow the example shown in following link http://www.fusioncharts.com/widgets/Gallery/Linear3.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温馨耳语 2024-12-12 15:57:35

您始终可以使用 JavaScript 或实时数据流来更新线性仪表的指针值。

假设您使用以下 XML 创建了图表:

<chart lowerLimit='0' upperLimit='100' lowerLimitDisplay='Bad' upperLimitDisplay='Good' palette='1' numberSuffix='%' chartRightMargin='20'>
   <colorRange>
      <color minValue='0' maxValue='75' code='FF654F' label='Bad'/>
      <color minValue='75' maxValue='90' code='F6BD0F' label='Moderate'/>
      <color minValue='90' maxValue='100' code='8BBA00' label='Good'/>
   </colorRange>
   <pointers>
      <pointer value='92' />
   </pointers>
</chart>

并且使用以下 JavaScript 呈现图表:

var myChart = new FusionCharts("Charts/HLinearGauge.swf", "myChartId", "450", "120", "0", "1");
myChart.setDataURL("Data/Linear3.xml");
myChart.render("chartdiv");

现在您可以使用以下 JavaScript 代码更新此图表:

getChartFromId("myChartId").setData(1, 20);

还有其他 API 函数,例如:setDataForId(Id, value) 或 feedData (updateDataQueryString)

例如,

getChartFromId("myChartId").setDataForId("p1", 40) ;// this requires the pointer to be set with an id which needs to be provided here as the first parameter 

或者

getChartFromId("myChartId").feedData("&value=90") ;

您也可以使用它来仅更新现有仪表的数据。

欲了解更多信息,请阅读:
http://www.fusioncharts.com/widgets/docs/Contents/Linear_JSPAPI.html

详细了解如何使用服务器端实时数据流来更新仪表数据:
http://www.fusioncharts.com/widgets/docs/Contents/Linear_RealTime.html

为此,您需要创建数据提供程序页面,其输出将是查询字符串格式的单行字符串,例如:&value=30

You can always update the Linear Gauge's pointer's value using JavaScript or real-time data streaming.

Say for instance you have created the chart using the following XML :

<chart lowerLimit='0' upperLimit='100' lowerLimitDisplay='Bad' upperLimitDisplay='Good' palette='1' numberSuffix='%' chartRightMargin='20'>
   <colorRange>
      <color minValue='0' maxValue='75' code='FF654F' label='Bad'/>
      <color minValue='75' maxValue='90' code='F6BD0F' label='Moderate'/>
      <color minValue='90' maxValue='100' code='8BBA00' label='Good'/>
   </colorRange>
   <pointers>
      <pointer value='92' />
   </pointers>
</chart>

and the Chart is rendered using the following JavaScript :

var myChart = new FusionCharts("Charts/HLinearGauge.swf", "myChartId", "450", "120", "0", "1");
myChart.setDataURL("Data/Linear3.xml");
myChart.render("chartdiv");

Now you can update this chart using the following JavaScript code:

getChartFromId("myChartId").setData(1, 20);

There are other API functions like: setDataForId(Id, value) or feedData(updateDataQueryString)

e.g.,

getChartFromId("myChartId").setDataForId("p1", 40) ;// this requires the pointer to be set with an id which needs to be provided here as the first parameter 

or

getChartFromId("myChartId").feedData("&value=90") ;

which you can also use to update only the data of an existing gauge.

For more information please read:
http://www.fusioncharts.com/widgets/docs/Contents/Linear_JSPAPI.html

Read more on how to use Server side real time data streaming to update the gauge's data from:
http://www.fusioncharts.com/widgets/docs/Contents/Linear_RealTime.html

For this you would need to create the dat provider page whose output would be a single line string in query string format like: &value=30

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文