Search code examples
angularjsd3.jschartsnvd3.jsangular-nvd3

Multiple connected one line charts with angular-nvd3


Is there is a way to create multiple connected one line charts with useInteractiveGuideline=true options. Such need is become when you need to show 3 different types of data on one graph (E.g. Fuel status, Engine working hours and water tank status ). Attached example by jquery-dygraph.

enter image description here

I tried to do this using ng-repeat, but only firts chart appears:

<div ng-repeat="data in widget.widgetData"> <nvd3 options="widget.widgetOptions" data="data" api="widget.api" on-ready="widget.onReadyCallback"></nvd3> </div>

where widget.widgetData is:

widget.widgetData = [[charts.fuelData],[charts.engineHoursData]];

My inner widget data object is:

fuelData: { values: [], key: 'Fuel', color: '#' + (Math.random() * 0xFFFFFF << 0).toString(16), strokeWidth: 1, classed: '' }, engineHoursData: { values: [], key: 'Engine Hours', color: '#' + (Math.random() * 0xFFFFFF << 0).toString(16), strokeWidth: 1, classed: '' }

If there is an option to do such behavior in this directive?


Solution

  • The solution was posted here If anybody need more deatils, you are welcome to ask :):):):):)