question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to expose `update_values` and `add_data_point` functions?

See original GitHub issue

When creating a new Chart object per the docs, the chart renders correctly but the functions referenced in the docs (including update_values and add_data_point) don’t appear to be included in the newly-created object. This is true for both LineChart and BarChart, both of which inherit AxisChart where the desired methods live. Grateful for any assistance folks can provide in exposing these functions.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
pratu16x7commented, Nov 12, 2017

@ianjdarrow You’ll find them quite down nested in the prototype chain of the Chart object in the console output, given the inheritance. Aside, have you tried actually running the function? I assumed that the functions themselves didn’t work.

0reactions
pascalwcommented, Jan 30, 2018

It looks like these functions are not available on all chart types. For example PercentageChart extends from BaseChart which doesn’t have the update_values function. Is there a way to dynamically update a PercentageChart?

I’m now using this, which seems to work:

this.frappe.data = nextProps.data;
this.frappe.refresh(true);

Is this the right way to do it? Would be nice if all charts could implement these functions for a consistent API.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add Data Points to Existing Chart - Excel & Google Sheets
This tutorial will demonstrate how to add a Single Data Point to Graph in Excel & Google Sheets. Add a Single Data Point...
Read more >
Plug-in API Reference: BeamDialog Class Reference - SIMDIS
Updates the enable/disable for several buttons. More... - Protected Member Functions inherited from PIGUI::PIDialogBox · PIDialogBox (). Inherited constructor, ...
Read more >
Dynamically update values of a chartjs chart - Stack Overflow
Here is how to do it in the last version of ChartJs: setInterval(function ...
Read more >
How to add different data for two lines in one dynamic graph?
Hi,i want to make a oscilloscope to show two data curve. ... These two lines show the same data,becuse the addDataPoint function can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found