Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8635835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:04:21+00:00 2026-06-12T10:04:21+00:00

I want to add a series to a highchart scatterplot where I am naming

  • 0

I want to add a series to a highchart scatterplot where I am naming each point in the series. I create a chart in the following way:

var chart; // globally available

makeCharts = function(){

      chart = new Highcharts.Chart({
         chart: {
            renderTo: 'container1',
            type: 'scatter'
         },        
         series: [{
            name: 'a',
                data: [{                    
                    'id': 'point1',
                    'x': 1,
                    'y': 2
                }, {
                    'id': 'point2',
                    'x': 2,
                    'y': 5
                }]
            }]

      });
}

I would like to be able to update the points on the chart using something like:

chart.series[0].setData([{id:['point3', 'point4', 'point5'], y:[0,1,2], x:[1,2,3]}])

but this is not correct. Is it possible to update a chart using this approach where each point has an ID?

EDIT:

Just to clarify, I would like to be able to pass the arrays directly, rather than adding the data point by point using addPoint(). I could loop through an array and use addPoint() doing something like this:

id:['point3', 'point4', 'point5'];
y:[0,1,2];
x:[1,2,3];

for (i=0; i<x.length; i++)
  {
  chart.series[0].addPoint({
    x:  x[[i],
    y:  y[i],
    id: id[i]
});

  }

However, this is very slow. It’s much quicker to add data using the following approach:

chart.series[0].setData([[1,0],[2,1],[3,2]]);

I have found that I can add data like this:

 chart.series[0].setData([[1,0, 'point3'],[2,1, 'point4'],[3,2, 'point5']]);

but then the only way that I can access the id when the point is selected, is through this.point.config[2]. With the following approach I am unable to use chart.get('pointID') to identify a point as I did not set the ID. I want to be able to identify the point using just the ID.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:04:22+00:00Added an answer on June 12, 2026 at 10:04 am

    Well broadly speaking there are two ways in which you can modify the chart data dynamically

    1. Series.setData() Use this approach when you want to completely replace the existing data with some new data
    2. Series.addPoint() Use this approach when you want to add a subset of the points dynamically. This method is not just for adding one point at a time, if you read the documentation carefully again you will find that this method takes a boolean redraw argument, and the argument detail is as following

    redraw: Boolean
    Defaults to true. Whether to redraw the chart after
    the point is added. When adding more than one point, it is highly
    recommended that the redraw option beset to false, and instead
    chart.redraw() is explicitly called after the adding of points is
    finished.

    In your case, since you want to add a few points dynamically, but retaining the existing points, you should go with approach 2. But you need to use it inside a loop, with the redraw being set to false (hence solving the problem of being slow) and then after the loop, call the redraw method explicitly

    Code

    var id = ['point3', 'point4', 'point5'],
        y = [0, 1, 2],
        x = [1, 2, 3];
    
    for (var i = 0; i < x.length; i++) {
        chart.series[0].addPoint({
            x: x[i],
            y: y[i],
            id: id[i]
        },false);
    }
    chart.redraw();
    

    Adding multiple points dynamically | Highcharts and Highstock @ jsFiddle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add a copyright notice to a series of files generated in
Using jquery I want to add an id to a series of divs, but
I have a FlowLayoutPanel and want to add series of UserControl to it: mainPanel.Controls.Add(fx);
I want to add a series of files previously extracted from other files(already done)
I want to display 3 series on my Silverlight toolkit horizontal bar chart...2 normal
i have add three series in a stacked graph. i want to add value
I have a column chart with multiple series each containing multiple points. Currently the
I have a series of functions that I want to have the following functionality.
I want to create a chart with Microsoft's Chart Controls, which looks like this
I want to add a series of strings to a combo box using std::for_each.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.