Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #113109
    alex.morris22
    Participant

    What is the best way to update series data in Smart Chart without reloading?

    #113111
    Markov
    Keymaster

    Hi,

    @ViewChild('chart', { static: false }) chart: any;
    
    data = [
      { month: 'Jan', value: 30 },
      { month: 'Feb', value: 45 },
      { month: 'Mar', value: 25 }
    ];
    
    seriesGroups = [
      {
        type: 'column',
        series: [{ dataField: 'value', displayText: 'Sales' }]
      }
    ];
    
    updateData() {
      // Update an existing point
      this.data[1].value = 60;
    
      // Notify the chart to refresh its visuals
      this.chart.refresh();
    }

    In the above example, we update the data and refresh the chart visuals.

    Best regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.