Skip to content

Commit

Permalink
Merge pull request #3291 from VisActor/docs/harmony-doc
Browse files Browse the repository at this point in the history
docs: update harmony-vchart docs
  • Loading branch information
xile611 authored Oct 10, 2024
2 parents a6e13f2 + d18fffb commit 2c8c7cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ const spec = '{"type":"bar","data":[{"id":"barData","values":[{"month":"Monday",
@Entry
@Component
struct Index {
@State message: string = 'Hello World';
@State message: string = 'Hello World';
@State spec: Object | null = null;

onPageShow(): void {
this.spec = JSON.parse(spec);
}

build() {
Row() {
Expand All @@ -57,7 +62,7 @@ struct Index {
.fontSize(50)
.fontWeight(FontWeight.Bold)
VChart({
spec: JSON.parse(spec), w: 300, h: 300,
spec: this.spec, w: 300, h: 300,
onChartInitCb: () => {},
onChartReadyCb: () => {}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ const spec = '{"type":"bar","data":[{"id":"barData","values":[{"month":"Monday",
@Entry
@Component
struct Index {
@State message: string = 'Hello World';
@State message: string = 'Hello World';
@State spec: Object | null = null;

onPageShow(): void {
this.spec = JSON.parse(spec);
}

build() {
Row() {
Expand All @@ -57,7 +62,7 @@ struct Index {
.fontSize(50)
.fontWeight(FontWeight.Bold)
VChart({
spec: JSON.parse(spec), w: 300, h: 300,
spec: this.spec, w: 300, h: 300,
onChartInitCb: () => {},
onChartReadyCb: () => {}
})
Expand Down

0 comments on commit 2c8c7cc

Please sign in to comment.