Question about Google Chart and Plotting n General


When I tried out google chart, I noticed that setting the ChartType to scatter resulting in a line graph.

I used the following code to initialize the chart

  y1 := chart.Series.Add;
  y1.ChartType := gctScatter;
  y1.Line.PointSize := 0;

I then called the follwing to add data points to the chart. 

y1.Values.AddXYPoint (time, y);

For some reason I'm getting a line graph not a scatter graph. If I set the type to a gctLine then it only plots the X points as a line not the Y points. 

Is Google chart the right widget to use, would jQuery of FNC Chart be a better choice. I assume that FNC Chart is better documented for use with TMS Web Core. 

Try


WebGoogleChart.BeginUpdate;
// setup chart code
WebGoogleChart.EndUpdate;

I had beginupdate and endupdate in the code but now I moved  beginupdate just before creating the series but it makes no diffierence. It still plots a line plot when I set the charttype to scatter. Here is some simplified code that shows this:

Image of plot:

https://imgur.com/a/E28hfGO

Setting the charttype to line just plots the X variable. I had a quick look at the WebLib.GoogleChart.pas but couldn't see anything obvious that might be wrong. 


procedure TfrmMain.WebButton1Click(Sender: TObject);
var i : integer;
    y1 : TGoogleChartSeriesItem;
begin
  chart.BeginUpdate;
  y1 := chart.Series.Add;
  y1.ChartType := gctScatter;
  y1.Line.PointSize := 8;

   for i := 1 to 10 do
      y1.Values.AddXYPoint (i, random);
  chart.EndUpdate;
end;

Figure it out, you have to set the linewidth to zero to get a scatter plot