Predix_Logo
  • Categories
    • Questions
    • Predix | Updates
      • Pricing
      • Product
    • Deloitte - Private
    • How-To
    • Accenture-Private
  • Explore
    • Topics
    • Questions
    • Articles
    • Feedback or Feature Requests
  • Sign in
  • Home /
  • Questions /
avatar image
0
Question by Mirco · Oct 04, 2016 at 06:49 AM · px-vis-timeseriespx-chart

px-vis-timeseries data update

Is there anything similar to the px-chart updateSeries(seriesId, data, noRedraw) method?

What's the best way to update series data on the chart?

Thanks

Comment
Add comment
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

  • Sort: 
avatar image
3
Best Answer

Answer by Benoit Chevalier · Oct 04, 2016 at 09:13 AM

Hello,

You can update the data of the chart by either:

-directly re-setting the chart data object with your new data in it, I.e yourChart.chartData = theCompleteDataObject

-push data in your chart object using the polymer API, I.e yourChart.push(‘chartData’, dataToBePushed) . By using the polymer API rather than using a “normal” push you ensure that Polymer will do the notification work needed for the new data to be processed.

Hope that helps.

Cheers, Ben

Comment
Add comment · Show 4 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dave.dauenhauer@ge.com · Jan 06, 2017 at 12:50 PM 0
Share

Does anyone have code examples of how to push new data points to the timeseries example of dashboard seed?

Thanks, Dave

avatar image Randy Askin dave.dauenhauer@ge.com · Jan 06, 2017 at 01:53 PM 0
Share

yourChart.push will work with a single data point object at a time, if you're handling points in real-time. You can do multiple with .push if they're comma-separated as arguments (see Polymer array mutation) . You can also take the old chartData object, concat with new data points, and use yourChart.set with the new array. Here's an example of that: http://codepen.io/randyaskin/pen/jyPmpL?editors=1000

There seems to be an issue with re-calculating the new domain automatically in the v1.0.0-alpha version of px-vis-timeseries (which CodePen automatically pulls in) - the v0.6.4 stable version may not need that extra step.

The team is also working on some updates that will make handling of real-time data much easier, stay tuned for that.

avatar image Randy Askin Randy Askin · Jan 06, 2017 at 03:15 PM 0
Share

Here's an example of using .push for one data point at a time - looks pretty cool! http://codepen.io/randyaskin/pen/VPLWPa?editors=1000

If you set the left-bound of selectedDomain.x to time - someValue then it achieves a panning effect instead of a zooming effect, similar to HighCharts.

avatar image dave.dauenhauer@ge.com · Jan 07, 2017 at 07:09 AM 0
Share

Thanks Randy, that codepen example was just what I needed! Thanks much!

avatar image
0

Answer by Mirco · Oct 04, 2016 at 01:26 PM

Thanks for your responses.

The idea is not to replace the entire dataObject but just push new values.

this way should avoid a complete redraw for the chart with a smooth transition on it, right?

Comment
Add comment · Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Elliot Nahman · Oct 05, 2016 at 09:54 AM 0
Share

Use the push method per Ben's response.

avatar image
0

Answer by Elliot Nahman · Oct 04, 2016 at 09:28 AM

If directly re-setting doesnt work, you may need to use the Polymer set method.

  yourChart.set('chartData', completeDataObj);





Comment
Add comment · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

48 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How we can change chart type from drop-down in px-chart / px-vis-timeseries ? 2 Answers

click event on data point in px-vis-xy-chart 5 Answers

Time Series plot update 1 Answer

px-vis-timeseries display issues running on chrome 2 Answers

Change marker shape in timeseries or xy chart 1 Answer

GE Monogram
  • Legal
  • Cookies
  • Forum Terms
  • Contact Us
  • Copyright © 2017 General Electric Company. All rights reserved.


Enterprise
Social Q&A

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Submit your feedback or feature request
  • Categories
  • Questions
  • Predix | Updates
    • Pricing
    • Product
  • Deloitte - Private
  • How-To
  • Accenture-Private
  • Explore
  • Topics
  • Questions
  • Articles
  • Feedback or Feature Requests