Skip to content

Commit

Permalink
core,extlib: drop Chart:clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Nov 6, 2023
1 parent c4833ee commit e31662b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
5 changes: 0 additions & 5 deletions core/extlib/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ local function makeChartClass(name)
end
}

function Chart:clear()
self.values = {}
return self
end

function Chart:push(x, y)
table.insert(self.values, { x = x; y = y })
return self
Expand Down
16 changes: 9 additions & 7 deletions manual/index.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ aggregated data to a window when applying a script.
{
math.min(table.unpack(state.ys)),
math.max(table.unpack(state.ys)),
(total / state.n)
total / state.n
}
)
),
Expand All @@ -922,7 +922,8 @@ aggregated data to a window when applying a script.
}

@deflua[render.VStack (...) Stack]{
Returns an instance of a view that renders its children vertically.
Returns an instance of a view that renders its children
vertically. See @lua[render.HStack] for a usage example.
}

@subsubsection{Charts}
Expand All @@ -937,14 +938,15 @@ See @secref["rendering-a-bar-chart"] for a usage example.
}

@deflua[Chart:push (x y) Chart]{
Pushes a new entry to the end of the chart. The first argument is the
x value and the second, the y value. Values may be either strings or
numbers, but the types should be internally consistent per axis.
Pushes a new entry to the end of the chart. The first argument is
the x value and the second, the y value. Values may be @tt{number}s,
@tt{string}s, @lua[render.Timestamp]s or @lua[render.Candlestick]s,
but the types should be internally consistent per axis.
}

@deflua[Chart:setvalues (...) Chart]{
Replaces all the chart values with @tt{...}. Each individual value
must be a table with @tt{x} and @tt{y} fields.
Replaces all the chart values with the given set of tables. Each
given value must be a table with @tt{x} and @tt{y} fields.
}

@deflua[Chart:setxscale (lo hi) Chart]{
Expand Down

0 comments on commit e31662b

Please sign in to comment.