Comments (5)
@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.
from charts.
@ianjdarrow Hmm, would be easier to tell by seeing the usage. Can you share your code?
from charts.
Of course - thanks. Here's the code:
import Chart from "frappe-charts/dist/frappe-charts.min.esm";
const owners =
[{ name: 'Ian', shares: 60 },
{ name: 'Ben', shares: 50 }];
const dataset = {
labels: owners.map(owner => owner.name),
datasets: [{ values: owners.map(owner => owner.shares)}]
};
const chart = new Chart({
parent: '#chart',
data: dataset,
type: 'bar',
height: 250,
});
As I mentioned, the chart renders properly, but the desired methods don't seem to be exposed. The chart displays properly and console.log(chart)
yields a number of properties, but nothing from the API.
from charts.
@pratu16x7 thanks so much! Knowing that the functions were nested way down the prototype chain, I was able to confirm that they was there. I have this working now. Not 100% sure what the issue was – probably my own stupidity – but very grateful for your help and your work on this library.
from charts.
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.
from charts.
Related Issues (20)
- trancateLegends HOT 1
- A Year-wise Heatmap HOT 2
- How to create combo chart with Dual Y-Axis HOT 1
- Commas to large numbers HOT 1
- Donut chart vertical legend cut off HOT 2
- Bug: adding `lineOptions: { spline: 1 }` leads to a console error HOT 1
- Implement measures and style overrides HOT 1
- Hide parts of a dataset HOT 7
- how to implement a horizontal bar? HOT 1
- Line chart y-axis is dynamic instead of starting at Zero HOT 1
- Histogram Chart?
- Missing legend causes uncaught errors when updateing data.
- How to declare HTML for charts' labels? HOT 1
- How to get the same design as the website example? HOT 2
- multiple numbers are overwritten for valuesOverPoints set to 1 HOT 2
- Pie Inline Labels HOT 4
- Console errors reporting NaN HOT 1
- Use a linear gradient as line color
- Promise or event for render complete? HOT 1
- Feature Request: Total in tooltip for area chart regionFill
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from charts.