Skip to content

Commit

Permalink
update custom series usage example within the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SlicedSilver committed Oct 8, 2023
1 parent b7101dc commit a976927
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions website/docs/plugins/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ WhitespaceData interface (have a valid time property for each data point).

A custom series can be added to a chart using the
[`addCustomSeries`](../api/interfaces/IChartApi.md#addcustomseries) method
which expects a class implementing the
which expects an instance of a class implementing the
[ICustomSeriesPaneView](../api/interfaces/ICustomSeriesPaneView.md) interface
as the first argument, and an optional set of options as the second argument.
The series can then be used just like any other series, for example you would
Expand All @@ -55,8 +55,11 @@ class MyCustomSeries {
/* Class implementing the ICustomSeriesPaneView interface */
}

// Create an instantiated custom series.
const customSeriesInstance = new MyCustomSeries();

const chart = createChart(document.getElementById('container'));
const myCustomSeries = chart.addCustomSeries(MyCustomSeries, {
const myCustomSeries = chart.addCustomSeries(customSeriesInstance, {
// options for the MyCustomSeries
customOption: 10,
});
Expand Down
7 changes: 5 additions & 2 deletions website/versioned_docs/version-4.1/plugins/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ WhitespaceData interface (have a valid time property for each data point).

A custom series can be added to a chart using the
[`addCustomSeries`](../api/interfaces/IChartApi.md#addcustomseries) method
which expects a class implementing the
which expects an instance of a class implementing the
[ICustomSeriesPaneView](../api/interfaces/ICustomSeriesPaneView.md) interface
as the first argument, and an optional set of options as the second argument.
The series can then be used just like any other series, for example you would
Expand All @@ -55,8 +55,11 @@ class MyCustomSeries {
/* Class implementing the ICustomSeriesPaneView interface */
}

// Create an instantiated custom series.
const customSeriesInstance = new MyCustomSeries();

const chart = createChart(document.getElementById('container'));
const myCustomSeries = chart.addCustomSeries(MyCustomSeries, {
const myCustomSeries = chart.addCustomSeries(customSeriesInstance, {
// options for the MyCustomSeries
customOption: 10,
});
Expand Down

0 comments on commit a976927

Please sign in to comment.