Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Legend not updating when dataseries are removed

$
0
0

Thanks Iliana,
This is how I remove the series:

function getConfiguration () {
            dataService.getGraphConfigurations(that.graphid).then(function (result) {
                var configurations = result.data;
                var chartOptions = that.chartobject.options;
         clearCollection(chartOptions.series);
                angular.forEach(configurations, function (config) {
                    chartOptions.series.push({
                        categoryField: "date",
                        name: config.name,
                        field: config.seriesKey,
                        type: "line",
                        markers: {
                            size: 2
                        },
                        tooltip: {
                            visible: true,
                            template: getTooltipTemplate(config.formatAs)
                        }
                    });
                });
                refreshData();
                that.chartobject.redraw();
            });
        }
  
  clearCollection(series){
   while(series.length > 0){
    series.pop();
   }
  }


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>