angular-dchart
angular-dchart copied to clipboard
Neither axis nor data-set values updating in keeping with controller scope values
I have a route with a template:
{{graphLabels.xAxis}} {{graphLabels.yAxis}} Num Records = {{numRecords}}, Array Length={{graphData.length}}, Y Axis={{graphLabels.yAxis}}, X Axis={{ graphLabels.xAxis}}
(I can't make this show the HTML elements within this comment... grrr)
This has a controller which has, in part:
$scope.graphData=[
{label:"monday",y:10},
{label:"tuesday",y:20},
{label:"wednesday",y:5},
{label:"thursday",y:3},
{label:"friday",y:3},
{label:"saturday",y:5},
{label:"sunday",y:3}
];
$scope.numRecords = 0;
$scope.graphLabels = {xAxis:"",yAxis:""};
The hardset graphData shown here does display in the chart, but any changes to that array makes no difference to what's shown in the chart.
The two axis labels don't databind at all.
The div with text databound to the various attributes works fine. So something is wrong with the chart component, and it's not updating on scope change I think.
I have a similar problem where data that is written to $scope on controller load is shown fine but any changes to datasets binded to scope later after async calls don't get drawn. Makes the library pretty much useless.
I have currently no time to fix these problems, sorry. there is a pretty nice angular-chart library, that you should check out instead: http://n3-charts.github.io/line-chart/#/