Skip to content

Commit e02d31a

Browse files
author
Niilo Keinänen
committed
LCJS v8.0.0
1 parent c1a2b73 commit e02d31a

File tree

8 files changed

+32
-34
lines changed

8 files changed

+32
-34
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ Direct developer email support can be purchased through a [Support Plan][4] or b
141141
© LightningChart Ltd 2009-2022. All rights reserved.
142142

143143

144-
[Pyramid Chart]: https://lightningchart.com/js-charts/api-documentation/v7.1.0/classes/PyramidChart.html
145-
[Pyramid Chart Types]: https://lightningchart.com/js-charts/api-documentation/v7.1.0/variables/PyramidChartTypes-1.html
146-
[Pyramid Label Side]: https://lightningchart.com/js-charts/api-documentation/v7.1.0/enums/PyramidLabelSide.html
147-
[Slice label formatter]: https://lightningchart.com/js-charts/api-documentation/v7.1.0/types/SliceLabelFormatter.html
148-
[Palette]: https://lightningchart.com/js-charts/api-documentation/v7.1.0/variables/ColorPalettes.html
149-
[SolidFillPalette]: https://lightningchart.com/js-charts/api-documentation/v7.1.0/functions/SolidFillPalette.html
150-
[Solid Line]: https://lightningchart.com/js-charts/api-documentation/v7.1.0/classes/SolidLine.html
151-
[Solid Fill]: https://lightningchart.com/js-charts/api-documentation/v7.1.0/classes/SolidFill.html
144+
[Pyramid Chart]: https://lightningchart.com/js-charts/api-documentation/v8.0.0/classes/PyramidChart.html
145+
[Pyramid Chart Types]: https://lightningchart.com/js-charts/api-documentation/v8.0.0/variables/PyramidChartTypes-1.html
146+
[Pyramid Label Side]: https://lightningchart.com/js-charts/api-documentation/v8.0.0/enums/PyramidLabelSide.html
147+
[Slice label formatter]: https://lightningchart.com/js-charts/api-documentation/v8.0.0/types/SliceLabelFormatter.html
148+
[Palette]: https://lightningchart.com/js-charts/api-documentation/v8.0.0/variables/ColorPalettes.html
149+
[SolidFillPalette]: https://lightningchart.com/js-charts/api-documentation/v8.0.0/functions/SolidFillPalette.html
150+
[Solid Line]: https://lightningchart.com/js-charts/api-documentation/v8.0.0/classes/SolidLine.html
151+
[Solid Fill]: https://lightningchart.com/js-charts/api-documentation/v8.0.0/classes/SolidFill.html
152152

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"webpack-stream": "^7.0.0"
1818
},
1919
"dependencies": {
20-
"@lightningchart/lcjs": "^7.1.0",
21-
"@lightningchart/xydata": "^1.4.0"
20+
"@lightningchart/lcjs": "^8.0.0",
21+
"@lightningchart/xydata": "^1.5.0"
2222
},
2323
"lightningChart": {
2424
"eID": "0465"

simplePyramid-cyberSpace.png

262 KB
Loading

simplePyramid-darkGold.png

285 KB
Loading

simplePyramid-light.png

113 KB
Loading

simplePyramid-lightNature.png

121 KB
Loading

simplePyramid-turquoiseHexagon.png

169 KB
Loading

src/index.js

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,30 @@
55
const lcjs = require('@lightningchart/lcjs')
66

77
// Extract required parts from LightningChartJS.
8-
const { PyramidChartTypes, PyramidLabelSide, SliceLabelFormatters, lightningChart, LegendBoxBuilders, Themes } = lcjs
8+
const { PyramidChartTypes, PyramidLabelSide, PyramidSliceModes, SliceLabelFormatters, lightningChart, LegendBoxBuilders, Themes } = lcjs
99

10-
// Create a Pyramid chart
11-
const pyramid = lightningChart({
10+
const lc = lightningChart({
1211
resourcesBaseUrl: new URL(document.head.baseURI).origin + new URL(document.head.baseURI).pathname + 'resources/',
1312
})
14-
.Pyramid({
15-
theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined,
16-
type: PyramidChartTypes.LabelsOnSides,
17-
})
13+
const dashboard = lc.Dashboard({
14+
numberOfColumns: 2,
15+
numberOfRows: 1,
16+
theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined,
17+
})
18+
19+
const pyramid1 = dashboard
20+
.createPyramidChart({ columnIndex: 0, rowIndex: 0, type: PyramidChartTypes.LabelsOnSides })
21+
.setTitle('Company staff growth')
22+
.setSliceGap(5)
23+
.setLabelSide(PyramidLabelSide.Left)
24+
.setSliceMode(PyramidSliceModes.VariableWidth)
25+
26+
const pyramid2 = dashboard
27+
.createPyramidChart({ columnIndex: 1, rowIndex: 0, type: PyramidChartTypes.LabelsOnSides })
1828
.setTitle('Company staff growth')
19-
.setNeckWidth(80)
2029
.setSliceGap(5)
21-
.setPadding({ bottom: 45 })
2230
.setLabelSide(PyramidLabelSide.Right)
31+
.setSliceMode(PyramidSliceModes.VariableHeight)
2332

2433
// Data for slices
2534
const data = [
@@ -40,20 +49,9 @@ const data = [
4049
value: 17,
4150
},
4251
]
43-
// Add data to the slices
44-
pyramid.addSlices(data)
45-
46-
// Set formatter of Slice Labels
47-
pyramid.setLabelFormatter(SliceLabelFormatters.NamePlusValue)
4852

49-
// Add LegendBox and define the position in the chart
50-
const lb = pyramid
51-
.addLegendBox(LegendBoxBuilders.HorizontalLegendBox)
52-
// Dispose example UI elements automatically if they take too much space. This is to avoid bad UI on mobile / etc. devices.
53-
.setAutoDispose({
54-
type: 'max-width',
55-
maxWidth: 0.8,
56-
})
53+
pyramid1.addSlices(data)
54+
pyramid1.setLabelFormatter(SliceLabelFormatters.NamePlusValue)
5755

58-
// Add the Pyramid to the LegendBox and disable the button click functionality.
59-
lb.add(pyramid, { toggleVisibilityOnClick: false })
56+
pyramid2.addSlices(data)
57+
pyramid2.setLabelFormatter(SliceLabelFormatters.NamePlusValue)

0 commit comments

Comments
 (0)