Comments (6)
You can use this addon to render several chart gauges on the same page. I think the .on('init')
method is over complicating things. Instead, you just need to define separate chartOptions
and content
for each chart gauge. For example, in your controller/component your setup would something look like this:
export default Ember.Controller.extend({
chartOptions1: {
chart: {
type: 'solidgauge'
},
// add content
},
chartData1: [
// add content
],
chartOptions2: {
chart: {
type: 'solidgauge'
},
// add content
},
chartData2: [
// add content
],
chartOptions2: {
chart: {
type: 'solidgauge'
},
// add content
},
chartData2: [
// add content
],
// add chartOptions3, chartOptions4, etc
});
First try and get things working with this approach. Then after that, you can dry things up. For example. if your chartOptions
are very similar for all 8 chart gauges than they can all share the same chartOptions and you can make certain attributes of those configurable. You can do this by making chartOptions a computed property:
export default Ember.Component.extend({
chartOptions: Ember.computed(function () {
return {
chart: {
type: 'solidgauge'
},
title: {
text: this.get('title')
},
...
}
})
...
});
from ember-highcharts.
Thanks @gregjopa!
I was getting frustrated with getting this to work. I really like the approach of the computed properties, thats essentially exactly what I wanted to do! I got it working now!
from ember-highcharts.
Happy to help!
from ember-highcharts.
I'm noticing that when the value for the gauge changes, the gauge resets to 0 then goes back up to the newly changed value. Is there a way to adjust the gauge at its current value and animate it to the new value, rather than going back to 0 first?
from ember-highcharts.
We currently call redraw
when updating chart data: https://github.com/ahmadsoe/ember-highcharts/blob/master/addon/components/high-charts.js#L96. This is probably causing the gauge to redraw from 0 everytime. The tricky thing with updating chart data with highcharts is every chart type has different updating logic. This addon currently does not support every use case.
You can extend this component and override the didReceiveAttrs()
method to have custom updating logic. I think you will need to call point.update(num)
similar to this demo: http://www.highcharts.com/demo/gauge-solid
from ember-highcharts.
Its not the end of the world, would just be nice, I'll give that approach a try. Thanks again!
from ember-highcharts.
Related Issues (20)
- Dynamically updating highcharts gauge HOT 1
- How write integration/acceptance tests with ember-highcharts? HOT 1
- Upgrade Hightcharts to get fix for getDistanceBetweenCirclesByOverlap logic HOT 1
- Cannot read property "forExport" of undefined HOT 3
- Build error with highcharts v7.1.2 in styled mode HOT 1
- Upgrade bootstrap to fix cross-site scripting vulnerability
- How to add support to accessibility? HOT 1
- How to pass an object to Highcharts.setOptions HOT 1
- Series with the same name (`series.name`) are "mysteriously" dropped when chart is re-rendered. HOT 1
- Changing Series changes order HOT 1
- ‘Cannot read property "forExport" of undefined’ when transitioning to a new route. HOT 1
- Replacing xAxis, and yAxis HOT 2
- [Octane] Glimmer component refactor HOT 1
- Modifier manager capabilities deprecating warning HOT 8
- I think v3.2.0 should have been a major version HOT 5
- How can one use Annotation module of highchart using ember-highcharts? HOT 1
- Getting https://assets.highcharts.com/errors/16/ error on EmberJS application HOT 1
- Replace `ember-holy-futuristic-template-namespacing-batman` with `ember-template-imports` HOT 2
- Using custom components in a chart
- Question: Can we use highchart version: 8.0.0 with ember-highchart version: 3.1.0 ? HOT 1
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 ember-highcharts.