8
8
const lcjs = require ( '@lightningchart/lcjs' )
9
9
10
10
// Extract required parts from LightningChartJS.
11
- const { lightningChart, AreaSeriesTypes, UIElementBuilders, LegendBoxBuilders , PointShape, Themes } = lcjs
11
+ const { lightningChart, AreaSeriesTypes, UIElementBuilders, PointShape, Themes } = lcjs
12
12
13
13
// Create a XY Chart.
14
14
const xyChart = lightningChart ( {
@@ -19,15 +19,6 @@ const xyChart = lightningChart({
19
19
} )
20
20
. setTitle ( 'Expected Profits To Expenses' )
21
21
22
- // Create a LegendBox as part of the chart.
23
- const legend = xyChart
24
- . addLegendBox ( LegendBoxBuilders . HorizontalLegendBox )
25
- // Dispose example UI elements automatically if they take too much space. This is to avoid bad UI on mobile / etc. devices.
26
- . setAutoDispose ( {
27
- type : 'max-width' ,
28
- maxWidth : 0.8 ,
29
- } )
30
-
31
22
// ---- Add multiple Area series with different baselines and direction. ----
32
23
const areaProfit = xyChart . addAreaSeries ( { type : AreaSeriesTypes . Positive } ) . setName ( 'Profits' )
33
24
@@ -146,12 +137,8 @@ const expensesData = [
146
137
147
138
// ---- Generate points using 'xydata'-library and add it to every plot. ----
148
139
profitData . forEach ( ( point ) => {
149
- areaProfit . add ( point )
140
+ areaProfit . appendSample ( point )
150
141
} )
151
142
expensesData . forEach ( ( point ) => {
152
- areaExpense . add ( point )
143
+ areaExpense . appendSample ( point )
153
144
} )
154
-
155
- // Add series to LegendBox and style entries.
156
- legend . add ( areaProfit , true , 'Expected Profits To Expenses' , UIElementBuilders . CheckBox . setButtonShape ( PointShape . Circle ) )
157
- legend . add ( areaExpense , true , 'Expected Profits To Expenses' , UIElementBuilders . CheckBox . setButtonShape ( PointShape . Circle ) )
0 commit comments