Skip to content
OliverF edited this page Jun 12, 2014 · 2 revisions

Sets the data points of the chart's series.

Syntax

nil chart:SetXY(table data, string seriesName)

Returns

  1. nil

Arguments

  1. table data
    A table containing sub-tables representing each data point. The sub-tables each contain one X value and one Y value, indexed x and y respectively. See the example for more details.
  2. string seriesName
    Specifies the chart's series to update. The series must be created with Chart:CreateSeries() first.

Example

local chart = RSAS.GUI.Control("chart", "demo_chart")

chart:CreateSeries("My Test Series", "line")

local myData = {}
table.insert(myData, {x = 0, y = 1})
table.insert(myData, {x = 1, y = 3})
table.insert(myData, {x = 2, y = 4})
table.insert(myData, {x = 3, y = 8})

chart:SetXY(myData, "My Test Series")

Clone this wiki locally